summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout/fragment_setup_actions.xml7
-rw-r--r--src/com/android/settings/DisplaySettings.java4
-rw-r--r--src/com/android/settings/cyanogenmod/SystemSettingSwitchPreference.java8
-rw-r--r--src/com/android/settings/notificationlight/BatteryLightSettings.java6
-rw-r--r--src/com/android/settings/notificationlight/NotificationLightSettings.java6
-rw-r--r--src/com/android/settings/profiles/AppGroupConfig.java5
-rw-r--r--src/com/android/settings/profiles/AppGroupList.java14
-rw-r--r--src/com/android/settings/profiles/NFCProfile.java6
-rw-r--r--src/com/android/settings/profiles/ProfileEnabler.java22
-rw-r--r--src/com/android/settings/profiles/ProfileGroupConfig.java5
-rw-r--r--src/com/android/settings/profiles/ProfilesList.java12
-rw-r--r--src/com/android/settings/profiles/ProfilesSettings.java15
-rw-r--r--src/com/android/settings/profiles/ProfilesUtils.java4
-rw-r--r--src/com/android/settings/profiles/SetupActionsFragment.java73
-rw-r--r--src/com/android/settings/profiles/SetupDefaultProfileReceiver.java6
-rw-r--r--src/com/android/settings/profiles/SetupTriggersFragment.java6
-rw-r--r--src/com/android/settings/profiles/actions/item/LockModeItem.java2
-rw-r--r--src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java2
-rw-r--r--src/com/android/settings/profiles/triggers/WifiTriggerFragment.java4
19 files changed, 128 insertions, 79 deletions
diff --git a/res/layout/fragment_setup_actions.xml b/res/layout/fragment_setup_actions.xml
index 08a8a41..9f0c99e 100644
--- a/res/layout/fragment_setup_actions.xml
+++ b/res/layout/fragment_setup_actions.xml
@@ -26,17 +26,18 @@
android:layout_height="0dp"/>
+ <View style="@style/settingSeparator" />
+
<LinearLayout
android:id="@+id/bottom_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
style="?android:buttonBarStyle">
- <View style="@style/settingSeparator" />
<Button
android:id="@+id/back"
- android:layout_width="wrap_content"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/wizard_back"
@@ -45,7 +46,7 @@
<Button
android:id="@+id/finish"
- android:layout_width="wrap_content"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/wizard_finish"
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index 14e4b9c..0e2c77c 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -217,10 +217,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
return res.getBoolean(com.android.internal.R.bool.config_automatic_brightness_available);
}
- private static boolean isAutomaticBrightnessAvailable(Resources res) {
- return res.getBoolean(com.android.internal.R.bool.config_automatic_brightness_available);
- }
-
private void updateTimeoutPreferenceDescription(long currentTimeout) {
ListPreference preference = mScreenTimeoutPreference;
String summary;
diff --git a/src/com/android/settings/cyanogenmod/SystemSettingSwitchPreference.java b/src/com/android/settings/cyanogenmod/SystemSettingSwitchPreference.java
index a936149..c5da190 100644
--- a/src/com/android/settings/cyanogenmod/SystemSettingSwitchPreference.java
+++ b/src/com/android/settings/cyanogenmod/SystemSettingSwitchPreference.java
@@ -18,7 +18,7 @@ package com.android.settings.cyanogenmod;
import android.content.Context;
import android.preference.SwitchPreference;
-import android.provider.Settings;
+import cyanogenmod.providers.CMSettings;
import android.util.AttributeSet;
public class SystemSettingSwitchPreference extends SwitchPreference {
@@ -41,7 +41,7 @@ public class SystemSettingSwitchPreference extends SwitchPreference {
// It's already there, so the same as persisting
return true;
}
- Settings.System.putInt(getContext().getContentResolver(), getKey(), value ? 1 : 0);
+ CMSettings.System.putInt(getContext().getContentResolver(), getKey(), value ? 1 : 0);
return true;
}
return false;
@@ -52,7 +52,7 @@ public class SystemSettingSwitchPreference extends SwitchPreference {
if (!shouldPersist()) {
return defaultReturnValue;
}
- return Settings.System.getInt(getContext().getContentResolver(),
+ return CMSettings.System.getInt(getContext().getContentResolver(),
getKey(), defaultReturnValue ? 1 : 0) != 0;
}
@@ -60,6 +60,6 @@ public class SystemSettingSwitchPreference extends SwitchPreference {
protected boolean isPersisted() {
// Using getString instead of getInt so we can simply check for null
// instead of catching an exception. (All values are stored as strings.)
- return Settings.System.getString(getContext().getContentResolver(), getKey()) != null;
+ return CMSettings.System.getString(getContext().getContentResolver(), getKey()) != null;
}
}
diff --git a/src/com/android/settings/notificationlight/BatteryLightSettings.java b/src/com/android/settings/notificationlight/BatteryLightSettings.java
index 12f3d77..5dd68d8 100644
--- a/src/com/android/settings/notificationlight/BatteryLightSettings.java
+++ b/src/com/android/settings/notificationlight/BatteryLightSettings.java
@@ -27,6 +27,7 @@ import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
+import com.android.internal.logging.MetricsLogger;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -45,6 +46,11 @@ public class BatteryLightSettings extends SettingsPreferenceFragment implements
private static final int MENU_RESET = Menu.FIRST;
@Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DONT_TRACK_ME_BRO;
+ }
+
+ @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.battery_light_settings);
diff --git a/src/com/android/settings/notificationlight/NotificationLightSettings.java b/src/com/android/settings/notificationlight/NotificationLightSettings.java
index fddfa32..8bd9b87 100644
--- a/src/com/android/settings/notificationlight/NotificationLightSettings.java
+++ b/src/com/android/settings/notificationlight/NotificationLightSettings.java
@@ -41,6 +41,7 @@ import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
+import com.android.internal.logging.MetricsLogger;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.cyanogenmod.PackageListAdapter;
@@ -156,6 +157,11 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem
}
@Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DONT_TRACK_ME_BRO;
+ }
+
+ @Override
public void onResume() {
super.onResume();
refreshDefault();
diff --git a/src/com/android/settings/profiles/AppGroupConfig.java b/src/com/android/settings/profiles/AppGroupConfig.java
index fb5af22..a34f180 100644
--- a/src/com/android/settings/profiles/AppGroupConfig.java
+++ b/src/com/android/settings/profiles/AppGroupConfig.java
@@ -193,6 +193,11 @@ public class AppGroupConfig extends SettingsPreferenceFragment
}
@Override
+ protected int getMetricsCategory() {
+ return 0;
+ }
+
+ @Override
public void onPause() {
if (mNotificationGroup != null) {
mProfileManager.addNotificationGroup(mNotificationGroup);
diff --git a/src/com/android/settings/profiles/AppGroupList.java b/src/com/android/settings/profiles/AppGroupList.java
index 2dfb654..968d88c 100644
--- a/src/com/android/settings/profiles/AppGroupList.java
+++ b/src/com/android/settings/profiles/AppGroupList.java
@@ -21,6 +21,7 @@ import java.util.UUID;
import android.annotation.Nullable;
import android.app.AlertDialog;
import android.app.NotificationGroup;
+import com.android.internal.logging.MetricsLogger;
import cyanogenmod.app.ProfileManager;
import android.content.Context;
import android.content.DialogInterface;
@@ -34,7 +35,7 @@ import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
-import com.android.internal.util.cm.ScreenType;
+//import com.android.internal.util.cm.ScreenType;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -58,14 +59,19 @@ public class AppGroupList extends SettingsPreferenceFragment {
}
@Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DONT_TRACK_ME_BRO;
+ }
+
+ @Override
public void onResume() {
super.onResume();
refreshList();
// On tablet devices remove the padding
- if (ScreenType.isTablet(getActivity())) {
- getListView().setPadding(0, 0, 0, 0);
- }
+ //if (ScreenType.isTablet(getActivity())) {
+ // getListView().setPadding(0, 0, 0, 0);
+ //}
}
@Override
diff --git a/src/com/android/settings/profiles/NFCProfile.java b/src/com/android/settings/profiles/NFCProfile.java
index b4bfe8c..74aec53 100644
--- a/src/com/android/settings/profiles/NFCProfile.java
+++ b/src/com/android/settings/profiles/NFCProfile.java
@@ -27,11 +27,11 @@ import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.os.Parcelable;
-import android.provider.Settings;
import android.widget.Toast;
import cyanogenmod.app.Profile;
import cyanogenmod.app.ProfileManager;
+import cyanogenmod.providers.CMSettings;
import com.android.settings.R;
@@ -86,8 +86,8 @@ public class NFCProfile extends Activity {
private void handleProfileMimeType(byte[] payload) {
UUID profileUuid = NFCProfileUtils.toUUID(payload);
- boolean enabled = Settings.System.getInt(getContentResolver(),
- Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1;
+ boolean enabled = CMSettings.System.getInt(getContentResolver(),
+ CMSettings.System.SYSTEM_PROFILES_ENABLED, 1) == 1;
if (enabled) {
// Only do NFC profile changing if System Profile support is enabled
diff --git a/src/com/android/settings/profiles/ProfileEnabler.java b/src/com/android/settings/profiles/ProfileEnabler.java
index 487adc9..8bf450c 100644
--- a/src/com/android/settings/profiles/ProfileEnabler.java
+++ b/src/com/android/settings/profiles/ProfileEnabler.java
@@ -16,7 +16,7 @@
package com.android.settings.profiles;
-import android.app.ProfileManager;
+import cyanogenmod.app.ProfileManager;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
@@ -30,7 +30,6 @@ import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Handler;
import android.os.Message;
-import android.provider.Settings;
import android.widget.Switch;
import android.widget.Toast;
import com.android.settings.R;
@@ -39,6 +38,8 @@ import com.android.settings.search.Index;
import com.android.settings.widget.SwitchBar;
import com.android.settings.wifi.WifiSettings;
+import cyanogenmod.providers.CMSettings;
+
import java.util.concurrent.atomic.AtomicBoolean;
public class ProfileEnabler implements SwitchBar.OnSwitchChangeListener {
@@ -99,8 +100,8 @@ public class ProfileEnabler implements SwitchBar.OnSwitchChangeListener {
}
private void setSwitchState() {
- boolean enabled = Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1;
+ boolean enabled = CMSettings.System.getInt(mContext.getContentResolver(),
+ CMSettings.System.SYSTEM_PROFILES_ENABLED, 1) == 1;
mStateMachineEvent = true;
setSwitchBarChecked(enabled);
mStateMachineEvent = false;
@@ -114,8 +115,8 @@ public class ProfileEnabler implements SwitchBar.OnSwitchChangeListener {
}
// Handle a switch change
- Settings.System.putInt(mContext.getContentResolver(),
- Settings.System.SYSTEM_PROFILES_ENABLED, isChecked ? 1 : 0);
+ CMSettings.System.putInt(mContext.getContentResolver(),
+ CMSettings.System.SYSTEM_PROFILES_ENABLED, isChecked ? 1 : 0);
// Send a broadcast intent to the world
// TODO Enabling or disabling profiles should be at ProfileManager, not here
@@ -135,8 +136,8 @@ public class ProfileEnabler implements SwitchBar.OnSwitchChangeListener {
void observe() {
ContentResolver resolver = mContext.getContentResolver();
- resolver.registerContentObserver(Settings.System.getUriFor(
- Settings.System.SYSTEM_PROFILES_ENABLED), false, this);
+ resolver.registerContentObserver(CMSettings.System.getUriFor(
+ CMSettings.System.SYSTEM_PROFILES_ENABLED), false, this);
update();
}
@@ -150,11 +151,6 @@ public class ProfileEnabler implements SwitchBar.OnSwitchChangeListener {
update();
}
- @Override
- public void onChange(boolean selfChange, Uri uri) {
- update();
- }
-
public void update() {
setSwitchState();
}
diff --git a/src/com/android/settings/profiles/ProfileGroupConfig.java b/src/com/android/settings/profiles/ProfileGroupConfig.java
index 8edd3d6..9219967 100644
--- a/src/com/android/settings/profiles/ProfileGroupConfig.java
+++ b/src/com/android/settings/profiles/ProfileGroupConfig.java
@@ -53,6 +53,11 @@ public class ProfileGroupConfig extends SettingsPreferenceFragment implements
ProfileGroup mProfileGroup;
+ @Override
+ protected int getMetricsCategory() {
+ return 0;
+ }
+
private ListPreference mSoundMode;
private ListPreference mRingerMode;
diff --git a/src/com/android/settings/profiles/ProfilesList.java b/src/com/android/settings/profiles/ProfilesList.java
index 9b07b7d..7cc2048 100644
--- a/src/com/android/settings/profiles/ProfilesList.java
+++ b/src/com/android/settings/profiles/ProfilesList.java
@@ -18,8 +18,9 @@ package com.android.settings.profiles;
import java.util.UUID;
-import android.app.Profile;
-import android.app.ProfileManager;
+import com.android.internal.logging.MetricsLogger;
+import cyanogenmod.app.Profile;
+import cyanogenmod.app.ProfileManager;
import android.content.Context;
import android.os.Bundle;
import android.preference.Preference;
@@ -44,7 +45,12 @@ public class ProfilesList extends SettingsPreferenceFragment implements
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.profiles_settings);
- mProfileManager = (ProfileManager) getActivity().getSystemService(Context.PROFILE_SERVICE);
+ mProfileManager = ProfileManager.getInstance(getActivity());
+ }
+
+ @Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DONT_TRACK_ME_BRO;
}
@Override
diff --git a/src/com/android/settings/profiles/ProfilesSettings.java b/src/com/android/settings/profiles/ProfilesSettings.java
index 846dd1f..811c207 100644
--- a/src/com/android/settings/profiles/ProfilesSettings.java
+++ b/src/com/android/settings/profiles/ProfilesSettings.java
@@ -19,6 +19,8 @@ package com.android.settings.profiles;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
+import android.app.Fragment;
+import android.app.FragmentManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
@@ -41,6 +43,7 @@ import android.widget.ImageView;
import android.widget.Switch;
import android.widget.TextView;
+import com.android.internal.logging.MetricsLogger;
import cyanogenmod.app.Profile;
import cyanogenmod.app.ProfileManager;
@@ -49,6 +52,7 @@ import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
+import cyanogenmod.providers.CMSettings;
import java.util.UUID;
@@ -125,6 +129,11 @@ public class ProfilesSettings extends SettingsPreferenceFragment {
}
@Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DONT_TRACK_ME_BRO;
+ }
+
+ @Override
public void onResume() {
super.onResume();
if (mProfileEnabler != null) {
@@ -205,7 +214,7 @@ public class ProfilesSettings extends SettingsPreferenceFragment {
.setTitle(R.string.profile_reset_title)
.setIconAttribute(android.R.attr.alertDialogIcon)
.setMessage(R.string.profile_reset_message)
- .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
mProfileManager.resetAll();
@@ -219,8 +228,8 @@ public class ProfilesSettings extends SettingsPreferenceFragment {
private void updateProfilesEnabledState() {
Activity activity = getActivity();
- mEnabled = Settings.System.getInt(activity.getContentResolver(),
- Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1;
+ mEnabled = CMSettings.System.getInt(activity.getContentResolver(),
+ CMSettings.System.SYSTEM_PROFILES_ENABLED, 1) == 1;
activity.invalidateOptionsMenu();
mAddProfileFab.setVisibility(mEnabled ? View.VISIBLE : View.GONE);
diff --git a/src/com/android/settings/profiles/ProfilesUtils.java b/src/com/android/settings/profiles/ProfilesUtils.java
index 4f59dd9..03e9d33 100644
--- a/src/com/android/settings/profiles/ProfilesUtils.java
+++ b/src/com/android/settings/profiles/ProfilesUtils.java
@@ -18,6 +18,8 @@ import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
+import cyanogenmod.providers.CMSettings;
+
import com.android.internal.telephony.PhoneConstants;
public class ProfilesUtils {
@@ -41,7 +43,7 @@ public class ProfilesUtils {
}
public static boolean systemProfilesEnabled(ContentResolver resolver) {
- return (Settings.System.getInt(resolver, Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1);
+ return (CMSettings.System.getInt(resolver, CMSettings.System.SYSTEM_PROFILES_ENABLED, 1) == 1);
}
public static boolean deviceSupportsNfc(Context ctx) {
diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java
index 7285c94..bc7cad1 100644
--- a/src/com/android/settings/profiles/SetupActionsFragment.java
+++ b/src/com/android/settings/profiles/SetupActionsFragment.java
@@ -16,12 +16,14 @@
package com.android.settings.profiles;
import android.app.Activity;
+import com.android.internal.logging.MetricsLogger;
import cyanogenmod.profiles.AirplaneModeSettings;
import android.app.AlertDialog;
import cyanogenmod.profiles.BrightnessSettings;
import cyanogenmod.profiles.ConnectionSettings;
import android.app.Dialog;
import android.app.NotificationGroup;
+import cyanogenmod.profiles.LockSettings;
import cyanogenmod.profiles.RingModeSettings;
import cyanogenmod.profiles.StreamSettings;
import android.bluetooth.BluetoothAdapter;
@@ -34,7 +36,7 @@ import android.media.AudioManager;
import android.media.RingtoneManager;
import android.net.ConnectivityManager;
import android.net.wifi.WifiManager;
-import android.net.wimax.WimaxHelper;
+//import android.net.wimax.WimaxHelper;
import android.nfc.NfcManager;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -218,9 +220,9 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
mItems.add(generateConnectionOverrideItem(PROFILE_CONNECTION_2G3G4G));
}
}
- if (WimaxHelper.isWimaxSupported(getActivity())) {
- mItems.add(generateConnectionOverrideItem(PROFILE_CONNECTION_WIMAX));
- }
+ //if (WimaxHelper.isWimaxSupported(getActivity())) {
+ // mItems.add(generateConnectionOverrideItem(PROFILE_CONNECTION_WIMAX));
+ //}
if (DeviceUtils.deviceSupportsNfc(getActivity())) {
mItems.add(generateConnectionOverrideItem(PROFILE_CONNECTION_NFC));
}
@@ -245,39 +247,37 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
}
// app groups
- if (SettingsActivity.showAdvancedPreferences(getActivity())) {
- mItems.add(new Header(getString(R.string.profile_app_group_category_title)));
-
- int groupsAdded = 0;
- ProfileGroup[] profileGroups = mProfile.getProfileGroups();
- if (profileGroups != null && profileGroups.length > 1) { // it will always have "other"
- for (ProfileGroup profileGroup : profileGroups) {
- // only display profile group if there's a matching notification group
- // and don't' show the wildcard group
- if (mProfileManager.getNotificationGroup(profileGroup.getUuid()) != null
- && !mProfile.getDefaultGroup().getUuid().equals(
- profileGroup.getUuid())) {
- mItems.add(new AppGroupItem(mProfile, profileGroup,
- mProfileManager.getNotificationGroup(
- profileGroup.getUuid())));
- groupsAdded++;
- }
- }
- if (groupsAdded > 0) {
- // add "Other" at the end
- mItems.add(new AppGroupItem(mProfile, mProfile.getDefaultGroup(),
+ mItems.add(new Header(getString(R.string.profile_app_group_category_title)));
+
+ int groupsAdded = 0;
+ ProfileGroup[] profileGroups = mProfile.getProfileGroups();
+ if (profileGroups != null && profileGroups.length > 1) { // it will always have "other"
+ for (ProfileGroup profileGroup : profileGroups) {
+ // only display profile group if there's a matching notification group
+ // and don't' show the wildcard group
+ if (mProfileManager.getNotificationGroup(profileGroup.getUuid()) != null
+ && !mProfile.getDefaultGroup().getUuid().equals(
+ profileGroup.getUuid())) {
+ mItems.add(new AppGroupItem(mProfile, profileGroup,
mProfileManager.getNotificationGroup(
- mProfile.getDefaultGroup().getUuid())));
+ profileGroup.getUuid())));
+ groupsAdded++;
}
}
if (groupsAdded > 0) {
- // add dummy "add/remove app groups" entry
- mItems.add(new AppGroupItem());
- } else {
- // remove the header since there are no options
- mItems.remove(mItems.get(mItems.size() - 1));
+ // add "Other" at the end
+ mItems.add(new AppGroupItem(mProfile, mProfile.getDefaultGroup(),
+ mProfileManager.getNotificationGroup(
+ mProfile.getDefaultGroup().getUuid())));
}
}
+ if (groupsAdded > 0) {
+ // add dummy "add/remove app groups" entry
+ mItems.add(new AppGroupItem());
+ } else {
+ // remove the header since there are no options
+ mItems.remove(mItems.get(mItems.size() - 1));
+ }
mAdapter.notifyDataSetChanged();
}
@@ -580,7 +580,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
int defaultIndex = 0; // no action
for (int i = 0; i < LOCKMODE_MAPPING.length; i++) {
- if (LOCKMODE_MAPPING[i] == mProfile.getScreenLockMode()) {
+ if (LOCKMODE_MAPPING[i] == mProfile.getScreenLockMode().getValue()) {
defaultIndex = i;
break;
}
@@ -591,7 +591,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) {
- mProfile.setScreenLockMode(LOCKMODE_MAPPING[item]);
+ mProfile.setScreenLockMode(new LockSettings(LOCKMODE_MAPPING[item]));
updateProfile();
mAdapter.notifyDataSetChanged();
dialog.dismiss();
@@ -998,7 +998,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
.setMultiChoiceItems(items, checked, listener)
.setTitle(R.string.profile_appgroups_title)
- .setPositiveButton(R.string.ok, null);
+ .setPositiveButton(android.R.string.ok, null);
builder.show();
}
@@ -1086,4 +1086,9 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
pa.startPreferencePanel(SetupTriggersFragment.class.getCanonicalName(), args,
R.string.profile_profile_manage, null, this, NEW_TRIGGER_REQUEST_CODE);
}
+
+ @Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DONT_TRACK_ME_BRO;
+ }
}
diff --git a/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java b/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java
index ea43d18..4d82499 100644
--- a/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java
+++ b/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java
@@ -3,10 +3,10 @@ package com.android.settings.profiles;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
-import android.provider.Settings;
import cyanogenmod.app.Profile;
import cyanogenmod.app.ProfileManager;
+import cyanogenmod.providers.CMSettings;
import java.util.UUID;
@@ -14,8 +14,8 @@ public class SetupDefaultProfileReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
- if (Settings.System.getInt(context.getContentResolver(),
- Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1) {
+ if (CMSettings.System.getInt(context.getContentResolver(),
+ CMSettings.System.SYSTEM_PROFILES_ENABLED, 1) == 1) {
ProfileManager profileManager = ProfileManager.getInstance(context);
Profile defaultProfile = profileManager.getProfile(
UUID.fromString("0230226d-0d05-494a-a9bd-d222a1117655"));
diff --git a/src/com/android/settings/profiles/SetupTriggersFragment.java b/src/com/android/settings/profiles/SetupTriggersFragment.java
index 1fa6428..9584a5f 100644
--- a/src/com/android/settings/profiles/SetupTriggersFragment.java
+++ b/src/com/android/settings/profiles/SetupTriggersFragment.java
@@ -29,6 +29,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
+import com.android.internal.logging.MetricsLogger;
import cyanogenmod.app.Profile;
import cyanogenmod.app.ProfileManager;
@@ -76,6 +77,11 @@ public class SetupTriggersFragment extends SettingsPreferenceFragment {
}
@Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DONT_TRACK_ME_BRO;
+ }
+
+ @Override
public void onResume() {
super.onResume();
}
diff --git a/src/com/android/settings/profiles/actions/item/LockModeItem.java b/src/com/android/settings/profiles/actions/item/LockModeItem.java
index 5c27de2..e89bcc8 100644
--- a/src/com/android/settings/profiles/actions/item/LockModeItem.java
+++ b/src/com/android/settings/profiles/actions/item/LockModeItem.java
@@ -62,7 +62,7 @@ public class LockModeItem implements Item {
}
public static int getSummaryString(Profile profile) {
- switch (profile.getScreenLockMode()) {
+ switch (profile.getScreenLockMode().getValue()) {
case Profile.LockMode.DEFAULT:
return R.string.profile_lockmode_default_summary;
case Profile.LockMode.DISABLE:
diff --git a/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java b/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java
index b3478e8..e2967de 100644
--- a/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java
+++ b/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java
@@ -179,7 +179,7 @@ public class BluetoothTriggerFragment extends ListFragment {
for (BluetoothDevice device : pairedDevices) {
BluetoothTrigger bt =
new BluetoothTrigger(device);
- int state = mProfile.getTrigger(Profile.TriggerType.BLUETOOTH, bt.getAddress());
+ int state = mProfile.getTriggerState(Profile.TriggerType.BLUETOOTH, bt.getAddress());
initPreference(bt, state, res, R.drawable.ic_settings_bluetooth);
mTriggers.add(bt);
}
diff --git a/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java b/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java
index dc91cec..c34808d 100644
--- a/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java
+++ b/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java
@@ -174,7 +174,7 @@ public class WifiTriggerFragment extends ListFragment {
WifiTrigger accessPoint = new WifiTrigger(config);
int state = mProfile.getTriggerState(
Profile.TriggerType.WIFI, accessPoint.getSSID());
- initPreference(accessPoint, state, res, R.drawable.ic_wifi_signal_4_teal);
+ initPreference(accessPoint, state, res, R.drawable.ic_wifi_signal_4);
mTriggers.add(accessPoint);
}
} else {
@@ -183,7 +183,7 @@ public class WifiTriggerFragment extends ListFragment {
for (Profile.ProfileTrigger trigger : triggers) {
WifiTrigger accessPoint = new WifiTrigger(trigger.getName());
initPreference(accessPoint, trigger.getState(), res,
- R.drawable.ic_wifi_signal_4_teal);
+ R.drawable.ic_wifi_signal_4);
mTriggers.add(accessPoint);
}
}