Bug 1032217 - Export gecko.{WebApp,BrowserApp}. r=bnicholson
authorNick Alexander <nalexander@mozilla.com>
Fri, 18 Jul 2014 09:39:56 -0700
changeset 215711 67ae43394166e536dce4c816b822f40c1534d611
parent 215710 12c90729d420563fc63c689bd3edb5b1671b6415
child 215712 f1ab07827b04a1c18d3e708e853e7dde164e4fe0
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs1032217, 12501, 12177
milestone33.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 1032217 - Export gecko.{WebApp,BrowserApp}. r=bnicholson This allows explicit intents from outside of the App. Tested locally by: * creating and launching a home screen shortcut; (the presenting issue) * trying a an "old style" webapp home screen launch, like: adb shell am start -a org.mozilla.gecko.WEBAPP -n org.mozilla.fennec_nalexander/.Webapp -d http://penguinpop.justplaymobile.com/penguinpop.webapp and adb shell am start -a org.mozilla.gecko.WEBAPP -n org.mozilla.fennec_nalexander/org.mozilla.gecko.Webapp -d http://penguinpop.justplaymobile.com/penguinpop.webapp Both log the expected message in the dispatcher: W GeckoWebappImpl(12501) no package name; treating as legacy shortcut Both fail with: E GeckoConsole(12177) Error getting pref for application/x-web-app-manifest+json. I verified that this behaviour happens with the Nightly of June 24, 2014 -- the one right before the patch that introduced this regression.
mobile/android/base/AndroidManifest.xml.in
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -101,17 +101,23 @@
              setSoftInputMode call in BrowserSearch#onStop must also be updated. -->
         <activity android:name="org.mozilla.gecko.BrowserApp"
                   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
@@ -250,20 +256,26 @@
         <activity android:name="org.mozilla.gecko.Webapp"
                   android:label="@string/webapp_generic_name"
                   android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize"
                   android:windowSoftInputMode="stateUnspecified|adjustResize"
                   android:launchMode="singleTask"
                   android:taskAffinity="org.mozilla.gecko.WEBAPP"
                   android:process=":@ANDROID_PACKAGE_NAME@.Webapp"
                   android:excludeFromRecents="true"
+                  android:exported="true"
                   android:theme="@style/Gecko.App">
+          <!-- We export this activity so that it can be launched by explicit
+               intents, in particular old-style WebApp launching homescreen
+               shortcuts. Such shortcuts were made before the new "synthetic
+               APK" WebApps were deployed. See Bug 1032217. -->
         </activity>
 
-        <!-- Alias Webapp so we can launch it from the package namespace. -->
+        <!-- Alias Webapp so we can launch it from the package namespace. Prefer
+             to launch with the fully qualified name "org.mozilla.gecko.Webapp". -->
         <activity-alias android:name=".Webapp"
                         android:label="@string/webapp_generic_name"
                         android:targetActivity="org.mozilla.gecko.Webapp">
             <intent-filter>
                 <action android:name="org.mozilla.gecko.WEBAPP" />
             </intent-filter>
             <intent-filter>
                 <action android:name="org.mozilla.gecko.ACTION_ALERT_CALLBACK" />