summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values/strings.xml5
-rw-r--r--res/xml/wireless_settings.xml10
-rw-r--r--src/com/android/settings/WirelessSettings.java21
3 files changed, 36 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 41d562f..744a814 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -4099,4 +4099,9 @@
<string name="help_url_backup_reset" translatable="false"></string>
<!-- Help URL, Tethering [DO NOT TRANSLATE] -->
<string name="help_url_tether" translatable="false"></string>
+
+ <!-- Cell Broadcast settings title [CHAR LIMIT=50] -->
+ <string name="cell_broadcast_settings">Cell broadcasts</string>
+ <!-- Cell Broadcast settings description [CHAR LIMIT=100] -->
+ <string name="cell_broadcast_settings_summary">Select the types of emergency alerts to display.</string>
</resources>
diff --git a/res/xml/wireless_settings.xml b/res/xml/wireless_settings.xml
index 866a617..3cd72b3 100644
--- a/res/xml/wireless_settings.xml
+++ b/res/xml/wireless_settings.xml
@@ -75,4 +75,14 @@
android:key="proxy_settings"
android:title="@string/proxy_settings_title" />
+ <PreferenceScreen
+ android:key="cell_broadcast_settings"
+ android:title="@string/cell_broadcast_settings"
+ android:summary="@string/cell_broadcast_settings_summary" >
+ <intent
+ android:action="android.intent.action.MAIN"
+ android:targetPackage="com.android.cellbroadcastreceiver"
+ android:targetClass="com.android.cellbroadcastreceiver.CellBroadcastSettings" />
+ </PreferenceScreen>
+
</PreferenceScreen>
diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java
index 3b67ec3..347315a 100644
--- a/src/com/android/settings/WirelessSettings.java
+++ b/src/com/android/settings/WirelessSettings.java
@@ -50,6 +50,7 @@ public class WirelessSettings extends SettingsPreferenceFragment {
private static final String KEY_PROXY_SETTINGS = "proxy_settings";
private static final String KEY_MOBILE_NETWORK_SETTINGS = "mobile_network_settings";
private static final String KEY_TOGGLE_NSD = "toggle_nsd"; //network service discovery
+ private static final String KEY_CELL_BROADCAST_SETTINGS = "cell_broadcast_settings";
public static final String EXIT_ECM_RESULT = "exit_ecm_result";
public static final int REQUEST_CODE_EXIT_ECM = 1;
@@ -171,6 +172,26 @@ public class WirelessSettings extends SettingsPreferenceFragment {
Preference p = findPreference(KEY_TETHER_SETTINGS);
p.setTitle(Utils.getTetheringLabel(cm));
}
+
+ // Enable link to CMAS app settings depending on the value in config.xml.
+ boolean isCellBroadcastAppLinkEnabled = this.getResources().getBoolean(
+ com.android.internal.R.bool.config_cellBroadcastAppLinks);
+ try {
+ if (isCellBroadcastAppLinkEnabled) {
+ PackageManager pm = getPackageManager();
+ if (pm.getApplicationEnabledSetting("com.android.cellbroadcastreceiver")
+ == PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
+ isCellBroadcastAppLinkEnabled = false; // CMAS app disabled
+ }
+ }
+ } catch (IllegalArgumentException ignored) {
+ isCellBroadcastAppLinkEnabled = false; // CMAS app not installed
+ }
+ if (!isCellBroadcastAppLinkEnabled) {
+ PreferenceScreen root = getPreferenceScreen();
+ Preference ps = findPreference(KEY_CELL_BROADCAST_SETTINGS);
+ if (ps != null) root.removePreference(ps);
+ }
}
@Override