Bug 1242213 - Part 2: Fold App <activity-alias> into BrowserApp <activity>. r?mfinkle draft
authorNick Alexander <nalexander@mozilla.com>
Sun, 24 Jan 2016 22:00:29 -0800
changeset 325468 4a98e0ac5d422a7494c9656d39ea9c325f7f99b1
parent 325467 851aed59656f2ed10b0211d8a943de3096cdabe9
child 325469 9ac167b66ad752b525e1cae01b9de2f3f6657fbc
push id9977
push usernalexander@mozilla.com
push dateMon, 25 Jan 2016 16:50:39 +0000
reviewersmfinkle
bugs1242213, 929865
milestone46.0a1
Bug 1242213 - Part 2: Fold App <activity-alias> into BrowserApp <activity>. r?mfinkle Way back in Fennec 33 (Bug 929865, see https://hg.mozilla.org/mozilla-central/rev/a4f39c9db1d9) we replaced org.mozilla.gecko.App with org.mozilla.gecko.BrowserApp and introduced the .App <activity-alias>. Per the entry for android:name of http://developer.android.com/guide/topics/manifest/activity-element.html, .App translates to $ANDROID_PACKAGE_NAME.App. We haven't referenced an Activity qualified with a non-org.mozilla.gecko *class* name (for example, from bookmark shortcuts) since well before Fennec 33, so this probably never did what it was intended to do: we wanted to redirect org.mozilla.gecko.App to org.mozilla.gecko.BrowserApp, but it instead has been redirecting org.mozilla.fennec.App to org.mozilla.gecko.BrowserApp. I don't think we've been referring to $ANDROID_PACKAGE_NAME.App since well before Fennec 29, if ever. The <activity-alias> has been servicing essentially all <intent-filter> invocations of Fennec by passing them directly to org.mozilla.gecko.BrowserApp. This pushes a long programme of simplification forward. Fallout might look like very old homescreen shortcuts failing to launch, but I'm quite confident that won't actually happen.
mobile/android/base/AndroidManifest.xml.in
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -106,44 +106,31 @@
 
         <meta-data android:name="com.sec.android.support.multiwindow" android:value="true"/>
 
 #ifdef MOZ_NATIVE_DEVICES
         <!-- This resources comes from Google Play Services. Required for casting support. -->
         <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
 #endif
 
+        <!-- Fennec is shipped as the Android package named
+             org.mozilla.{fennec,firefox,firefox_beta}.  The internal Java
+             package hierarchy inside the Android package used to have an
+             org.mozilla.{fennec,firefox,firefox_beta} subtree *and* an
+             org.mozilla.gecko subtree; it now only has org.mozilla.gecko. -->
         <activity android:name="@MOZ_ANDROID_BROWSER_INTENT_CLASS@"
                   android:label="@string/moz_app_displayname"
                   android:taskAffinity="@ANDROID_PACKAGE_NAME@.BROWSER"
                   android:alwaysRetainTaskState="true"
                   android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection"
                   android:windowSoftInputMode="stateUnspecified|adjustResize"
                   android:launchMode="singleTask"
                   android:exported="true"
                   android:theme="@style/Gecko.App">
-          <!-- We export this activity so that it can be launched by explicit
-               intents, in particular homescreen shortcuts.  See Bug 1032217.
-               In future we would prefer to move all intent filters off the .App
-               alias and onto BrowserApp so that we can deprecate activities
-               that refer to pre-processed class names. -->
-        </activity>
 
-        <!-- Fennec is shipped as the Android package named
-             org.mozilla.{fennec,firefox,firefox_beta}.  The internal Java package
-             hierarchy inside the Android package has both an
-             org.mozilla.{fennec,firefox,firefox_beta} subtree *and* an
-             org.mozilla.gecko subtree.  The non-org.mozilla.gecko is deprecated
-             and we would like to get rid of it entirely.  Until that happens, we
-             have external consumers (such as intents and bookmarks) of
-             non-org.mozilla.gecko Activity classes, so we define activity aliases
-             for backwards compatibility. -->
-        <activity-alias android:name=".App"
-                        android:label="@MOZ_APP_DISPLAYNAME@"
-                        android:targetActivity="@MOZ_ANDROID_BROWSER_INTENT_CLASS@">
             <!-- android:priority ranges between -1000 and 1000.  We never want
                  another activity to usurp the MAIN action, so we ratchet our
                  priority up. -->
             <intent-filter android:priority="999">
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
                 <category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
                 <category android:name="android.intent.category.APP_BROWSER" />
@@ -214,17 +201,17 @@
             </intent-filter>
 #endif
 
             <!-- For debugging -->
             <intent-filter>
                 <action android:name="org.mozilla.gecko.DEBUG" />
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
-        </activity-alias>
+        </activity>
 
         <service android:name="org.mozilla.gecko.GeckoService" />
 
         <activity android:name="org.mozilla.gecko.trackingprotection.TrackingProtectionPrompt"
                   android:launchMode="singleTop"
                   android:theme="@style/OverlayActivity" />
 
         <!-- The main reason for the Tab Queue build flag is to not mess with the VIEW intent filter