From 0a55f3a3652dde2399cfcd62a41a6b49fa324960 Mon Sep 17 00:00:00 2001 From: Danesh Mondegarian Date: Sun, 5 May 2013 16:29:39 -0400 Subject: ProfilesSettings : Allow nfc override (2/2) Allow user to override nfc state via profiles Change-Id: I2a401f17ce42b1711588242e0604997e1f5d8399 --- res/values/cm_strings.xml | 1 + src/com/android/settings/profiles/ProfileConfig.java | 15 ++++++++++++--- 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 @@ Flashlight Lock Screen WiMAX + NFC Screen security 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(); - 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); -- cgit v1.1