Bug 1386712 - Load about:blank in CustomTabsActivity.finish() to immediately stop media playback. r=snorp
authorDylan Roeh <droeh@mozilla.com>
Tue, 19 Sep 2017 15:09:16 -0500
changeset 668870 c86578718e191af2dac78dfde75b002448ea80ec
parent 668869 2558072d1c5f1d951a0e9011c07f043676212ee7
child 668871 8871efefdba925fd4fa7e8741cb545dd64131271
push id81146
push userbmo:topwu.tw@gmail.com
push dateFri, 22 Sep 2017 05:24:51 +0000
reviewerssnorp
bugs1386712
milestone58.0a1
Bug 1386712 - Load about:blank in CustomTabsActivity.finish() to immediately stop media playback. r=snorp
mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
@@ -213,16 +213,18 @@ public class CustomTabsActivity extends 
             return IntentUtil.getAnimationPackageName(new SafeIntent(getIntent()));
         } else {
             return super.getPackageName();
         }
     }
 
     @Override
     public void finish() {
+        mGeckoView.loadUri("about:blank");
+
         super.finish();
 
         final SafeIntent intent = new SafeIntent(getIntent());
         // When 3rd party app launch this Activity, it could also specify custom exit-animation.
         if (IntentUtil.hasExitAnimation(intent)) {
             usingCustomAnimation = true;
             overridePendingTransition(IntentUtil.getEnterAnimationRes(intent),
                     IntentUtil.getExitAnimationRes(intent));