Bug 713377 - Part 1 - Add a --disable-websms-backend build option. r=blassey

This commit is contained in:
Mounir Lamouri 2012-01-16 19:53:09 +01:00
parent ed91b81cf2
commit 9555671834
5 changed files with 23 additions and 0 deletions

View File

@ -146,6 +146,7 @@ MOZ_DISABLE_PARENTAL_CONTROLS = @MOZ_DISABLE_PARENTAL_CONTROLS@
NS_ENABLE_TSF = @NS_ENABLE_TSF@
MOZ_SPELLCHECK = @MOZ_SPELLCHECK@
MOZ_ANDROID_HISTORY = @MOZ_ANDROID_HISTORY@
MOZ_WEBSMS_BACKEND = @MOZ_WEBSMS_BACKEND@
MOZ_JAVA_COMPOSITOR = @MOZ_JAVA_COMPOSITOR@
MOZ_PROFILELOCKING = @MOZ_PROFILELOCKING@
MOZ_FEEDS = @MOZ_FEEDS@

View File

@ -4629,6 +4629,7 @@ USE_ARM_KUSER=
BUILD_CTYPES=1
MOZ_USE_NATIVE_POPUP_WINDOWS=
MOZ_ANDROID_HISTORY=
MOZ_WEBSMS_BACKEND=1
MOZ_GRAPHITE=1
case "${target}" in
@ -5465,6 +5466,18 @@ if test -n "$MOZ_ANDROID_HISTORY"; then
AC_DEFINE(MOZ_ANDROID_HISTORY)
fi
dnl ========================================================
dnl = Disable WebSMS backend
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(websms-backend,
[ --disable-websms-backend
Disable WebSMS backend],
MOZ_WEBSMS_BACKEND=,
MOZ_WEBSMS_BACKEND=1)
if test $MOZ_WEBSMS_BACKEND -eq 1; then
AC_DEFINE(MOZ_WEBSMS_BACKEND)
fi
dnl ========================================================
dnl = Build Personal Security Manager
@ -8445,6 +8458,7 @@ AC_SUBST(MOZ_D3DX9_DLL)
AC_SUBST(MOZ_D3DCOMPILER_DLL)
AC_SUBST(MOZ_ANDROID_HISTORY)
AC_SUBST(MOZ_WEBSMS_BACKEND)
AC_SUBST(ENABLE_STRIP)
AC_SUBST(PKG_SKIP_STRIP)
AC_SUBST(USE_ELF_DYNSTR_GC)

View File

@ -994,6 +994,7 @@ Navigator::IsSmsAllowed() const
bool
Navigator::IsSmsSupported() const
{
#ifdef MOZ_WEBSMS_BACKEND
nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(smsService, false);
@ -1001,6 +1002,9 @@ Navigator::IsSmsSupported() const
smsService->HasSupport(&result);
return result;
#else
return false;
#endif
}
NS_IMETHODIMP

View File

@ -21,11 +21,13 @@
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
#ifdef MOZ_WEBSMS_BACKEND
<!-- WebSMS -->
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.WRITE_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
#endif
<uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>

View File

@ -24,11 +24,13 @@
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
#ifdef MOZ_WEBSMS_BACKEND
<!-- WebSMS -->
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.WRITE_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
#endif
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>