зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1161195 - Part 1: Set java class names at compile time. r=nalexander
Rather than hardcoding the following classes in AppConstants.java.in and AndroidManifest.xml, they are set in confvars.sh: org.mozilla.gecko.GeckoApplication (Specified using MOZ_ANDROID_APPLICATION_CLASS) org.mozilla.gecko.BrowserApp (Specified using MOZ_ANDROID_BROWSER_INTENT_CLASS) org.mozilla.search.SearchActivity (Specified using MOZ_ANDROID_SEARCH_INTENT_CLASS)
This commit is contained in:
Родитель
bb97bae3b3
Коммит
79c3b4b7be
|
@ -8485,6 +8485,9 @@ AC_SUBST(MOZ_ANDROID_SHARE_OVERLAY)
|
||||||
AC_SUBST(MOZ_ANDROID_TAB_QUEUE)
|
AC_SUBST(MOZ_ANDROID_TAB_QUEUE)
|
||||||
AC_SUBST(MOZ_ANDROID_MLS_STUMBLER)
|
AC_SUBST(MOZ_ANDROID_MLS_STUMBLER)
|
||||||
AC_SUBST(MOZ_ANDROID_DOWNLOADS_INTEGRATION)
|
AC_SUBST(MOZ_ANDROID_DOWNLOADS_INTEGRATION)
|
||||||
|
AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS)
|
||||||
|
AC_SUBST(MOZ_ANDROID_BROWSER_INTENT_CLASS)
|
||||||
|
AC_SUBST(MOZ_ANDROID_SEARCH_INTENT_CLASS)
|
||||||
AC_SUBST(MOZ_INSTALL_TRACKING)
|
AC_SUBST(MOZ_INSTALL_TRACKING)
|
||||||
AC_SUBST(ENABLE_STRIP)
|
AC_SUBST(ENABLE_STRIP)
|
||||||
AC_SUBST(PKG_SKIP_STRIP)
|
AC_SUBST(PKG_SKIP_STRIP)
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
<application android:label="@string/moz_app_displayname"
|
<application android:label="@string/moz_app_displayname"
|
||||||
android:icon="@drawable/icon"
|
android:icon="@drawable/icon"
|
||||||
android:logo="@drawable/logo"
|
android:logo="@drawable/logo"
|
||||||
android:name="org.mozilla.gecko.GeckoApplication"
|
android:name="@MOZ_ANDROID_APPLICATION_CLASS@"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
# The preprocessor does not yet support arbitrary parentheses, so this cannot
|
# The preprocessor does not yet support arbitrary parentheses, so this cannot
|
||||||
# be parenthesized thus to clarify that the logical AND operator has precedence:
|
# be parenthesized thus to clarify that the logical AND operator has precedence:
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
|
|
||||||
<!-- If the windowSoftInputMode adjust* flag changes below, the
|
<!-- If the windowSoftInputMode adjust* flag changes below, the
|
||||||
setSoftInputMode call in BrowserSearch#onStop must also be updated. -->
|
setSoftInputMode call in BrowserSearch#onStop must also be updated. -->
|
||||||
<activity android:name="org.mozilla.gecko.BrowserApp"
|
<activity android:name="@MOZ_ANDROID_BROWSER_INTENT_CLASS@"
|
||||||
android:label="@string/moz_app_displayname"
|
android:label="@string/moz_app_displayname"
|
||||||
android:taskAffinity="@ANDROID_PACKAGE_NAME@.BROWSER"
|
android:taskAffinity="@ANDROID_PACKAGE_NAME@.BROWSER"
|
||||||
android:alwaysRetainTaskState="true"
|
android:alwaysRetainTaskState="true"
|
||||||
|
@ -134,7 +134,7 @@
|
||||||
for backwards compatibility. -->
|
for backwards compatibility. -->
|
||||||
<activity-alias android:name=".App"
|
<activity-alias android:name=".App"
|
||||||
android:label="@MOZ_APP_DISPLAYNAME@"
|
android:label="@MOZ_APP_DISPLAYNAME@"
|
||||||
android:targetActivity="org.mozilla.gecko.BrowserApp">
|
android:targetActivity="@MOZ_ANDROID_BROWSER_INTENT_CLASS@">
|
||||||
<!-- android:priority ranges between -1000 and 1000. We never want
|
<!-- android:priority ranges between -1000 and 1000. We never want
|
||||||
another activity to usurp the MAIN action, so we ratchet our
|
another activity to usurp the MAIN action, so we ratchet our
|
||||||
priority up. -->
|
priority up. -->
|
||||||
|
@ -356,7 +356,7 @@
|
||||||
<!-- Masquerade as the Resolver so that we can be opened from the Marketplace. -->
|
<!-- Masquerade as the Resolver so that we can be opened from the Marketplace. -->
|
||||||
<activity-alias
|
<activity-alias
|
||||||
android:name="com.android.internal.app.ResolverActivity"
|
android:name="com.android.internal.app.ResolverActivity"
|
||||||
android:targetActivity="org.mozilla.gecko.BrowserApp"
|
android:targetActivity="@MOZ_ANDROID_BROWSER_INTENT_CLASS@"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
|
|
||||||
<receiver android:name="org.mozilla.gecko.GeckoUpdateReceiver">
|
<receiver android:name="org.mozilla.gecko.GeckoUpdateReceiver">
|
||||||
|
|
|
@ -81,10 +81,17 @@ public class AppConstants {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the Java class that launches the browser.
|
* The name of the Java class that represents the android application.
|
||||||
*/
|
*/
|
||||||
public static final String BROWSER_INTENT_CLASS_NAME = "org.mozilla.gecko.BrowserApp";
|
public static final String MOZ_ANDROID_APPLICATION_CLASS_NAME = "@MOZ_ANDROID_APPLICATION_CLASS@";
|
||||||
public static final String SEARCH_INTENT_CLASS_NAME = "org.mozilla.search.SearchActivity";
|
/**
|
||||||
|
* The name of the Java class that launches the browser activity.
|
||||||
|
*/
|
||||||
|
public static final String BROWSER_INTENT_CLASS_NAME = "@MOZ_ANDROID_BROWSER_INTENT_CLASS@";
|
||||||
|
/**
|
||||||
|
* The name of the Java class that launches the search activity.
|
||||||
|
*/
|
||||||
|
public static final String SEARCH_INTENT_CLASS_NAME = "@MOZ_ANDROID_SEARCH_INTENT_CLASS@";
|
||||||
|
|
||||||
public static final String GRE_MILESTONE = "@GRE_MILESTONE@";
|
public static final String GRE_MILESTONE = "@GRE_MILESTONE@";
|
||||||
|
|
||||||
|
|
|
@ -753,6 +753,7 @@ for var in ('ANDROID_PACKAGE_NAME', 'ANDROID_CPU_ARCH',
|
||||||
'GRE_MILESTONE', 'MOZ_APP_BASENAME', 'MOZ_MOZILLA_API_KEY',
|
'GRE_MILESTONE', 'MOZ_APP_BASENAME', 'MOZ_MOZILLA_API_KEY',
|
||||||
'MOZ_APP_DISPLAYNAME', 'MOZ_APP_ID', 'MOZ_APP_NAME',
|
'MOZ_APP_DISPLAYNAME', 'MOZ_APP_ID', 'MOZ_APP_NAME',
|
||||||
'MOZ_APP_VENDOR', 'MOZ_APP_VERSION', 'MOZ_CHILD_PROCESS_NAME',
|
'MOZ_APP_VENDOR', 'MOZ_APP_VERSION', 'MOZ_CHILD_PROCESS_NAME',
|
||||||
|
'MOZ_ANDROID_APPLICATION_CLASS', 'MOZ_ANDROID_BROWSER_INTENT_CLASS', 'MOZ_ANDROID_SEARCH_INTENT_CLASS',
|
||||||
'MOZ_CRASHREPORTER', 'MOZ_UPDATE_CHANNEL', 'OMNIJAR_NAME',
|
'MOZ_CRASHREPORTER', 'MOZ_UPDATE_CHANNEL', 'OMNIJAR_NAME',
|
||||||
'OS_TARGET', 'TARGET_XPCOM_ABI'):
|
'OS_TARGET', 'TARGET_XPCOM_ABI'):
|
||||||
DEFINES[var] = CONFIG[var]
|
DEFINES[var] = CONFIG[var]
|
||||||
|
|
|
@ -16,6 +16,12 @@ MOZ_OFFICIAL_BRANDING_DIRECTORY=mobile/android/branding/official
|
||||||
# See the --enable-android-min-sdk and --enable-android-max-sdk arguments in configure.in.
|
# See the --enable-android-min-sdk and --enable-android-max-sdk arguments in configure.in.
|
||||||
MOZ_ANDROID_MIN_SDK_VERSION=9
|
MOZ_ANDROID_MIN_SDK_VERSION=9
|
||||||
|
|
||||||
|
# There are several entry points into the Firefox application. These are the names of some of the classes that are
|
||||||
|
# listed in the Android manifest. They are specified in here to avoid hard-coding them in source code files.
|
||||||
|
MOZ_ANDROID_APPLICATION_CLASS=org.mozilla.gecko.GeckoApplication
|
||||||
|
MOZ_ANDROID_BROWSER_INTENT_CLASS=org.mozilla.gecko.BrowserApp
|
||||||
|
MOZ_ANDROID_SEARCH_INTENT_CLASS=org.mozilla.search.SearchActivity
|
||||||
|
|
||||||
MOZ_SAFE_BROWSING=1
|
MOZ_SAFE_BROWSING=1
|
||||||
|
|
||||||
MOZ_NO_SMART_CARDS=1
|
MOZ_NO_SMART_CARDS=1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<activity
|
<activity
|
||||||
android:name="org.mozilla.search.SearchActivity"
|
android:name="@MOZ_ANDROID_SEARCH_INTENT_CLASS@"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:icon="@drawable/search_launcher"
|
android:icon="@drawable/search_launcher"
|
||||||
android:label="@string/search_app_name"
|
android:label="@string/search_app_name"
|
||||||
|
@ -40,9 +40,9 @@
|
||||||
android:name="org.mozilla.search.SearchPreferenceActivity"
|
android:name="org.mozilla.search.SearchPreferenceActivity"
|
||||||
android:logo="@drawable/search_launcher"
|
android:logo="@drawable/search_launcher"
|
||||||
android:label="@string/search_pref_title"
|
android:label="@string/search_pref_title"
|
||||||
android:parentActivityName="org.mozilla.search.SearchActivity"
|
android:parentActivityName="@MOZ_ANDROID_SEARCH_INTENT_CLASS@"
|
||||||
android:theme="@style/SettingsTheme" >
|
android:theme="@style/SettingsTheme" >
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="org.mozilla.search.SearchActivity"/>
|
android:value="@MOZ_ANDROID_SEARCH_INTENT_CLASS@"/>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче