Loading src/com/android/settings/notification/AbstractZenModePreferenceController.java +3 −3 Original line number Diff line number Diff line Loading @@ -117,7 +117,7 @@ abstract public class AbstractZenModePreferenceController extends } protected int getZenDuration() { return Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.ZEN_DURATION, return Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.ZEN_DURATION, 0); } Loading @@ -125,8 +125,8 @@ abstract public class AbstractZenModePreferenceController extends private final Uri ZEN_MODE_URI = Settings.Global.getUriFor(Settings.Global.ZEN_MODE); private final Uri ZEN_MODE_CONFIG_ETAG_URI = Settings.Global.getUriFor( Settings.Global.ZEN_MODE_CONFIG_ETAG); private final Uri ZEN_MODE_DURATION_URI = Settings.Global.getUriFor( Settings.Global.ZEN_DURATION); private final Uri ZEN_MODE_DURATION_URI = Settings.Secure.getUriFor( Settings.Secure.ZEN_DURATION); private final Preference mPreference; Loading src/com/android/settings/notification/ChargingSoundPreferenceController.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package com.android.settings.notification; import static com.android.settings.notification.SettingPref.TYPE_GLOBAL; import static com.android.settings.notification.SettingPref.TYPE_SECURE; import android.content.Context; import android.provider.Settings.Global; import android.provider.Settings.Secure; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; Loading @@ -33,7 +33,7 @@ public class ChargingSoundPreferenceController extends SettingPrefController { Lifecycle lifecycle) { super(context, parent, lifecycle); mPreference = new SettingPref( TYPE_GLOBAL, KEY_CHARGING_SOUNDS, Global.CHARGING_SOUNDS_ENABLED, DEFAULT_ON); TYPE_SECURE, KEY_CHARGING_SOUNDS, Secure.CHARGING_SOUNDS_ENABLED, DEFAULT_ON); } @Override Loading src/com/android/settings/notification/SettingPref.java +8 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.res.Resources; import android.net.Uri; import android.provider.Settings.Global; import android.provider.Settings.Secure; import android.provider.Settings.System; import com.android.settings.SettingsPreferenceFragment; Loading @@ -34,6 +35,7 @@ import androidx.preference.TwoStatePreference; public class SettingPref { public static final int TYPE_GLOBAL = 1; public static final int TYPE_SYSTEM = 2; public static final int TYPE_SECURE = 3; protected final int mType; private final String mKey; Loading Loading @@ -132,6 +134,8 @@ public class SettingPref { return Global.getUriFor(setting); case TYPE_SYSTEM: return System.getUriFor(setting); case TYPE_SECURE: return Secure.getUriFor(setting); } throw new IllegalArgumentException(); } Loading @@ -142,6 +146,8 @@ public class SettingPref { return Global.putInt(cr, setting, value); case TYPE_SYSTEM: return System.putInt(cr, setting, value); case TYPE_SECURE: return Secure.putInt(cr, setting, value); } throw new IllegalArgumentException(); } Loading @@ -152,6 +158,8 @@ public class SettingPref { return Global.getInt(cr, setting, def); case TYPE_SYSTEM: return System.getInt(cr, setting, def); case TYPE_SECURE: return Secure.getInt(cr, setting, def); } throw new IllegalArgumentException(); } Loading src/com/android/settings/notification/ZenModeBackend.java +2 −2 Original line number Diff line number Diff line Loading @@ -136,8 +136,8 @@ public class ZenModeBackend { } protected void saveVisualEffectsPolicy(int category, boolean suppress) { Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ZEN_SETTINGS_UPDATED, 1); Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.ZEN_SETTINGS_UPDATED, 1); int suppressedEffects = getNewSuppressedEffects(suppress, category); savePolicy(mPolicy.priorityCategories, mPolicy.priorityCallSenders, Loading src/com/android/settings/notification/ZenModeButtonPreferenceController.java +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading Loading
src/com/android/settings/notification/AbstractZenModePreferenceController.java +3 −3 Original line number Diff line number Diff line Loading @@ -117,7 +117,7 @@ abstract public class AbstractZenModePreferenceController extends } protected int getZenDuration() { return Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.ZEN_DURATION, return Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.ZEN_DURATION, 0); } Loading @@ -125,8 +125,8 @@ abstract public class AbstractZenModePreferenceController extends private final Uri ZEN_MODE_URI = Settings.Global.getUriFor(Settings.Global.ZEN_MODE); private final Uri ZEN_MODE_CONFIG_ETAG_URI = Settings.Global.getUriFor( Settings.Global.ZEN_MODE_CONFIG_ETAG); private final Uri ZEN_MODE_DURATION_URI = Settings.Global.getUriFor( Settings.Global.ZEN_DURATION); private final Uri ZEN_MODE_DURATION_URI = Settings.Secure.getUriFor( Settings.Secure.ZEN_DURATION); private final Preference mPreference; Loading
src/com/android/settings/notification/ChargingSoundPreferenceController.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package com.android.settings.notification; import static com.android.settings.notification.SettingPref.TYPE_GLOBAL; import static com.android.settings.notification.SettingPref.TYPE_SECURE; import android.content.Context; import android.provider.Settings.Global; import android.provider.Settings.Secure; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; Loading @@ -33,7 +33,7 @@ public class ChargingSoundPreferenceController extends SettingPrefController { Lifecycle lifecycle) { super(context, parent, lifecycle); mPreference = new SettingPref( TYPE_GLOBAL, KEY_CHARGING_SOUNDS, Global.CHARGING_SOUNDS_ENABLED, DEFAULT_ON); TYPE_SECURE, KEY_CHARGING_SOUNDS, Secure.CHARGING_SOUNDS_ENABLED, DEFAULT_ON); } @Override Loading
src/com/android/settings/notification/SettingPref.java +8 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.res.Resources; import android.net.Uri; import android.provider.Settings.Global; import android.provider.Settings.Secure; import android.provider.Settings.System; import com.android.settings.SettingsPreferenceFragment; Loading @@ -34,6 +35,7 @@ import androidx.preference.TwoStatePreference; public class SettingPref { public static final int TYPE_GLOBAL = 1; public static final int TYPE_SYSTEM = 2; public static final int TYPE_SECURE = 3; protected final int mType; private final String mKey; Loading Loading @@ -132,6 +134,8 @@ public class SettingPref { return Global.getUriFor(setting); case TYPE_SYSTEM: return System.getUriFor(setting); case TYPE_SECURE: return Secure.getUriFor(setting); } throw new IllegalArgumentException(); } Loading @@ -142,6 +146,8 @@ public class SettingPref { return Global.putInt(cr, setting, value); case TYPE_SYSTEM: return System.putInt(cr, setting, value); case TYPE_SECURE: return Secure.putInt(cr, setting, value); } throw new IllegalArgumentException(); } Loading @@ -152,6 +158,8 @@ public class SettingPref { return Global.getInt(cr, setting, def); case TYPE_SYSTEM: return System.getInt(cr, setting, def); case TYPE_SECURE: return Secure.getInt(cr, setting, def); } throw new IllegalArgumentException(); } Loading
src/com/android/settings/notification/ZenModeBackend.java +2 −2 Original line number Diff line number Diff line Loading @@ -136,8 +136,8 @@ public class ZenModeBackend { } protected void saveVisualEffectsPolicy(int category, boolean suppress) { Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ZEN_SETTINGS_UPDATED, 1); Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.ZEN_SETTINGS_UPDATED, 1); int suppressedEffects = getNewSuppressedEffects(suppress, category); savePolicy(mPolicy.priorityCategories, mPolicy.priorityCallSenders, Loading
src/com/android/settings/notification/ZenModeButtonPreferenceController.java +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading