diff options
author | Adnan Begovic <adnan@cyngn.com> | 2015-10-29 10:29:01 -0700 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-29 17:36:32 -0700 |
commit | 0c0f54e67a49f252dc75d524de93504aa316eb7a (patch) | |
tree | 11e63c0a4cca3a16ede6ab441aa5e192c65dac03 | |
parent | 6cdb128c3713a61c973cdfd38add37a5b77bc451 (diff) | |
download | packages_apps_Settings-0c0f54e67a49f252dc75d524de93504aa316eb7a.zip packages_apps_Settings-0c0f54e67a49f252dc75d524de93504aa316eb7a.tar.gz packages_apps_Settings-0c0f54e67a49f252dc75d524de93504aa316eb7a.tar.bz2 |
Settings: Refactor for M changes.
Change-Id: I64da201ca8ac1785c4b5c417ca640dadb7ae2d2b
-rw-r--r-- | AndroidManifest.xml | 4 | ||||
-rw-r--r-- | res/xml/button_settings.xml | 6 | ||||
-rw-r--r-- | res/xml/livedisplay.xml | 18 | ||||
-rw-r--r-- | src/com/android/settings/DisplaySettings.java | 23 | ||||
-rw-r--r-- | src/com/android/settings/cyanogenmod/DisplayRotation.java | 7 | ||||
-rw-r--r-- | src/com/android/settings/cyanogenmod/NavBar.java | 2 | ||||
-rw-r--r-- | src/com/android/settings/cyanogenmod/NavRing.java | 2 | ||||
-rw-r--r-- | src/com/android/settings/cyanogenmod/PowerMenuActions.java | 6 | ||||
-rw-r--r-- | src/com/android/settings/inputmethod/StylusGestures.java | 7 | ||||
-rw-r--r-- | src/com/android/settings/livedisplay/LiveDisplay.java | 6 | ||||
-rw-r--r-- | src/com/android/settings/notification/OtherSoundSettings.java | 2 |
11 files changed, 43 insertions, 40 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index cafdf44..2c4c9aa 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2227,7 +2227,7 @@ <meta-data android:name="com.android.settings.FRAGMENT_CLASS" android:value="com.android.settings.livedisplay.LiveDisplay" /> <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID" - android:resource="@id/display_and_lights_settings" /> + android:resource="@id/display_settings" /> </activity> <activity-alias android:name=".livedisplay.LiveDisplay" @@ -2239,7 +2239,7 @@ <meta-data android:name="com.android.settings.FRAGMENT_CLASS" android:value="com.android.settings.livedisplay.LiveDisplay" /> <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID" - android:resource="@id/display_and_lights_settings" /> + android:resource="@id/display_settings" /> </activity-alias> <!-- CyanogenMod activities End --> diff --git a/res/xml/button_settings.xml b/res/xml/button_settings.xml index 272bc22..2e1434a 100644 --- a/res/xml/button_settings.xml +++ b/res/xml/button_settings.xml @@ -216,8 +216,7 @@ <PreferenceCategory android:key="camera_key" - android:title="@string/hardware_keys_camera_key_title" - settings:advanced="true"> + android:title="@string/hardware_keys_camera_key_title"> <com.android.settings.cyanogenmod.SystemSettingSwitchPreference android:key="camera_wake_screen" @@ -256,8 +255,7 @@ <com.android.settings.cyanogenmod.SecureSettingSwitchPreference android:key="volume_keys_control_ring_stream" android:title="@string/volume_keys_control_ring_stream_title" - android:summary="@string/volume_keys_control_ring_stream_summary" - settings:advanced="true" /> + android:summary="@string/volume_keys_control_ring_stream_summary"/> <ListPreference android:key="volume_key_cursor_control" diff --git a/res/xml/livedisplay.xml b/res/xml/livedisplay.xml index 54e9870..6f30209 100644 --- a/res/xml/livedisplay.xml +++ b/res/xml/livedisplay.xml @@ -45,31 +45,27 @@ android:key="live_display_low_power" android:title="@string/live_display_low_power_title" android:summary="@string/live_display_low_power_summary" - android:defaultValue="true" - settings:advanced="true" /> + android:defaultValue="true" /> <!-- Color enhancement --> <com.android.settings.cyanogenmod.SystemSettingSwitchPreference android:key="live_display_color_enhance" android:title="@string/live_display_enhance_color_title" android:summary="@string/live_display_enhance_color_summary" - android:defaultValue="true" - settings:advanced="true" /> + android:defaultValue="true"/> </PreferenceCategory> <PreferenceCategory android:key="calibration" - android:title="@string/category_calibration" - settings:advanced="true"> + android:title="@string/category_calibration"> <!-- screen color --> <PreferenceScreen android:persistent="false" android:key="screencolor_settings" android:title="@string/screencolor" - android:summary="@string/screencolor_summary" - settings:advanced="true"> + android:summary="@string/screencolor_summary"> <intent android:action="com.qualcomm.display.PPService" android:targetPackage="com.android.settings" @@ -81,16 +77,14 @@ android:title="@string/color_calibration_title" android:dialogTitle="@string/color_calibration_title" android:summary="@string/color_calibration_summary" - android:persistent="false" - settings:advanced="true"/> + android:persistent="false"/> <com.android.settings.livedisplay.DisplayGamma android:key="gamma_tuning" android:title="@string/gamma_tuning_title_head" android:dialogTitle="@string/gamma_tuning_title_head" android:summary="@string/gamma_tuning_summary_head" - android:persistent="false" - settings:advanced="true"/> + android:persistent="false"/> </PreferenceCategory> diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java index 68bf1c2..6d4f94d 100644 --- a/src/com/android/settings/DisplaySettings.java +++ b/src/com/android/settings/DisplaySettings.java @@ -89,7 +89,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements private static final String KEY_AUTO_BRIGHTNESS = "auto_brightness"; private static final String KEY_AUTO_ROTATE = "auto_rotate"; private static final String KEY_NIGHT_MODE = "night_mode"; - private static final String KEY_TAP_TO_WAKE = "double_tap_wake_gesture"; private static final String KEY_PROXIMITY_WAKE = "proximity_on_wake"; private static final String KEY_DISPLAY_ROTATION = "display_rotation"; private static final String KEY_WAKE_WHEN_PLUGGED_OR_UNPLUGGED = "wake_when_plugged_or_unplugged"; @@ -110,7 +109,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements private SwitchPreference mDozePreference; private SwitchPreference mTapToWakePreference; private SwitchPreference mAutoBrightnessPreference; - private SwitchPreference mTapToWake; private SwitchPreference mWakeWhenPluggedOrUnplugged; private CMHardwareManager mHardware; @@ -171,7 +169,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements mAutoBrightnessPreference.setOnPreferenceChangeListener(this); } else { if (mAutoBrightnessPreference != null) { - removePreference(mAutoBrightnessPreference); + removePreference(KEY_AUTO_BRIGHTNESS); mAutoBrightnessPreference = null; } } @@ -181,7 +179,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements mLiftToWakePreference.setOnPreferenceChangeListener(this); } else { if (mLiftToWakePreference != null) { - removePreference(mLiftToWakePreference); + removePreference(KEY_LIFT_TO_WAKE); mLiftToWakePreference = null; } } @@ -193,7 +191,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements removePreference(KEY_DOZE); } - if (isTapToWakeAvailable(getResources())) { + if (isTapToWakeAvailable(getResources()) || mHardware.isSupported(FEATURE_TAP_TO_WAKE)) { mTapToWakePreference = (SwitchPreference) findPreference(KEY_TAP_TO_WAKE); mTapToWakePreference.setOnPreferenceChangeListener(this); } else { @@ -209,13 +207,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements mNightModePreference.setOnPreferenceChangeListener(this); } - mTapToWake = (SwitchPreference) findPreference(KEY_TAP_TO_WAKE); - if (mTapToWake != null - && !mHardware.isSupported(FEATURE_TAP_TO_WAKE)) { - advancedPrefs.removePreference(mTapToWake); - mTapToWake = null; - } - boolean proximityCheckOnWait = getResources().getBoolean( com.android.internal.R.bool.config_proximityCheckOnWake); if (!proximityCheckOnWait) { @@ -365,10 +356,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements super.onResume(); updateDisplayRotationPreferenceDescription(); - if (mTapToWake != null) { - mTapToWake.setChecked(mHardware.get(FEATURE_TAP_TO_WAKE)); - } - RotationPolicy.registerRotationPolicyListener(getActivity(), mRotationPolicyListener); @@ -479,9 +466,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { - if (preference == mTapToWake) { - return mHardware.set(FEATURE_TAP_TO_WAKE, mTapToWake.isChecked()); - } else if (preference == mWakeWhenPluggedOrUnplugged) { + if (preference == mWakeWhenPluggedOrUnplugged) { Settings.Global.putInt(getContentResolver(), Settings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED, mWakeWhenPluggedOrUnplugged.isChecked() ? 1 : 0); diff --git a/src/com/android/settings/cyanogenmod/DisplayRotation.java b/src/com/android/settings/cyanogenmod/DisplayRotation.java index 49cbe6c..13cb21f 100644 --- a/src/com/android/settings/cyanogenmod/DisplayRotation.java +++ b/src/com/android/settings/cyanogenmod/DisplayRotation.java @@ -29,6 +29,8 @@ import com.android.internal.view.RotationPolicy; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; +import com.android.internal.logging.MetricsLogger; + public class DisplayRotation extends SettingsPreferenceFragment { private static final String TAG = "DisplayRotation"; @@ -106,6 +108,11 @@ public class DisplayRotation 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/cyanogenmod/NavBar.java b/src/com/android/settings/cyanogenmod/NavBar.java index 6ce028d..ecd669f 100644 --- a/src/com/android/settings/cyanogenmod/NavBar.java +++ b/src/com/android/settings/cyanogenmod/NavBar.java @@ -85,7 +85,7 @@ public class NavBar extends Fragment implements View.OnClickListener { .setTitle(R.string.profile_reset_title) .setIcon(R.drawable.ic_navbar_restore) .setMessage(R.string.navigation_bar_reset_message) - .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { + .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { if (mEditMode) { toggleEditMode(false, false); diff --git a/src/com/android/settings/cyanogenmod/NavRing.java b/src/com/android/settings/cyanogenmod/NavRing.java index d65123b..9c3a96d 100644 --- a/src/com/android/settings/cyanogenmod/NavRing.java +++ b/src/com/android/settings/cyanogenmod/NavRing.java @@ -63,7 +63,7 @@ public class NavRing extends Fragment implements View.OnClickListener { .setTitle(R.string.profile_reset_title) .setIcon(R.drawable.ic_navbar_restore) .setMessage(R.string.navigation_bar_reset_message) - .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { + .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { for (int i = 0; i < 3; i++) { Settings.Secure.putString(getActivity().getContentResolver(), diff --git a/src/com/android/settings/cyanogenmod/PowerMenuActions.java b/src/com/android/settings/cyanogenmod/PowerMenuActions.java index b43fdfa..7728728 100644 --- a/src/com/android/settings/cyanogenmod/PowerMenuActions.java +++ b/src/com/android/settings/cyanogenmod/PowerMenuActions.java @@ -31,6 +31,7 @@ import android.preference.ListPreference; import android.preference.Preference.OnPreferenceChangeListener; import android.provider.Settings; +import com.android.internal.logging.MetricsLogger; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; import com.android.internal.util.cm.PowerMenuConstants; @@ -105,6 +106,11 @@ public class PowerMenuActions extends SettingsPreferenceFragment { } @Override + protected int getMetricsCategory() { + return MetricsLogger.DONT_TRACK_ME_BRO; + } + + @Override public void onStart() { super.onStart(); diff --git a/src/com/android/settings/inputmethod/StylusGestures.java b/src/com/android/settings/inputmethod/StylusGestures.java index 5661adc..151a7ac 100644 --- a/src/com/android/settings/inputmethod/StylusGestures.java +++ b/src/com/android/settings/inputmethod/StylusGestures.java @@ -32,6 +32,8 @@ import android.provider.Settings; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; +import com.android.internal.logging.MetricsLogger; + import java.util.Collections; import java.util.List; @@ -81,6 +83,11 @@ public class StylusGestures extends SettingsPreferenceFragment implements mSwipeDouble = setupGesturePref(KEY_SPEN_DOUBLE, Settings.System.GESTURES_DOUBLE_TAP); } + @Override + protected int getMetricsCategory() { + return MetricsLogger.DONT_TRACK_ME_BRO; + } + private ListPreference setupGesturePref(String key, String settingName) { ListPreference pref = (ListPreference) findPreference(key); String setting = Settings.System.getString(mResolver, settingName); diff --git a/src/com/android/settings/livedisplay/LiveDisplay.java b/src/com/android/settings/livedisplay/LiveDisplay.java index dd20f0e..71ff5a9 100644 --- a/src/com/android/settings/livedisplay/LiveDisplay.java +++ b/src/com/android/settings/livedisplay/LiveDisplay.java @@ -40,6 +40,7 @@ import android.provider.SearchIndexableResource; import android.provider.Settings; import com.android.internal.util.ArrayUtils; +import com.android.internal.logging.MetricsLogger; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; import com.android.settings.Utils; @@ -201,6 +202,11 @@ public class LiveDisplay extends SettingsPreferenceFragment implements } @Override + protected int getMetricsCategory() { + return MetricsLogger.DONT_TRACK_ME_BRO; + } + + @Override public void onResume() { super.onResume(); updateModeSummary(); diff --git a/src/com/android/settings/notification/OtherSoundSettings.java b/src/com/android/settings/notification/OtherSoundSettings.java index a4b5605..fe76832 100644 --- a/src/com/android/settings/notification/OtherSoundSettings.java +++ b/src/com/android/settings/notification/OtherSoundSettings.java @@ -148,7 +148,7 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In TYPE_SYSTEM, KEY_VIBRATION_INTENSITY, System.HAPTIC_FEEDBACK_ENABLED, DEFAULT_ON) { @Override public boolean isApplicable(Context context) { - return VibratorIntensity.isSupported(); + return false; //VibratorIntensity.isSupported(); } }; |