summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh Mondegarian <daneshm90@gmail.com>2013-05-05 16:29:39 -0400
committerDanesh Mondegarian <daneshm90@gmail.com>2013-05-20 12:32:35 -0400
commit0a55f3a3652dde2399cfcd62a41a6b49fa324960 (patch)
tree7191603c9c276b2b820d44df4188ad66f5930827
parent701558adb7392b96d2b28eea1f94410c90bfe85f (diff)
downloadpackages_apps_settings-0a55f3a3652dde2399cfcd62a41a6b49fa324960.zip
packages_apps_settings-0a55f3a3652dde2399cfcd62a41a6b49fa324960.tar.gz
packages_apps_settings-0a55f3a3652dde2399cfcd62a41a6b49fa324960.tar.bz2
ProfilesSettings : Allow nfc override (2/2)
Allow user to override nfc state via profiles Change-Id: I2a401f17ce42b1711588242e0604997e1f5d8399
-rw-r--r--res/values/cm_strings.xml1
-rw-r--r--src/com/android/settings/profiles/ProfileConfig.java15
2 files changed, 13 insertions, 3 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 3b18fb0..b38fc65 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -295,6 +295,7 @@
<string name="toggleFlashlight">Flashlight</string>
<string name="toggleLockScreen">Lock Screen</string>
<string name="toggleWimax">WiMAX</string>
+ <string name="toggleNfc">NFC</string>
<!-- Screen security - Screen security -->
<string name="screen_security_category">Screen security</string>
diff --git a/src/com/android/settings/profiles/ProfileConfig.java b/src/com/android/settings/profiles/ProfileConfig.java
index 4e6967b..fc47ff0 100644
--- a/src/com/android/settings/profiles/ProfileConfig.java
+++ b/src/com/android/settings/profiles/ProfileConfig.java
@@ -16,6 +16,8 @@
package com.android.settings.profiles;
+import static com.android.internal.util.cm.QSUtils.*;
+
import java.util.ArrayList;
import java.util.UUID;
@@ -91,15 +93,22 @@ public class ProfileConfig extends SettingsPreferenceFragment
};
mConnections = new ArrayList<ConnectionItem>();
- mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_MOBILEDATA, getString(R.string.toggleData)));
- mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_BLUETOOTH, getString(R.string.toggleBluetooth)));
+ if (deviceSupportsBluetooth()) {
+ mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_BLUETOOTH, getString(R.string.toggleBluetooth)));
+ }
mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_GPS, getString(R.string.toggleGPS)));
mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_WIFI, getString(R.string.toggleWifi)));
mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_SYNC, getString(R.string.toggleSync)));
- mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_WIFIAP, getString(R.string.toggleWifiAp)));
+ if (deviceSupportsMobileData(getActivity())) {
+ mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_MOBILEDATA, getString(R.string.toggleData)));
+ mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_WIFIAP, getString(R.string.toggleWifiAp)));
+ }
if (WimaxHelper.isWimaxSupported(getActivity())) {
mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_WIMAX, getString(R.string.toggleWimax)));
}
+ if (deviceSupportsNfc(getActivity())) {
+ mConnections.add(new ConnectionItem(ConnectionSettings.PROFILE_CONNECTION_NFC, getString(R.string.toggleNfc)));
+ }
addPreferencesFromResource(R.xml.profile_config);