Bug 1537964 - Call bindService() with BIND_IMPORTANT r=snorp
authorRandall Barker <rbarker@mozilla.com>
Mon, 25 Mar 2019 14:29:54 +0000
changeset 465976 5a29abda45117075cc7ce1299d96edecaa4bb0dc
parent 465975 6ef62825d79f142b9aabd982d84f2e69e4eded06
child 465977 0ebb51472ce4081235fea82701839bcdfc10642c
push id112550
push userrgurzau@mozilla.com
push dateTue, 26 Mar 2019 09:57:15 +0000
treeherdermozilla-inbound@b8be99473610 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1537964
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1537964 - Call bindService() with BIND_IMPORTANT r=snorp Differential Revision: https://phabricator.services.mozilla.com/D24418
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteManager.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteManager.java
@@ -60,17 +60,17 @@ public final class RemoteManager impleme
         public void onServiceDisconnected(final ComponentName name) {
             if (DEBUG) Log.d(LOGTAG, "service disconnected");
             unlink();
         }
 
         private boolean connect() {
             Context appCtxt = GeckoAppShell.getApplicationContext();
             appCtxt.bindService(new Intent(appCtxt, MediaManager.class),
-                    mConnection, Context.BIND_AUTO_CREATE);
+                    mConnection, Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT);
             waitConnect();
             return mRemote != null;
         }
 
         // Wait up to 5s.
         private synchronized void waitConnect() {
             int waitCount = 0;
             while (mRemote == null && waitCount < 5) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
@@ -81,17 +81,17 @@ public final class GeckoProcessManager e
                 return mChild;
             }
 
             final Context context = GeckoAppShell.getApplicationContext();
             final Intent intent = new Intent();
             intent.setClassName(context,
                                 GeckoServiceChildProcess.class.getName() + '$' + mType);
 
-            if (context.bindService(intent, this, Context.BIND_AUTO_CREATE)) {
+            if (context.bindService(intent, this, Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT)) {
                 waitForChildLocked();
                 if (mChild != null) {
                     return mChild;
                 }
             }
 
             Log.e(LOGTAG, "Cannot connect to process " + mType);
             unbind();