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

Commit 82649a88 authored by Beverly's avatar Beverly Committed by android-build-merger
Browse files

Merge "Cannot add null callbacks to ZenController" into pi-dev

am: d87ad2d9

Change-Id: I7cc869829a8b16a9f07714365f83622b27de935c
parents 13be3ca4 d87ad2d9
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ import java.util.Map;

public class StatusBar extends SystemUI implements DemoMode,
        DragDownHelper.DragDownCallback, ActivityStarter, OnUnlockMethodChangedListener,
        OnHeadsUpChangedListener, CommandQueue.Callbacks,
        OnHeadsUpChangedListener, CommandQueue.Callbacks, ZenModeController.Callback,
        ColorExtractor.OnColorsChangedListener, ConfigurationListener, NotificationPresenter {
    public static final boolean MULTIUSER_DEBUG = false;

@@ -785,12 +785,7 @@ public class StatusBar extends SystemUI implements DemoMode,
        // into fragments, but the rest here, it leaves some awkward lifecycle and whatnot.
        mNotificationPanel = mStatusBarWindow.findViewById(R.id.notification_panel);
        mStackScroller = mStatusBarWindow.findViewById(R.id.notification_stack_scroller);
        mZenController.addCallback(new ZenModeController.Callback() {
            @Override
            public void onZenChanged(int zen) {
                updateEmptyShadeView();
            }
        });
        mZenController.addCallback(this);
        mActivityLaunchAnimator = new ActivityLaunchAnimator(mStatusBarWindow,
                this,
                mNotificationPanel,
@@ -3376,6 +3371,7 @@ public class StatusBar extends SystemUI implements DemoMode,
        Dependency.get(ActivityStarterDelegate.class).setActivityStarterImpl(null);
        mDeviceProvisionedController.removeCallback(mUserSetupObserver);
        Dependency.get(ConfigurationController.class).removeCallback(this);
        mZenController.removeCallback(this);
        mAppOpsListener.destroy();
    }

@@ -5535,6 +5531,11 @@ public class StatusBar extends SystemUI implements DemoMode,
        return mStatusBarKeyguardViewManager.isSecure();
    }

    @Override
    public void onZenChanged(int zen) {
        updateEmptyShadeView();
    }

    @Override
    public void showAssistDisclosure() {
        if (mAssistManager != null) {
+5 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.service.notification.Condition;
import android.service.notification.ZenModeConfig;
import android.service.notification.ZenModeConfig.ZenRule;
import android.util.Log;
import android.util.Slog;

import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.qs.GlobalSetting;
@@ -112,6 +113,10 @@ public class ZenModeControllerImpl extends CurrentUserTracker implements ZenMode

    @Override
    public void addCallback(Callback callback) {
        if (callback == null) {
            Slog.e(TAG, "Attempted to add a null callback.");
            return;
        }
        mCallbacks.add(callback);
    }

+7 −1
Original line number Diff line number Diff line
@@ -105,4 +105,10 @@ public class ZenModeControllerImplTest extends SysuiTestCase {

        assertTrue(mController.areNotificationsHiddenInShade());
    }

    @Test
    public void testAddNullCallback() {
        mController.addCallback(null);
        mController.fireConfigChanged(null);
    }
}