summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hamby <jhamby@google.com>2012-06-25 16:19:23 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-06-25 16:19:23 -0700
commitf59dd9d67e269a81c684ecd641e514aba8d2330a (patch)
tree3069afbdb1db9a58360b319635ffe26abe35c920
parent40b78280eb0c93d9ee3918813cfabf93a2919f35 (diff)
parentef57ed71bf390858cb83253bd193a192bb48346c (diff)
downloadpackages_apps_settings-f59dd9d67e269a81c684ecd641e514aba8d2330a.zip
packages_apps_settings-f59dd9d67e269a81c684ecd641e514aba8d2330a.tar.gz
packages_apps_settings-f59dd9d67e269a81c684ecd641e514aba8d2330a.tar.bz2
Merge "Add menu item to Settings to go to Cell Broadcast settings." into jb-dev
-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