Bug 1321638 - Part 4: Remove last GeckoInterface.getActivity call in geckoview. r=jchen
authorNick Alexander <nalexander@mozilla.com>
Tue, 13 Dec 2016 21:52:26 -0800
changeset 450755 6a26aae5ea154b5c2be2dd637e926c13e20d8d40
parent 450754 76f783fafa657f8becfde04a7884ed437e5f1b3c
child 450756 82893c43bbd5f7971c5d67fe7889f7be9d6b1921
push id38944
push userbmo:leftysolara@gmail.com
push dateSun, 18 Dec 2016 16:01:15 +0000
reviewersjchen
bugs1321638
milestone53.0a1
Bug 1321638 - Part 4: Remove last GeckoInterface.getActivity call in geckoview. r=jchen This API is vestigial. Sadly we can't remove GeckoInterface.getActivity entirely since there are still some Fennec consumers that I don't care to unravel just yet. MozReview-Commit-ID: HX038okB4sR
mobile/android/geckoview/src/main/java/org/mozilla/gecko/BaseGeckoInterface.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/BaseGeckoInterface.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/BaseGeckoInterface.java
@@ -39,17 +39,18 @@ public class BaseGeckoInterface implemen
         if (mProfile == null) {
             mProfile = GeckoProfile.get(mContext);
         }
         return mProfile;
     }
 
     @Override
     public Activity getActivity() {
-        return (Activity)mContext;
+        // By default, GeckoView consumers do not have a distinguished current foreground Activity.
+        return null;
     }
 
     @Override
     public String getDefaultUAString() {
         return HardwareUtils.isTablet() ? AppConstants.USER_AGENT_FENNEC_TABLET :
                                           AppConstants.USER_AGENT_FENNEC_MOBILE;
     }
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -831,18 +831,17 @@ public class GeckoAppShell
             break;
         default:
             Log.w(LOGTAG, "Error! Can't disable unknown SENSOR type " + aSensortype);
         }
     }
 
     @WrapForJNI(calledFrom = "gecko")
     private static void moveTaskToBack() {
-        if (getGeckoInterface() != null)
-            getGeckoInterface().getActivity().moveTaskToBack(true);
+        // This is a vestige, to be removed as full-screen support for GeckoView is implemented.
     }
 
     @WrapForJNI(calledFrom = "gecko")
     public static void scheduleRestart() {
         getGeckoInterface().doRestart();
     }
 
     // Creates a homescreen shortcut for a web page.