Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7554a810 authored by AdrianDC's avatar AdrianDC Committed by Gerrit Code Review
Browse files

Settings: Move Do Not Disturb Access under DND settings



Change-Id: I4763577b4cd5aae01705cc693dfaaf06152bd3e6
Signed-off-by: default avatarAdrianDC <radian.dc@gmail.com>
parent c02cb4d7
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
<?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"
+9 −0
Original line number Diff line number Diff line
<?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>
+1 −12
Original line number Diff line number Diff line
/*
 * 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 {
+13 −0
Original line number Diff line number Diff line
/*
 * 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
    }
}