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

Commit c6e6e8f9 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Give mConsolidatedPolicy a default value" into rvc-dev am: 552d491f

Change-Id: Id6d9626be3d3c4ae7ad9f87ff495b82021e4c697
parents bff526f4 552d491f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5995,7 +5995,7 @@ package android.app {
    method public android.service.notification.StatusBarNotification[] getActiveNotifications();
    method public android.app.AutomaticZenRule getAutomaticZenRule(String);
    method public java.util.Map<java.lang.String,android.app.AutomaticZenRule> getAutomaticZenRules();
    method @Nullable public android.app.NotificationManager.Policy getConsolidatedNotificationPolicy();
    method @NonNull public android.app.NotificationManager.Policy getConsolidatedNotificationPolicy();
    method public final int getCurrentInterruptionFilter();
    method public int getImportance();
    method public android.app.NotificationChannel getNotificationChannel(String);
+6 −5
Original line number Diff line number Diff line
@@ -1015,14 +1015,15 @@ public class NotificationManager {
    }

    /**
     * Returns the currently applied notification policy.
     *
     * <p>
     *  Gets the currently applied notification policy. If {@link #getCurrentInterruptionFilter}
     * is equal to {@link #INTERRUPTION_FILTER_ALL}, then the consolidated notification policy
     * will match the default notification policy returned by {@link #getNotificationPolicy}.
     * If {@link #getCurrentInterruptionFilter} is equal to {@link #INTERRUPTION_FILTER_ALL},
     * then the consolidated notification policy will match the default notification policy
     * returned by {@link #getNotificationPolicy}.
     * </p>
     */
    @Nullable
    public NotificationManager.Policy getConsolidatedNotificationPolicy() {
    public @NonNull NotificationManager.Policy getConsolidatedNotificationPolicy() {
        INotificationManager service = getService();
        try {
            return service.getConsolidatedNotificationPolicy();
+1 −3
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ public class ZenModeHelper {
        updateDefaultAutomaticRuleNames();
        mConfig = mDefaultConfig.copy();
        mConfigs.put(UserHandle.USER_SYSTEM, mConfig);
        mConsolidatedPolicy = mConfig.toNotificationPolicy();

        mSettingsObserver = new SettingsObserver(mHandler);
        mSettingsObserver.observe();
@@ -821,9 +822,6 @@ public class ZenModeHelper {
     * @return a copy of the zen mode consolidated policy
     */
    public Policy getConsolidatedNotificationPolicy() {
        if (mConsolidatedPolicy == null) {
            return null;
        }
        return mConsolidatedPolicy.copy();
    }