Bug 847898 - Put Android Beam support behind a confvar variable. r=mfinkle

This commit is contained in:
Kartikaya Gupta 2013-04-17 16:08:11 -04:00
parent aaffe058c2
commit ffc10a4dea
5 changed files with 26 additions and 3 deletions

View File

@ -4263,6 +4263,7 @@ MOZ_USE_NATIVE_POPUP_WINDOWS=
MOZ_ANDROID_HISTORY=
MOZ_WEBSMS_BACKEND=
MOZ_ANDROID_WALLPAPER=
MOZ_ANDROID_BEAM=
ACCESSIBILITY=1
MOZ_SYS_MSG=
MOZ_TIME_MANAGER=
@ -5146,6 +5147,13 @@ if test -n "$MOZ_ANDROID_WALLPAPER"; then
AC_DEFINE(MOZ_ANDROID_WALLPAPER)
fi
dnl ========================================================
dnl = Enable NFC permission on Android
dnl ========================================================
if test -n "$MOZ_ANDROID_BEAM"; then
AC_DEFINE(MOZ_ANDROID_BEAM)
fi
dnl ========================================================
dnl = Build Personal Security Manager
dnl ========================================================
@ -8594,6 +8602,7 @@ AC_SUBST(MOZ_METRO)
AC_SUBST(MOZ_ANDROID_HISTORY)
AC_SUBST(MOZ_WEBSMS_BACKEND)
AC_SUBST(MOZ_ANDROID_WALLPAPER)
AC_SUBST(MOZ_ANDROID_BEAM)
AC_SUBST(ENABLE_STRIP)
AC_SUBST(PKG_SKIP_STRIP)
AC_SUBST(STRIP_FLAGS)

View File

@ -44,9 +44,11 @@
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen"/>
#ifdef MOZ_ANDROID_BEAM
<!-- Android Beam support -->
<uses-permission android:name="android.permission.NFC"/>
<uses-feature android:name="android.hardware.nfc"/>
#endif
#ifdef MOZ_WEBRTC
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
@ -125,12 +127,14 @@
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
#ifdef MOZ_ANDROID_BEAM
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
#endif
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable" />

View File

@ -86,4 +86,11 @@ public class AppConstants {
#else
false;
#endif
public static final boolean MOZ_ANDROID_BEAM =
#ifdef MOZ_ANDROID_BEAM
true;
#else
false;
#endif
}

View File

@ -536,7 +536,7 @@ abstract public class BrowserApp extends GeckoApp
Distribution.init(this, getPackageResourcePath());
JavaAddonManager.getInstance().init(getApplicationContext());
if (Build.VERSION.SDK_INT >= 14) {
if (AppConstants.MOZ_ANDROID_BEAM && Build.VERSION.SDK_INT >= 14) {
NfcAdapter nfc = NfcAdapter.getDefaultAdapter(this);
if (nfc != null) {
nfc.setNdefPushMessageCallback(new NfcAdapter.CreateNdefMessageCallback() {
@ -632,7 +632,7 @@ abstract public class BrowserApp extends GeckoApp
unregisterEventListener("Feedback:MaybeLater");
unregisterEventListener("Telemetry:Gather");
if (Build.VERSION.SDK_INT >= 14) {
if (AppConstants.MOZ_ANDROID_BEAM && Build.VERSION.SDK_INT >= 14) {
NfcAdapter nfc = NfcAdapter.getDefaultAdapter(this);
if (nfc != null) {
// null this out even though the docs say it's not needed,
@ -1664,7 +1664,7 @@ abstract public class BrowserApp extends GeckoApp
String action = intent.getAction();
if (Build.VERSION.SDK_INT >= 10 && NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
if (AppConstants.MOZ_ANDROID_BEAM && Build.VERSION.SDK_INT >= 10 && NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
String uri = intent.getDataString();
GeckoAppShell.sendEventToGecko(GeckoEvent.createURILoadEvent(uri));
}

View File

@ -22,6 +22,9 @@ MOZ_MEDIA_NAVIGATOR=1
# Enable SET_WALLPAPER permission
MOZ_ANDROID_WALLPAPER=1
# Enable NFC permission
MOZ_ANDROID_BEAM=1
if test "$LIBXUL_SDK"; then
MOZ_XULRUNNER=1
else