summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/Settings.java
diff options
context:
space:
mode:
authorDvTonder <david.vantonder@gmail.com>2012-12-02 20:35:24 -0500
committerDvTonder <david.vantonder@gmail.com>2012-12-02 20:35:24 -0500
commitc742ecd8daa7c57d017902a05548788f142591e5 (patch)
tree0ddc2278527a3164a6a6dfddb0cc5bce913dd5b7 /src/com/android/settings/Settings.java
parent747975bc9a1119fb547c46833b265ab5697c79e5 (diff)
downloadpackages_apps_Settings-c742ecd8daa7c57d017902a05548788f142591e5.tar.gz
packages_apps_Settings-c742ecd8daa7c57d017902a05548788f142591e5.tar.bz2
packages_apps_Settings-c742ecd8daa7c57d017902a05548788f142591e5.zip
Settings: Forward port missing Profiles related changes
Change-Id: I3cda345208171c5b45daf2d5d263017bc538bd48
Diffstat (limited to 'src/com/android/settings/Settings.java')
-rw-r--r--src/com/android/settings/Settings.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 75943e012..dc638310e 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -26,6 +26,7 @@ import com.android.settings.applications.ManageApplications;
import com.android.settings.bluetooth.BluetoothEnabler;
import com.android.settings.deviceinfo.Memory;
import com.android.settings.fuelgauge.PowerUsageSummary;
+import com.android.settings.profiles.ProfileEnabler;
import com.android.settings.vpn2.VpnSettings;
import com.android.settings.wifi.WifiEnabler;
@@ -601,6 +602,8 @@ public class Settings extends PreferenceActivity
private final WifiEnabler mWifiEnabler;
private final BluetoothEnabler mBluetoothEnabler;
+ private final ProfileEnabler mProfileEnabler;
+
private AuthenticatorHelper mAuthHelper;
private static class HeaderViewHolder {
@@ -615,7 +618,9 @@ public class Settings extends PreferenceActivity
static int getHeaderType(Header header) {
if (header.fragment == null && header.intent == null) {
return HEADER_TYPE_CATEGORY;
- } else if (header.id == R.id.wifi_settings || header.id == R.id.bluetooth_settings) {
+ } else if (header.id == R.id.wifi_settings
+ || header.id == R.id.bluetooth_settings
+ || header.id == R.id.profiles_settings) {
return HEADER_TYPE_SWITCH;
} else {
return HEADER_TYPE_NORMAL;
@@ -659,6 +664,7 @@ public class Settings extends PreferenceActivity
// Switches inflated from their layouts. Must be done before adapter is set in super
mWifiEnabler = new WifiEnabler(context, new Switch(context));
mBluetoothEnabler = new BluetoothEnabler(context, new Switch(context));
+ mProfileEnabler = new ProfileEnabler(context, null, new Switch(context));
}
@Override
@@ -715,8 +721,10 @@ public class Settings extends PreferenceActivity
// Would need a different treatment if the main menu had more switches
if (header.id == R.id.wifi_settings) {
mWifiEnabler.setSwitch(holder.switch_);
- } else {
+ } else if (header.id == R.id.bluetooth_settings) {
mBluetoothEnabler.setSwitch(holder.switch_);
+ } else if (header.id == R.id.profiles_settings) {
+ mProfileEnabler.setSwitch(holder.switch_);
}
// No break, fall through on purpose to update common fields
@@ -753,11 +761,13 @@ public class Settings extends PreferenceActivity
public void resume() {
mWifiEnabler.resume();
mBluetoothEnabler.resume();
+ mProfileEnabler.resume();
}
public void pause() {
mWifiEnabler.pause();
mBluetoothEnabler.pause();
+ mProfileEnabler.pause();
}
}