Bug 1537964 - Call bindService() with BIND_IMPORTANT r=snorp a=pascalc
authorRandall Barker <rbarker@mozilla.com>
Mon, 25 Mar 2019 14:29:54 +0000
changeset 525919 251103ed375f19184a5d2c1a5c0b64ed9dbb9307
parent 525918 04421c47a400f7f3cdb4844a695e7fbc3c52956c
child 525920 32f822dd45b8c243058756713840819b67b59afd
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, pascalc
bugs1537964
milestone67.0
Bug 1537964 - Call bindService() with BIND_IMPORTANT r=snorp a=pascalc 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();