Bug 1276696 - Put custom tabs support behind a build flag. r?mcomella
MozReview-Commit-ID: 44wtCsZWZv2
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -289,18 +289,20 @@
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
+#ifdef MOZ_ANDROID_CUSTOM_TABS
<activity android:name="org.mozilla.gecko.customtabs.CustomTabsActivity"
android:theme="@style/Theme.AppCompat.NoActionBar" />
+#endif
<!-- Service to handle requests from overlays. -->
<service android:name="org.mozilla.gecko.overlays.service.OverlayActionService" />
<!--
Ensure that passwords provider runs in its own process. (Bug 718760.)
Process name is per-application to avoid loading CPs from multiple
Fennec versions into the same process. (Bug 749727.)
@@ -377,23 +379,25 @@
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>
<service
android:name="org.mozilla.gecko.telemetry.TelemetryUploadService"
android:exported="false"/>
+#ifdef MOZ_ANDROID_CUSTOM_TABS
<service
android:name="org.mozilla.gecko.customtabs.GeckoCustomTabsService"
android:exported="true">
<intent-filter>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent-filter>
</service>
+#endif
#include ../services/manifests/FxAccountAndroidManifest_services.xml.in
<service
android:name="org.mozilla.gecko.tabqueue.TabReceivedService"
android:exported="false" />
--- a/mobile/android/base/AppConstants.java.in
+++ b/mobile/android/base/AppConstants.java.in
@@ -329,11 +329,18 @@ public class AppConstants {
public static final boolean MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE =
//#ifdef MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE
true;
//#else
false;
//#endif
+ public static final boolean MOZ_ANDROID_CUSTOM_TABS =
+//#ifdef MOZ_ANDROID_CUSTOM_TABS
+ true;
+//#else
+ false;
+//#endif
+
// (bug 1266820) Temporarily disabled since no one is working on it.
public static final boolean SCREENSHOTS_IN_BOOKMARKS_ENABLED = false;
}
--- a/mobile/android/base/java/org/mozilla/gecko/LauncherActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/LauncherActivity.java
@@ -20,17 +20,17 @@ import org.mozilla.gecko.tabqueue.TabQue
*/
public class LauncherActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeckoAppShell.ensureCrashHandling();
- if (isCustomTabsIntent()) {
+ if (AppConstants.MOZ_ANDROID_CUSTOM_TABS && isCustomTabsIntent()) {
dispatchCustomTabsIntent();
} else if (isViewIntentWithURL()) {
dispatchViewIntent();
} else {
dispatchNormalIntent();
}
finish();
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -955,17 +955,17 @@ if CONFIG['MOZ_ANDROID_DISTRIBUTION_DIRE
# We do not expose MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN here because that
# would leak the value to build logs. Instead we expose the token quietly where
# appropriate in Makefile.in.
for var in ('MOZ_ANDROID_ANR_REPORTER', 'MOZ_LINKER_EXTRACT', 'MOZ_DEBUG',
'MOZ_ANDROID_SEARCH_ACTIVITY', 'MOZ_NATIVE_DEVICES', 'MOZ_ANDROID_MLS_STUMBLER',
'MOZ_ANDROID_DOWNLOADS_INTEGRATION', 'MOZ_INSTALL_TRACKING',
'MOZ_ANDROID_GCM', 'MOZ_ANDROID_EXCLUDE_FONTS', 'MOZ_LOCALE_SWITCHER',
'MOZ_ANDROID_BEAM', 'MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE',
- 'MOZ_SWITCHBOARD'):
+ 'MOZ_SWITCHBOARD', 'MOZ_ANDROID_CUSTOM_TABS'):
if CONFIG[var]:
DEFINES[var] = 1
for var in ('MOZ_UPDATER', 'MOZ_PKG_SPECIAL', 'MOZ_ANDROID_GCM_SENDERID'):
if CONFIG[var]:
DEFINES[var] = CONFIG[var]
for var in ('ANDROID_PACKAGE_NAME', 'ANDROID_CPU_ARCH',
--- a/mobile/android/moz.configure
+++ b/mobile/android/moz.configure
@@ -32,16 +32,20 @@ project_flag('MOZ_ANDROID_SEARCH_ACTIVIT
project_flag('MOZ_ANDROID_MLS_STUMBLER',
help='Include Mozilla Location Service Stumbler on Android',
default=True)
project_flag('MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE',
help='Background service for downloading additional content at runtime',
default=True)
+project_flag('MOZ_ANDROID_CUSTOM_TABS',
+ help='Enable support for Android custom tabs',
+ default=False)
+
# Enable the Switchboard A/B framework code.
# Note: The framework is always included in the app. This flag controls
# usage of the framework.
project_flag('MOZ_SWITCHBOARD',
help='Include Switchboard A/B framework on Android',
default=True)
option('--disable-android-apz', env='MOZ_ANDROID_APZ',