diff options
author | AdrianDC <radian.dc@gmail.com> | 2016-01-19 12:23:41 +0100 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-01-24 17:46:31 -0800 |
commit | 7554a81057aafab96eea1b057b3ada5bade9e9ff (patch) | |
tree | 436bf5cb8b44ba30b61c9cd5d4cd21d0955b1faf | |
parent | c02cb4d7197f538d9036daef877f36e926a12393 (diff) | |
download | packages_apps_Settings-7554a81057aafab96eea1b057b3ada5bade9e9ff.zip packages_apps_Settings-7554a81057aafab96eea1b057b3ada5bade9e9ff.tar.gz packages_apps_Settings-7554a81057aafab96eea1b057b3ada5bade9e9ff.tar.bz2 |
Settings: Move Do Not Disturb Access under DND settings
Change-Id: I4763577b4cd5aae01705cc693dfaaf06152bd3e6
Signed-off-by: AdrianDC <radian.dc@gmail.com>
-rw-r--r-- | res/xml/notification_manager_settings.xml | 9 | ||||
-rw-r--r-- | res/xml/zen_mode_settings.xml | 9 | ||||
-rw-r--r-- | src/com/android/settings/notification/SoundSettings.java | 13 | ||||
-rw-r--r-- | src/com/android/settings/notification/ZenModeSettings.java | 13 |
4 files changed, 24 insertions, 20 deletions
diff --git a/res/xml/notification_manager_settings.xml b/res/xml/notification_manager_settings.xml index d929e50..b45cb6b 100644 --- a/res/xml/notification_manager_settings.xml +++ b/res/xml/notification_manager_settings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- - Copyright (C) 2015 The CyanogenMod Project + Copyright (C) 2015-2016 The CyanogenMod Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -31,13 +31,6 @@ settings:keywords="@string/keywords_sounds_and_notifications_interruptions" android:fragment="com.android.settings.notification.ZenModeSettings" /> - <!-- Do Not Disturb access --> - <Preference - android:key="manage_zen_access" - android:title="@string/manage_zen_access_title" - android:persistent="false" - android:fragment="com.android.settings.notification.ZenAccessSettings" /> - <!-- When device is locked --> <com.android.settings.DropDownPreference android:key="lock_screen_notifications" diff --git a/res/xml/zen_mode_settings.xml b/res/xml/zen_mode_settings.xml index 267727f..258c583 100644 --- a/res/xml/zen_mode_settings.xml +++ b/res/xml/zen_mode_settings.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 The Android Open Source Project + Copyright (C) 2016 The CyanogenMod Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,4 +31,12 @@ android:key="automation_settings" android:title="@string/zen_mode_automation_settings_title" android:fragment="com.android.settings.notification.ZenModeAutomationSettings" /> + + <!-- Do Not Disturb access --> + <Preference + android:key="manage_zen_access" + android:title="@string/manage_zen_access_title" + android:persistent="false" + android:fragment="com.android.settings.notification.ZenAccessSettings" /> + </PreferenceScreen> diff --git a/src/com/android/settings/notification/SoundSettings.java b/src/com/android/settings/notification/SoundSettings.java index 33fe821..679eb97 100644 --- a/src/com/android/settings/notification/SoundSettings.java +++ b/src/com/android/settings/notification/SoundSettings.java @@ -1,5 +1,6 @@ /* * Copyright (C) 2014 The Android Open Source Project + * Copyright (C) 2016 The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +92,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements Indexab private static final String KEY_INCREASING_RING_VOLUME = "increasing_ring_volume"; private static final String KEY_VIBRATION_INTENSITY = "vibration_intensity"; private static final String KEY_VIBRATE_ON_TOUCH = "vibrate_on_touch"; - private static final String KEY_ZEN_ACCESS = "manage_zen_access"; private static final String KEY_ZEN_MODE = "zen_mode"; private static final String KEY_VOLUME_LINK_NOTIFICATION = "volume_link_notification"; @@ -100,7 +100,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements Indexab KEY_ALARM_VOLUME, KEY_RING_VOLUME, KEY_NOTIFICATION_VOLUME, - KEY_ZEN_ACCESS, KEY_ZEN_MODE, }; @@ -136,7 +135,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements Indexab private Preference mNotificationRingtonePreference; private TwoStatePreference mVibrateWhenRinging; private Preference mNotificationAccess; - private Preference mZenAccess; private boolean mSecure; private int mLockscreenSelectedValue; private ComponentName mSuppressor; @@ -192,8 +190,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements Indexab mNotificationAccess = findPreference(KEY_NOTIFICATION_ACCESS); refreshNotificationListeners(); - mZenAccess = findPreference(KEY_ZEN_ACCESS); - refreshZenAccess(); updateRingerMode(); updateEffectsSuppressor(); } @@ -202,7 +198,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements Indexab public void onResume() { super.onResume(); refreshNotificationListeners(); - refreshZenAccess(); lookupRingtoneNames(); updateNotificationPreferenceState(); mSettingsObserver.register(true); @@ -544,12 +539,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements Indexab } } - // === Zen access === - - private void refreshZenAccess() { - // noop for now - } - // === Callbacks === private final class SettingsObserver extends ContentObserver { diff --git a/src/com/android/settings/notification/ZenModeSettings.java b/src/com/android/settings/notification/ZenModeSettings.java index 22c4112..8d21269 100644 --- a/src/com/android/settings/notification/ZenModeSettings.java +++ b/src/com/android/settings/notification/ZenModeSettings.java @@ -1,5 +1,6 @@ /* * Copyright (C) 2014 The Android Open Source Project + * Copyright (C) 2016 The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,8 +37,10 @@ import java.util.List; public class ZenModeSettings extends ZenModeSettingsBase implements Indexable { private static final String KEY_PRIORITY_SETTINGS = "priority_settings"; private static final String KEY_AUTOMATION_SETTINGS = "automation_settings"; + private static final String KEY_ZEN_ACCESS = "manage_zen_access"; private Preference mPrioritySettings; + private Preference mZenAccess; @Override public void onCreate(Bundle savedInstanceState) { @@ -50,12 +53,16 @@ public class ZenModeSettings extends ZenModeSettingsBase implements Indexable { if (!isScheduleSupported(mContext)) { removePreference(KEY_AUTOMATION_SETTINGS); } + + mZenAccess = findPreference(KEY_ZEN_ACCESS); + refreshZenAccess(); } @Override public void onResume() { super.onResume(); updateControls(); + refreshZenAccess(); } @Override @@ -136,4 +143,10 @@ public class ZenModeSettings extends ZenModeSettingsBase implements Indexable { return rt; } }; + + // === Zen access === + + private void refreshZenAccess() { + // noop for now + } } |