Bug 929865 - Part 2: Use <activity-alias> to wrap activities in generated namespace. r=bnicholson,myk

--HG--
rename : mobile/android/base/App.java.in => mobile/android/base/App.java
rename : mobile/android/base/Webapp.java.in => mobile/android/base/Webapp.java
extra : rebase_source : 176139e89facd5e96cff25dd4012c4e269d4a0a0
This commit is contained in:
Nick Alexander 2014-06-24 18:20:13 -07:00
Родитель dc6617c17c
Коммит a83bceb338
10 изменённых файлов: 540 добавлений и 44 удалений

Просмотреть файл

@ -95,7 +95,7 @@
<!-- If the windowSoftInputMode adjust* flag changes below, the
setSoftInputMode call in BrowserSearch#onStop must also be updated. -->
<activity android:name=".App"
<activity android:name="org.mozilla.gecko.App"
android:label="@string/moz_app_displayname"
android:taskAffinity="@ANDROID_PACKAGE_NAME@.BROWSER"
android:alwaysRetainTaskState="true"
@ -103,7 +103,12 @@
android:windowSoftInputMode="stateUnspecified|adjustResize"
android:launchMode="singleTask"
android:theme="@style/Gecko.App">
</activity>
<!-- Alias App so we can launch it from the package namespace. -->
<activity-alias android:name=".App"
android:label="@MOZ_APP_DISPLAYNAME@"
android:targetActivity="org.mozilla.gecko.App">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@ -196,7 +201,7 @@
<action android:name="org.mozilla.gecko.DEBUG" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</activity-alias>
<activity android:name="org.mozilla.gecko.webapp.Dispatcher"
android:noHistory="true" >
@ -222,7 +227,8 @@
</intent-filter>
</receiver>
<activity android:name=".Webapp"
<!-- Activity used for launching non-privileged WebApps via a URL -->
<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"
@ -231,13 +237,19 @@
android:process=":@ANDROID_PACKAGE_NAME@.Webapp"
android:excludeFromRecents="true"
android:theme="@style/Gecko.App">
</activity>
<!-- Alias Webapp so we can launch it from the package namespace. -->
<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" />
</intent-filter>
</activity>
</activity-alias>
<!-- Declare a predefined number of Webapp<num> activities. These are
used so that each web app can launch in its own process. Keep
@ -250,7 +262,7 @@
<!-- Masquerade as the Resolver so that we can be opened from the Marketplace. -->
<activity-alias
android:name="com.android.internal.app.ResolverActivity"
android:targetActivity=".App"
android:targetActivity="org.mozilla.gecko.App"
android:exported="true" />
<receiver android:name="org.mozilla.gecko.GeckoUpdateReceiver">

Просмотреть файл

@ -3,13 +3,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#filter substitution
package @ANDROID_PACKAGE_NAME@;
import org.mozilla.gecko.BrowserApp;
package org.mozilla.gecko;
/**
* This class serves only as a namespace wrapper for BrowserApp.
*/
public class App extends BrowserApp {}

Просмотреть файл

@ -25,7 +25,7 @@ public class AppConstants {
/**
* The name of the Java class that launches the browser.
*/
public static final String BROWSER_INTENT_CLASS_NAME = ANDROID_PACKAGE_NAME + ".App";
public static final String BROWSER_INTENT_CLASS_NAME = "org.mozilla.gecko.App";
public static final String GRE_MILESTONE = "@GRE_MILESTONE@";

Просмотреть файл

@ -0,0 +1,513 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
/**
* Declare a predefined number of Webapp<num> classes to the Webapps class.
* These are used so that each web app can launch in its own process. Keep this
* number in sync with the number of web apps handled in WebappAllocator.
*/
public final class WebApps {
public static class WebApp0 extends Webapp {
@Override
protected int getIndex() { return 0; }
}
public static class WebApp1 extends Webapp {
@Override
protected int getIndex() { return 1; }
}
public static class WebApp2 extends Webapp {
@Override
protected int getIndex() { return 2; }
}
public static class WebApp3 extends Webapp {
@Override
protected int getIndex() { return 3; }
}
public static class WebApp4 extends Webapp {
@Override
protected int getIndex() { return 4; }
}
public static class WebApp5 extends Webapp {
@Override
protected int getIndex() { return 5; }
}
public static class WebApp6 extends Webapp {
@Override
protected int getIndex() { return 6; }
}
public static class WebApp7 extends Webapp {
@Override
protected int getIndex() { return 7; }
}
public static class WebApp8 extends Webapp {
@Override
protected int getIndex() { return 8; }
}
public static class WebApp9 extends Webapp {
@Override
protected int getIndex() { return 9; }
}
public static class WebApp10 extends Webapp {
@Override
protected int getIndex() { return 10; }
}
public static class WebApp11 extends Webapp {
@Override
protected int getIndex() { return 11; }
}
public static class WebApp12 extends Webapp {
@Override
protected int getIndex() { return 12; }
}
public static class WebApp13 extends Webapp {
@Override
protected int getIndex() { return 13; }
}
public static class WebApp14 extends Webapp {
@Override
protected int getIndex() { return 14; }
}
public static class WebApp15 extends Webapp {
@Override
protected int getIndex() { return 15; }
}
public static class WebApp16 extends Webapp {
@Override
protected int getIndex() { return 16; }
}
public static class WebApp17 extends Webapp {
@Override
protected int getIndex() { return 17; }
}
public static class WebApp18 extends Webapp {
@Override
protected int getIndex() { return 18; }
}
public static class WebApp19 extends Webapp {
@Override
protected int getIndex() { return 19; }
}
public static class WebApp20 extends Webapp {
@Override
protected int getIndex() { return 20; }
}
public static class WebApp21 extends Webapp {
@Override
protected int getIndex() { return 21; }
}
public static class WebApp22 extends Webapp {
@Override
protected int getIndex() { return 22; }
}
public static class WebApp23 extends Webapp {
@Override
protected int getIndex() { return 23; }
}
public static class WebApp24 extends Webapp {
@Override
protected int getIndex() { return 24; }
}
public static class WebApp25 extends Webapp {
@Override
protected int getIndex() { return 25; }
}
public static class WebApp26 extends Webapp {
@Override
protected int getIndex() { return 26; }
}
public static class WebApp27 extends Webapp {
@Override
protected int getIndex() { return 27; }
}
public static class WebApp28 extends Webapp {
@Override
protected int getIndex() { return 28; }
}
public static class WebApp29 extends Webapp {
@Override
protected int getIndex() { return 29; }
}
public static class WebApp30 extends Webapp {
@Override
protected int getIndex() { return 30; }
}
public static class WebApp31 extends Webapp {
@Override
protected int getIndex() { return 31; }
}
public static class WebApp32 extends Webapp {
@Override
protected int getIndex() { return 32; }
}
public static class WebApp33 extends Webapp {
@Override
protected int getIndex() { return 33; }
}
public static class WebApp34 extends Webapp {
@Override
protected int getIndex() { return 34; }
}
public static class WebApp35 extends Webapp {
@Override
protected int getIndex() { return 35; }
}
public static class WebApp36 extends Webapp {
@Override
protected int getIndex() { return 36; }
}
public static class WebApp37 extends Webapp {
@Override
protected int getIndex() { return 37; }
}
public static class WebApp38 extends Webapp {
@Override
protected int getIndex() { return 38; }
}
public static class WebApp39 extends Webapp {
@Override
protected int getIndex() { return 39; }
}
public static class WebApp40 extends Webapp {
@Override
protected int getIndex() { return 40; }
}
public static class WebApp41 extends Webapp {
@Override
protected int getIndex() { return 41; }
}
public static class WebApp42 extends Webapp {
@Override
protected int getIndex() { return 42; }
}
public static class WebApp43 extends Webapp {
@Override
protected int getIndex() { return 43; }
}
public static class WebApp44 extends Webapp {
@Override
protected int getIndex() { return 44; }
}
public static class WebApp45 extends Webapp {
@Override
protected int getIndex() { return 45; }
}
public static class WebApp46 extends Webapp {
@Override
protected int getIndex() { return 46; }
}
public static class WebApp47 extends Webapp {
@Override
protected int getIndex() { return 47; }
}
public static class WebApp48 extends Webapp {
@Override
protected int getIndex() { return 48; }
}
public static class WebApp49 extends Webapp {
@Override
protected int getIndex() { return 49; }
}
public static class WebApp50 extends Webapp {
@Override
protected int getIndex() { return 50; }
}
public static class WebApp51 extends Webapp {
@Override
protected int getIndex() { return 51; }
}
public static class WebApp52 extends Webapp {
@Override
protected int getIndex() { return 52; }
}
public static class WebApp53 extends Webapp {
@Override
protected int getIndex() { return 53; }
}
public static class WebApp54 extends Webapp {
@Override
protected int getIndex() { return 54; }
}
public static class WebApp55 extends Webapp {
@Override
protected int getIndex() { return 55; }
}
public static class WebApp56 extends Webapp {
@Override
protected int getIndex() { return 56; }
}
public static class WebApp57 extends Webapp {
@Override
protected int getIndex() { return 57; }
}
public static class WebApp58 extends Webapp {
@Override
protected int getIndex() { return 58; }
}
public static class WebApp59 extends Webapp {
@Override
protected int getIndex() { return 59; }
}
public static class WebApp60 extends Webapp {
@Override
protected int getIndex() { return 60; }
}
public static class WebApp61 extends Webapp {
@Override
protected int getIndex() { return 61; }
}
public static class WebApp62 extends Webapp {
@Override
protected int getIndex() { return 62; }
}
public static class WebApp63 extends Webapp {
@Override
protected int getIndex() { return 63; }
}
public static class WebApp64 extends Webapp {
@Override
protected int getIndex() { return 64; }
}
public static class WebApp65 extends Webapp {
@Override
protected int getIndex() { return 65; }
}
public static class WebApp66 extends Webapp {
@Override
protected int getIndex() { return 66; }
}
public static class WebApp67 extends Webapp {
@Override
protected int getIndex() { return 67; }
}
public static class WebApp68 extends Webapp {
@Override
protected int getIndex() { return 68; }
}
public static class WebApp69 extends Webapp {
@Override
protected int getIndex() { return 69; }
}
public static class WebApp70 extends Webapp {
@Override
protected int getIndex() { return 70; }
}
public static class WebApp71 extends Webapp {
@Override
protected int getIndex() { return 71; }
}
public static class WebApp72 extends Webapp {
@Override
protected int getIndex() { return 72; }
}
public static class WebApp73 extends Webapp {
@Override
protected int getIndex() { return 73; }
}
public static class WebApp74 extends Webapp {
@Override
protected int getIndex() { return 74; }
}
public static class WebApp75 extends Webapp {
@Override
protected int getIndex() { return 75; }
}
public static class WebApp76 extends Webapp {
@Override
protected int getIndex() { return 76; }
}
public static class WebApp77 extends Webapp {
@Override
protected int getIndex() { return 77; }
}
public static class WebApp78 extends Webapp {
@Override
protected int getIndex() { return 78; }
}
public static class WebApp79 extends Webapp {
@Override
protected int getIndex() { return 79; }
}
public static class WebApp80 extends Webapp {
@Override
protected int getIndex() { return 80; }
}
public static class WebApp81 extends Webapp {
@Override
protected int getIndex() { return 81; }
}
public static class WebApp82 extends Webapp {
@Override
protected int getIndex() { return 82; }
}
public static class WebApp83 extends Webapp {
@Override
protected int getIndex() { return 83; }
}
public static class WebApp84 extends Webapp {
@Override
protected int getIndex() { return 84; }
}
public static class WebApp85 extends Webapp {
@Override
protected int getIndex() { return 85; }
}
public static class WebApp86 extends Webapp {
@Override
protected int getIndex() { return 86; }
}
public static class WebApp87 extends Webapp {
@Override
protected int getIndex() { return 87; }
}
public static class WebApp88 extends Webapp {
@Override
protected int getIndex() { return 88; }
}
public static class WebApp89 extends Webapp {
@Override
protected int getIndex() { return 89; }
}
public static class WebApp90 extends Webapp {
@Override
protected int getIndex() { return 90; }
}
public static class WebApp91 extends Webapp {
@Override
protected int getIndex() { return 91; }
}
public static class WebApp92 extends Webapp {
@Override
protected int getIndex() { return 92; }
}
public static class WebApp93 extends Webapp {
@Override
protected int getIndex() { return 93; }
}
public static class WebApp94 extends Webapp {
@Override
protected int getIndex() { return 94; }
}
public static class WebApp95 extends Webapp {
@Override
protected int getIndex() { return 95; }
}
public static class WebApp96 extends Webapp {
@Override
protected int getIndex() { return 96; }
}
public static class WebApp97 extends Webapp {
@Override
protected int getIndex() { return 97; }
}
public static class WebApp98 extends Webapp {
@Override
protected int getIndex() { return 98; }
}
public static class WebApp99 extends Webapp {
@Override
protected int getIndex() { return 99; }
}
}

Просмотреть файл

@ -1,17 +0,0 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#filter substitution
package @ANDROID_PACKAGE_NAME@;
/**
* Declare a predefined number of Webapp<num> classes to the Webapps class.
* These are used so that each web app can launch in its own process. Keep this
* number in sync with the number of web apps handled in WebappAllocator.
*/
public final class WebApps {
#define FRAGMENT WebappsFragment.java.frag
#include WebappFragmentRepeater.inc
}

Просмотреть файл

@ -3,8 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#filter substitution
package @ANDROID_PACKAGE_NAME@;
package org.mozilla.gecko;
import org.mozilla.gecko.webapp.WebappImpl;

Просмотреть файл

@ -1,5 +0,0 @@
public static class WebApp@APPNUM@ extends Webapp {
@Override
protected int getIndex() { return @APPNUM@; }
}

Просмотреть файл

@ -27,7 +27,7 @@ public class GlobalConstants {
public static final String MOZ_APP_DISPLAYNAME = "@MOZ_APP_DISPLAYNAME@";
public static final String MOZ_APP_VERSION = "@MOZ_APP_VERSION@";
public static final String BROWSER_INTENT_PACKAGE = "@ANDROID_PACKAGE_NAME@";
public static final String BROWSER_INTENT_PACKAGE = "org.mozilla.gecko";
public static final String BROWSER_INTENT_CLASS = BROWSER_INTENT_PACKAGE + ".App";
/**

Просмотреть файл

@ -128,6 +128,7 @@ gbjar.sources += [
'animation/Rotate3DAnimation.java',
'animation/ViewHelper.java',
'ANRReporter.java',
'App.java',
'AppNotificationClient.java',
'Assert.java',
'BaseGeckoInterface.java',
@ -402,6 +403,7 @@ gbjar.sources += [
'updater/UpdateService.java',
'updater/UpdateServiceHelper.java',
'VideoPlayer.java',
'Webapp.java',
'webapp/Allocator.java',
'webapp/ApkResources.java',
'webapp/Dispatcher.java',
@ -411,6 +413,7 @@ gbjar.sources += [
'webapp/TaskKiller.java',
'webapp/UninstallListener.java',
'webapp/WebappImpl.java',
'WebApps.java',
'widget/ActivityChooserModel.java',
'widget/AllCapsTextView.java',
'widget/AnimatedHeightLayout.java',
@ -444,13 +447,6 @@ gbjar.sources += [ thirdparty_source_dir + f for f in [
'com/googlecode/eyesfree/braille/selfbraille/WriteData.java',
] ]
android_package_dir = CONFIG['ANDROID_PACKAGE_NAME'].replace('.', '/')
# All generated sources are handled specially in Makefile.in. And
# R.java is handled even more specially than the others!
gbjar.generated_sources += [ android_package_dir + f for f in [
'/App.java',
'/Webapp.java',
'/WebApps.java',
] ]
gbjar.generated_sources += [
'org/mozilla/gecko/AppConstants.java',
'org/mozilla/gecko/SysInfo.java',

Просмотреть файл

@ -8,11 +8,13 @@ package org.mozilla.gecko.tests;
import android.app.Activity;
import org.mozilla.gecko.App;
public class TestConstants {
/**
* The Java Class instance that launches the browser.
* <p>
* This should always agree with {@link AppConstants#BROWSER_INTENT_CLASS_NAME}.
*/
public static final Class<? extends Activity> BROWSER_INTENT_CLASS = @ANDROID_PACKAGE_NAME@.App.class;
public static final Class<? extends Activity> BROWSER_INTENT_CLASS = org.mozilla.gecko.App.class;
}