summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJake Hamby <jhamby@google.com>2012-06-21 10:59:22 -0700
committerJake Hamby <jhamby@google.com>2012-06-25 13:20:45 -0700
commitef57ed71bf390858cb83253bd193a192bb48346c (patch)
tree4de1c737775acfb3cf8e4021966e414e6af5d44c /src
parentd7e8025fdf91fd0a6dad9df6bc92e7cb9d7566c2 (diff)
downloadpackages_apps_settings-ef57ed71bf390858cb83253bd193a192bb48346c.zip
packages_apps_settings-ef57ed71bf390858cb83253bd193a192bb48346c.tar.gz
packages_apps_settings-ef57ed71bf390858cb83253bd193a192bb48346c.tar.bz2
Add menu item to Settings to go to Cell Broadcast settings.
Add menu item to Settings when "config_cellBroadcastAppLinks" config option is set to true to jump to the Cell Broadcast app settings activity. This enables the Cell Broadcast launcher icon to be removed, while still allowing access to the app (by adding a similar menu item to the MMS app) and its settings activity (this settings link). The menu item will not be added if the CellBroadcastReceiver package is disabled or not installed. Bug: 6709985 Change-Id: If3a3016ceea70704790964c0b712c31cb38f7b62
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/WirelessSettings.java21
1 files changed, 21 insertions, 0 deletions
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