Use Settings.Secure values, not Global values

The following Settings are being moved to Settings.Secure
from Settings.Global since they are settings that exist
per user
 - CHARGING_SOUNDS_ENABLED
 - CHARGING_VIBRATION_ENABLED
 - ZEN_DURATION
 - SHOW_ZEN_UPGRADE_NOTIFICATION
 - SHOW_ZEN_SETTINGS_SUGGESTION
 - ZEN_SETTINGS_UPDATE
 - ZEN_SETTINGS_SUGGESTION_VIEWED

Bug: 110926544
Test: make ROBOTEST_FILTER=ZenModeDurationPreferenceControllerTest RunSettingsRoboTests
Change-Id: I3e3d6f6653b81a121fbda7d2f9f1b75651f536b7
This commit is contained in:
Beverly
2018-07-02 16:46:11 -04:00
parent ee8bf5d463
commit b00cef308e
9 changed files with 45 additions and 36 deletions

View File

@@ -97,14 +97,14 @@ public class ZenModeButtonPreferenceController extends AbstractZenModePreference
private void updateZenButtonOnClickListener() {
int zenDuration = getZenDuration();
switch (zenDuration) {
case Settings.Global.ZEN_DURATION_PROMPT:
case Settings.Secure.ZEN_DURATION_PROMPT:
mZenButtonOn.setOnClickListener(v -> {
mMetricsFeatureProvider.action(mContext,
MetricsProto.MetricsEvent.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
new SettingsEnableZenModeDialog().show(mFragment, TAG);
});
break;
case Settings.Global.ZEN_DURATION_FOREVER:
case Settings.Secure.ZEN_DURATION_FOREVER:
mZenButtonOn.setOnClickListener(v -> {
mMetricsFeatureProvider.action(mContext,
MetricsProto.MetricsEvent.ACTION_ZEN_TOGGLE_DND_BUTTON, false);