Merge changes from topic "b190746471-status-bar-refactor" into sc-v2-dev

* changes:
  Remove custom Handler from StatusBar.
  Move ActivityLaunchAnimator.KeyguardHandler internal to StatusBar.
  Move BatteryStateChangeCallback internal to StatusBar.
  Move ConfigurationListener to internal field in StatusBar.
This commit is contained in:
Dave Mankoff
2021-08-18 15:37:07 +00:00
committed by Android (Google) Code Review
5 changed files with 262 additions and 293 deletions

View File

@@ -118,10 +118,6 @@ public class ShadeControllerImpl implements ShadeController {
+ " flags=" + flags); + " flags=" + flags);
} }
if ((flags & CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL) == 0) {
getStatusBar().postHideRecentApps();
}
// TODO(b/62444020): remove when this bug is fixed // TODO(b/62444020): remove when this bug is fixed
Log.v(TAG, "NotificationShadeWindow: " + getNotificationShadeWindowView() Log.v(TAG, "NotificationShadeWindow: " + getNotificationShadeWindowView()
+ " canPanelBeCollapsed(): " + " canPanelBeCollapsed(): "

View File

@@ -73,7 +73,6 @@ import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.os.Message;
import android.os.PowerManager; import android.os.PowerManager;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.ServiceManager; import android.os.ServiceManager;
@@ -143,6 +142,7 @@ import com.android.systemui.camera.CameraIntents;
import com.android.systemui.charging.WirelessChargingAnimation; import com.android.systemui.charging.WirelessChargingAnimation;
import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.demomode.DemoModeController; import com.android.systemui.demomode.DemoModeController;
import com.android.systemui.emergency.EmergencyGesture; import com.android.systemui.emergency.EmergencyGesture;
@@ -227,6 +227,8 @@ import com.android.systemui.statusbar.policy.UserInfoControllerImpl;
import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService;
import com.android.systemui.unfold.UnfoldLightRevealOverlayAnimation; import com.android.systemui.unfold.UnfoldLightRevealOverlayAnimation;
import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.concurrency.MessageRouter;
import com.android.systemui.volume.VolumeComponent; import com.android.systemui.volume.VolumeComponent;
import com.android.systemui.wmshell.BubblesManager; import com.android.systemui.wmshell.BubblesManager;
import com.android.unfold.config.UnfoldTransitionConfig; import com.android.unfold.config.UnfoldTransitionConfig;
@@ -252,16 +254,9 @@ import dagger.Lazy;
/** */ /** */
public class StatusBar extends SystemUI implements public class StatusBar extends SystemUI implements
ActivityStarter, ActivityStarter,
ConfigurationListener, LifecycleOwner {
StatusBarStateController.StateListener,
LifecycleOwner, BatteryController.BatteryStateChangeCallback,
ActivityLaunchAnimator.Callback {
public static final boolean MULTIUSER_DEBUG = false; public static final boolean MULTIUSER_DEBUG = false;
protected static final int MSG_HIDE_RECENT_APPS = 1020;
protected static final int MSG_PRELOAD_RECENT_APPS = 1022;
protected static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 1023;
protected static final int MSG_TOGGLE_KEYBOARD_SHORTCUTS_MENU = 1026;
protected static final int MSG_DISMISS_KEYBOARD_SHORTCUTS_MENU = 1027; protected static final int MSG_DISMISS_KEYBOARD_SHORTCUTS_MENU = 1027;
// Should match the values in PhoneWindowManager // Should match the values in PhoneWindowManager
@@ -289,8 +284,6 @@ public class StatusBar extends SystemUI implements
public static final String ACTION_FAKE_ARTWORK = "fake_artwork"; public static final String ACTION_FAKE_ARTWORK = "fake_artwork";
private static final int MSG_OPEN_NOTIFICATION_PANEL = 1000;
private static final int MSG_CLOSE_PANELS = 1001;
private static final int MSG_OPEN_SETTINGS_PANEL = 1002; private static final int MSG_OPEN_SETTINGS_PANEL = 1002;
private static final int MSG_LAUNCH_TRANSITION_TIMEOUT = 1003; private static final int MSG_LAUNCH_TRANSITION_TIMEOUT = 1003;
// 1020-1040 reserved for BaseStatusBar // 1020-1040 reserved for BaseStatusBar
@@ -370,13 +363,14 @@ public class StatusBar extends SystemUI implements
mWereIconsJustHidden = justHidden; mWereIconsJustHidden = justHidden;
} }
void resetHandlerMsg(int msg) { void resendMessage(int msg) {
mHandler.removeMessages(msg); mMessageRouter.cancelMessages(msg);
mHandler.sendEmptyMessage(msg); mMessageRouter.sendMessage(msg);
} }
Handler getHandler() { void resendMessage(Object msg) {
return mHandler; mMessageRouter.cancelMessages(msg.getClass());
mMessageRouter.sendMessage(msg);
} }
int getDisabled1() { int getDisabled1() {
@@ -544,6 +538,7 @@ public class StatusBar extends SystemUI implements
private final UnfoldTransitionConfig mUnfoldTransitionConfig; private final UnfoldTransitionConfig mUnfoldTransitionConfig;
private final Lazy<UnfoldLightRevealOverlayAnimation> mUnfoldLightRevealOverlayAnimation; private final Lazy<UnfoldLightRevealOverlayAnimation> mUnfoldLightRevealOverlayAnimation;
private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController; private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
private final MessageRouter mMessageRouter;
private final WallpaperManager mWallpaperManager; private final WallpaperManager mWallpaperManager;
private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
private final TunerService mTunerService; private final TunerService mTunerService;
@@ -636,7 +631,8 @@ public class StatusBar extends SystemUI implements
} }
} }
protected final H mHandler = createHandler(); private Handler mMainHandler;
private final DelayableExecutor mMainExecutor;
private int mInteractingWindows; private int mInteractingWindows;
private @TransitionMode int mStatusBarMode; private @TransitionMode int mStatusBarMode;
@@ -767,8 +763,6 @@ public class StatusBar extends SystemUI implements
} }
}; };
private final Handler mMainThreadHandler = new Handler(Looper.getMainLooper());
private HeadsUpAppearanceController mHeadsUpAppearanceController; private HeadsUpAppearanceController mHeadsUpAppearanceController;
private ActivityLaunchAnimator mActivityLaunchAnimator; private ActivityLaunchAnimator mActivityLaunchAnimator;
private NotificationLaunchAnimatorControllerProvider mNotificationAnimationProvider; private NotificationLaunchAnimatorControllerProvider mNotificationAnimationProvider;
@@ -787,6 +781,174 @@ public class StatusBar extends SystemUI implements
private final ColorExtractor.OnColorsChangedListener mOnColorsChangedListener = private final ColorExtractor.OnColorsChangedListener mOnColorsChangedListener =
(extractor, which) -> updateTheme(); (extractor, which) -> updateTheme();
private final ConfigurationListener mConfigurationListener = new ConfigurationListener() {
@Override
public void onConfigChanged(Configuration newConfig) {
updateResources();
updateDisplaySize(); // populates mDisplayMetrics
if (DEBUG) {
Log.v(TAG, "configuration changed: " + mContext.getResources().getConfiguration());
}
mViewHierarchyManager.updateRowStates();
mScreenPinningRequest.onConfigurationChanged();
}
@Override
public void onDensityOrFontScaleChanged() {
// TODO: Remove this.
if (mBrightnessMirrorController != null) {
mBrightnessMirrorController.onDensityOrFontScaleChanged();
}
// TODO: Bring these out of StatusBar.
mUserInfoControllerImpl.onDensityOrFontScaleChanged();
mUserSwitcherController.onDensityOrFontScaleChanged();
mNotificationIconAreaController.onDensityOrFontScaleChanged(mContext);
mHeadsUpManager.onDensityOrFontScaleChanged();
}
@Override
public void onThemeChanged() {
if (mStatusBarKeyguardViewManager != null) {
mStatusBarKeyguardViewManager.onThemeChanged();
}
if (mAmbientIndicationContainer instanceof AutoReinflateContainer) {
((AutoReinflateContainer) mAmbientIndicationContainer).inflateLayout();
}
mNotificationIconAreaController.onThemeChanged();
}
@Override
public void onOverlayChanged() {
if (mBrightnessMirrorController != null) {
mBrightnessMirrorController.onOverlayChanged();
}
// We need the new R.id.keyguard_indication_area before recreating
// mKeyguardIndicationController
mNotificationPanelViewController.onThemeChanged();
onThemeChanged();
}
@Override
public void onUiModeChanged() {
if (mBrightnessMirrorController != null) {
mBrightnessMirrorController.onUiModeChanged();
}
}
};
private StatusBarStateController.StateListener mStateListener =
new StatusBarStateController.StateListener() {
@Override
public void onStatePreChange(int oldState, int newState) {
// If we're visible and switched to SHADE_LOCKED (the user dragged
// down on the lockscreen), clear notification LED, vibration,
// ringing.
// Other transitions are covered in handleVisibleToUserChanged().
if (mVisible && (newState == StatusBarState.SHADE_LOCKED
|| mStatusBarStateController.goingToFullShade())) {
clearNotificationEffects();
}
if (newState == StatusBarState.KEYGUARD) {
mRemoteInputManager.onPanelCollapsed();
maybeEscalateHeadsUp();
}
}
@Override
public void onStateChanged(int newState) {
mState = newState;
updateReportRejectedTouchVisibility();
mDozeServiceHost.updateDozing();
updateTheme();
mNavigationBarController.touchAutoDim(mDisplayId);
Trace.beginSection("StatusBar#updateKeyguardState");
if (mState == StatusBarState.KEYGUARD && mStatusBarView != null) {
mStatusBarView.removePendingHideExpandedRunnables();
}
updateDozingState();
checkBarModes();
updateScrimController();
mPresenter.updateMediaMetaData(false, mState != StatusBarState.KEYGUARD);
updateKeyguardState();
Trace.endSection();
}
@Override
public void onDozeAmountChanged(float linear, float eased) {
if (mFeatureFlags.useNewLockscreenAnimations()
&& !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) {
mLightRevealScrim.setRevealAmount(1f - linear);
}
}
@Override
public void onDozingChanged(boolean isDozing) {
Trace.beginSection("StatusBar#updateDozing");
mDozing = isDozing;
// Collapse the notification panel if open
boolean dozingAnimated = mDozeServiceHost.getDozingRequested()
&& mDozeParameters.shouldControlScreenOff();
mNotificationPanelViewController.resetViews(dozingAnimated);
updateQsExpansionEnabled();
mKeyguardViewMediator.setDozing(mDozing);
mNotificationsController.requestNotificationUpdate("onDozingChanged");
updateDozingState();
mDozeServiceHost.updateDozing();
updateScrimController();
updateReportRejectedTouchVisibility();
Trace.endSection();
}
};
private final BatteryController.BatteryStateChangeCallback mBatteryStateChangeCallback =
new BatteryController.BatteryStateChangeCallback() {
@Override
public void onPowerSaveChanged(boolean isPowerSave) {
mMainExecutor.execute(mCheckBarModes);
if (mDozeServiceHost != null) {
mDozeServiceHost.firePowerSaveChanged(isPowerSave);
}
}
};
private final ActivityLaunchAnimator.Callback mKeyguardHandler =
new ActivityLaunchAnimator.Callback() {
@Override
public boolean isOnKeyguard() {
return mKeyguardStateController.isShowing();
}
@Override
public void hideKeyguardWithAnimation(IRemoteAnimationRunner runner) {
// We post to the main thread for 2 reasons:
// 1. KeyguardViewMediator is not thread-safe.
// 2. To ensure that ViewMediatorCallback#keyguardDonePending is called before
// ViewMediatorCallback#readyForKeyguardDone. The wrong order could occur when
// doing dismissKeyguardThenExecute { hideKeyguardWithAnimation(runner) }.
mMainExecutor.execute(() -> mKeyguardViewMediator.hideWithAnimation(runner));
}
@Override
public void setBlursDisabledForAppLaunch(boolean disabled) {
mKeyguardViewMediator.setBlursDisabledForAppLaunch(disabled);
}
@Override
public int getBackgroundColor(TaskInfo task) {
if (!mStartingSurfaceOptional.isPresent()) {
Log.w(TAG, "No starting surface, defaulting to SystemBGColor");
return SplashscreenContentDrawer.getSystemBGColor();
}
return mStartingSurfaceOptional.get().getBackgroundColor(task);
}
};
/** /**
* Public constructor for StatusBar. * Public constructor for StatusBar.
* *
@@ -881,6 +1043,9 @@ public class StatusBar extends SystemUI implements
LockscreenShadeTransitionController lockscreenShadeTransitionController, LockscreenShadeTransitionController lockscreenShadeTransitionController,
FeatureFlags featureFlags, FeatureFlags featureFlags,
KeyguardUnlockAnimationController keyguardUnlockAnimationController, KeyguardUnlockAnimationController keyguardUnlockAnimationController,
@Main Handler mainHandler,
@Main DelayableExecutor delayableExecutor,
@Main MessageRouter messageRouter,
WallpaperManager wallpaperManager, WallpaperManager wallpaperManager,
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController, UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
Optional<StartingSurface> startingSurfaceOptional, Optional<StartingSurface> startingSurfaceOptional,
@@ -968,6 +1133,9 @@ public class StatusBar extends SystemUI implements
mStatusBarIconController = statusBarIconController; mStatusBarIconController = statusBarIconController;
mFeatureFlags = featureFlags; mFeatureFlags = featureFlags;
mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mKeyguardUnlockAnimationController = keyguardUnlockAnimationController;
mMainHandler = mainHandler;
mMainExecutor = delayableExecutor;
mMessageRouter = messageRouter;
mWallpaperManager = wallpaperManager; mWallpaperManager = wallpaperManager;
mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController; mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController;
mTunerService = tunerService; mTunerService = tunerService;
@@ -985,7 +1153,18 @@ public class StatusBar extends SystemUI implements
}); });
mActivityIntentHelper = new ActivityIntentHelper(mContext); mActivityIntentHelper = new ActivityIntentHelper(mContext);
// TODO(b/190746471): Find a better home for this.
DateTimeView.setReceiverHandler(timeTickHandler); DateTimeView.setReceiverHandler(timeTickHandler);
mMessageRouter.subscribeTo(KeyboardShortcutsData.class,
data -> toggleKeyboardShortcuts(data.mDeviceId));
mMessageRouter.subscribeTo(MSG_DISMISS_KEYBOARD_SHORTCUTS_MENU,
id -> dismissKeyboardShortcuts());
mMessageRouter.subscribeTo(AnimateExpandSettingsPanelData.class,
data -> mCommandQueueCallbacks.animateExpandSettingsPanel(data.mSubpanel));
mMessageRouter.subscribeTo(MSG_LAUNCH_TRANSITION_TIMEOUT,
id -> onLaunchTransitionTimeout());
} }
@Override @Override
@@ -1003,7 +1182,7 @@ public class StatusBar extends SystemUI implements
mKeyguardIndicationController.init(); mKeyguardIndicationController.init();
mColorExtractor.addOnColorsChangedListener(mOnColorsChangedListener); mColorExtractor.addOnColorsChangedListener(mOnColorsChangedListener);
mStatusBarStateController.addCallback(this, mStatusBarStateController.addCallback(mStateListener,
SysuiStatusBarStateController.RANK_STATUS_BAR); SysuiStatusBarStateController.RANK_STATUS_BAR);
mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
@@ -1117,9 +1296,9 @@ public class StatusBar extends SystemUI implements
mAmbientIndicationContainer); mAmbientIndicationContainer);
mDozeParameters.addCallback(this::updateLightRevealScrimVisibility); mDozeParameters.addCallback(this::updateLightRevealScrimVisibility);
mConfigurationController.addCallback(this); mConfigurationController.addCallback(mConfigurationListener);
mBatteryController.observe(mLifecycle, this); mBatteryController.observe(mLifecycle, mBatteryStateChangeCallback);
mLifecycle.setCurrentState(RESUMED); mLifecycle.setCurrentState(RESUMED);
// set the initial view visibility // set the initial view visibility
@@ -1140,7 +1319,7 @@ public class StatusBar extends SystemUI implements
@Override @Override
public void onPluginConnected(OverlayPlugin plugin, Context pluginContext) { public void onPluginConnected(OverlayPlugin plugin, Context pluginContext) {
mMainThreadHandler.post( mMainExecutor.execute(
() -> plugin.setup(getNotificationShadeWindowView(), () -> plugin.setup(getNotificationShadeWindowView(),
getNavigationBarView(), getNavigationBarView(),
new Callback(plugin), mDozeParameters)); new Callback(plugin), mDozeParameters));
@@ -1148,7 +1327,7 @@ public class StatusBar extends SystemUI implements
@Override @Override
public void onPluginDisconnected(OverlayPlugin plugin) { public void onPluginDisconnected(OverlayPlugin plugin) {
mMainThreadHandler.post(() -> { mMainExecutor.execute(() -> {
mOverlays.remove(plugin); mOverlays.remove(plugin);
mNotificationShadeWindowController mNotificationShadeWindowController
.setForcePluginOpen(mOverlays.size() != 0, this); .setForcePluginOpen(mOverlays.size() != 0, this);
@@ -1169,7 +1348,7 @@ public class StatusBar extends SystemUI implements
} else { } else {
mOverlays.remove(mPlugin); mOverlays.remove(mPlugin);
} }
mMainThreadHandler.post(() -> { mMainExecutor.execute(() -> {
mNotificationShadeWindowController mNotificationShadeWindowController
.setStateListener(b -> mOverlays.forEach( .setStateListener(b -> mOverlays.forEach(
o -> o.setCollapseDesired(b))); o -> o.setCollapseDesired(b)));
@@ -1231,7 +1410,7 @@ public class StatusBar extends SystemUI implements
mConfigurationController, mConfigurationController,
mTunerService, mTunerService,
mBroadcastDispatcher, mBroadcastDispatcher,
mMainThreadHandler, mMainHandler,
mContext.getContentResolver() mContext.getContentResolver()
); );
mBatteryMeterViewController.init(); mBatteryMeterViewController.init();
@@ -1487,19 +1666,6 @@ public class StatusBar extends SystemUI implements
return mLifecycle; return mLifecycle;
} }
@Override
public void onPowerSaveChanged(boolean isPowerSave) {
mHandler.post(mCheckBarModes);
if (mDozeServiceHost != null) {
mDozeServiceHost.firePowerSaveChanged(isPowerSave);
}
}
@Override
public void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging) {
// noop
}
@VisibleForTesting @VisibleForTesting
protected void registerBroadcastReceiver() { protected void registerBroadcastReceiver() {
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
@@ -1515,7 +1681,7 @@ public class StatusBar extends SystemUI implements
private void setUpPresenter() { private void setUpPresenter() {
// Set up the initial notification state. // Set up the initial notification state.
mActivityLaunchAnimator = new ActivityLaunchAnimator(this, mContext); mActivityLaunchAnimator = new ActivityLaunchAnimator(mKeyguardHandler, mContext);
mNotificationAnimationProvider = new NotificationLaunchAnimatorControllerProvider( mNotificationAnimationProvider = new NotificationLaunchAnimatorControllerProvider(
mNotificationShadeWindowViewController, mNotificationShadeWindowViewController,
mStackScrollerController.getNotificationListContainer(), mStackScrollerController.getNotificationListContainer(),
@@ -1631,48 +1797,6 @@ public class StatusBar extends SystemUI implements
.getNotificationShelfController(mStackScroller); .getNotificationShelfController(mStackScroller);
} }
@Override
public void onDensityOrFontScaleChanged() {
// TODO: Remove this.
if (mBrightnessMirrorController != null) {
mBrightnessMirrorController.onDensityOrFontScaleChanged();
}
// TODO: Bring these out of StatusBar.
mUserInfoControllerImpl.onDensityOrFontScaleChanged();
mUserSwitcherController.onDensityOrFontScaleChanged();
mNotificationIconAreaController.onDensityOrFontScaleChanged(mContext);
mHeadsUpManager.onDensityOrFontScaleChanged();
}
@Override
public void onThemeChanged() {
if (mStatusBarKeyguardViewManager != null) {
mStatusBarKeyguardViewManager.onThemeChanged();
}
if (mAmbientIndicationContainer instanceof AutoReinflateContainer) {
((AutoReinflateContainer) mAmbientIndicationContainer).inflateLayout();
}
mNotificationIconAreaController.onThemeChanged();
}
@Override
public void onOverlayChanged() {
if (mBrightnessMirrorController != null) {
mBrightnessMirrorController.onOverlayChanged();
}
// We need the new R.id.keyguard_indication_area before recreating
// mKeyguardIndicationController
mNotificationPanelViewController.onThemeChanged();
onThemeChanged();
}
@Override
public void onUiModeChanged() {
if (mBrightnessMirrorController != null) {
mBrightnessMirrorController.onUiModeChanged();
}
}
private void inflateStatusBarWindow() { private void inflateStatusBarWindow() {
mNotificationShadeWindowView = mSuperStatusBarViewFactory.getNotificationShadeWindowView(); mNotificationShadeWindowView = mSuperStatusBarViewFactory.getNotificationShadeWindowView();
StatusBarComponent statusBarComponent = mStatusBarComponentBuilder.get() StatusBarComponent statusBarComponent = mStatusBarComponentBuilder.get()
@@ -1858,10 +1982,6 @@ public class StatusBar extends SystemUI implements
return (mDisabled1 & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) != 0; return (mDisabled1 & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) != 0;
} }
protected H createHandler() {
return new StatusBar.H();
}
@Override @Override
public void startActivity(Intent intent, boolean onlyProvisioned, boolean dismissShade, public void startActivity(Intent intent, boolean onlyProvisioned, boolean dismissShade,
int flags) { int flags) {
@@ -1996,7 +2116,7 @@ public class StatusBar extends SystemUI implements
// We're delaying the showing, since most of the time the fullscreen app will // We're delaying the showing, since most of the time the fullscreen app will
// hide the icons again and we don't want them to fade in and out immediately again. // hide the icons again and we don't want them to fade in and out immediately again.
mWereIconsJustHidden = true; mWereIconsJustHidden = true;
mHandler.postDelayed(() -> { mMainExecutor.executeDelayed(() -> {
mWereIconsJustHidden = false; mWereIconsJustHidden = false;
mCommandQueue.recomputeDisableFlags(mDisplayId, true); mCommandQueue.recomputeDisableFlags(mDisplayId, true);
}, 500); }, 500);
@@ -2056,36 +2176,6 @@ public class StatusBar extends SystemUI implements
return isActivityIntent && KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation; return isActivityIntent && KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation;
} }
@Override
public boolean isOnKeyguard() {
return mKeyguardStateController.isShowing();
}
@Override
public void hideKeyguardWithAnimation(IRemoteAnimationRunner runner) {
// We post to the main thread for 2 reasons:
// 1. KeyguardViewMediator is not thread-safe.
// 2. To ensure that ViewMediatorCallback#keyguardDonePending is called before
// ViewMediatorCallback#readyForKeyguardDone. The wrong order could occur when doing
// dismissKeyguardThenExecute { hideKeyguardWithAnimation(runner) }.
mMainThreadHandler.post(() -> mKeyguardViewMediator.hideWithAnimation(runner));
}
@Override
public void setBlursDisabledForAppLaunch(boolean disabled) {
mKeyguardViewMediator.setBlursDisabledForAppLaunch(disabled);
}
@Override
public int getBackgroundColor(TaskInfo task) {
if (!mStartingSurfaceOptional.isPresent()) {
Log.w(TAG, "No starting surface, defaulting to SystemBGColor");
return SplashscreenContentDrawer.getSystemBGColor();
}
return mStartingSurfaceOptional.get().getBackgroundColor(task);
}
public boolean isDeviceInVrMode() { public boolean isDeviceInVrMode() {
return mPresenter.isDeviceInVrMode(); return mPresenter.isDeviceInVrMode();
} }
@@ -2099,37 +2189,19 @@ public class StatusBar extends SystemUI implements
mState = state; mState = state;
} }
/** static class KeyboardShortcutsData {
* All changes to the status bar and notifications funnel through here and are batched. final int mDeviceId;
*/
protected class H extends Handler {
H() {
super(Looper.myLooper());
}
@Override KeyboardShortcutsData(int deviceId) {
public void handleMessage(Message m) { mDeviceId = deviceId;
switch (m.what) { }
case MSG_TOGGLE_KEYBOARD_SHORTCUTS_MENU: }
toggleKeyboardShortcuts(m.arg1);
break; static class AnimateExpandSettingsPanelData {
case MSG_DISMISS_KEYBOARD_SHORTCUTS_MENU: final String mSubpanel;
dismissKeyboardShortcuts();
break; AnimateExpandSettingsPanelData(String subpanel) {
// End old BaseStatusBar.H handling. mSubpanel = subpanel;
case MSG_OPEN_NOTIFICATION_PANEL:
mCommandQueueCallbacks.animateExpandNotificationsPanel();
break;
case MSG_OPEN_SETTINGS_PANEL:
mCommandQueueCallbacks.animateExpandSettingsPanel((String) m.obj);
break;
case MSG_CLOSE_PANELS:
mShadeController.animateCollapsePanels();
break;
case MSG_LAUNCH_TRANSITION_TIMEOUT:
onLaunchTransitionTimeout();
break;
}
} }
} }
@@ -2171,27 +2243,17 @@ public class StatusBar extends SystemUI implements
} }
public void postAnimateCollapsePanels() { public void postAnimateCollapsePanels() {
mHandler.post(mShadeController::animateCollapsePanels); mMainExecutor.execute(mShadeController::animateCollapsePanels);
} }
public void postAnimateForceCollapsePanels() { public void postAnimateForceCollapsePanels() {
mHandler.post(() -> mShadeController.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, mMainExecutor.execute(
() -> mShadeController.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE,
true /* force */)); true /* force */));
} }
public void postAnimateOpenPanels() { public void postAnimateOpenPanels() {
mHandler.sendEmptyMessage(MSG_OPEN_SETTINGS_PANEL); mMessageRouter.sendMessage(MSG_OPEN_SETTINGS_PANEL);
}
/**
* Called by {@link ShadeController} when it calls
* {@link ShadeController#animateCollapsePanels(int, boolean, boolean, float)}.
*/
void postHideRecentApps() {
if (!mHandler.hasMessages(MSG_HIDE_RECENT_APPS)) {
mHandler.removeMessages(MSG_HIDE_RECENT_APPS);
mHandler.sendEmptyMessage(MSG_HIDE_RECENT_APPS);
}
} }
public boolean isExpandedVisible() { public boolean isExpandedVisible() {
@@ -2760,7 +2822,7 @@ public class StatusBar extends SystemUI implements
&& mStatusBarKeyguardViewManager.isOccluded()) { && mStatusBarKeyguardViewManager.isOccluded()) {
mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable); mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable);
} else { } else {
mHandler.post(runnable); mMainExecutor.execute(runnable);
} }
} }
if (dismissShade) { if (dismissShade) {
@@ -2772,7 +2834,7 @@ public class StatusBar extends SystemUI implements
// Do it after DismissAction has been processed to conserve the needed // Do it after DismissAction has been processed to conserve the needed
// ordering. // ordering.
mHandler.post(mShadeController::runPostCollapseRunnables); mMainExecutor.execute(mShadeController::runPostCollapseRunnables);
} }
} else if (StatusBar.this.isInLaunchTransition() } else if (StatusBar.this.isInLaunchTransition()
&& mNotificationPanelViewController.isLaunchTransitionFinished()) { && mNotificationPanelViewController.isLaunchTransitionFinished()) {
@@ -2781,7 +2843,7 @@ public class StatusBar extends SystemUI implements
// finished, // finished,
// so nobody will call readyForKeyguardDone anymore. Post it such that // so nobody will call readyForKeyguardDone anymore. Post it such that
// keyguardDonePending gets called first. // keyguardDonePending gets called first.
mHandler.post(mStatusBarKeyguardViewManager::readyForKeyguardDone); mMainExecutor.execute(mStatusBarKeyguardViewManager::readyForKeyguardDone);
} }
return deferred; return deferred;
} }
@@ -2820,8 +2882,8 @@ public class StatusBar extends SystemUI implements
mNotificationShadeWindowController.setNotTouchable(false); mNotificationShadeWindowController.setNotTouchable(false);
} }
if (mBubblesOptional.isPresent() && mBubblesOptional.get().isStackExpanded()) { if (mBubblesOptional.isPresent() && mBubblesOptional.get().isStackExpanded()) {
// Post to main thread handler, since updating the UI. // Post to main thread, since updating the UI.
mMainThreadHandler.post(() -> mBubblesOptional.get().collapseStack()); mMainExecutor.execute(() -> mBubblesOptional.get().collapseStack());
} }
finishBarAnimations(); finishBarAnimations();
resetUserExpandedStates(); resetUserExpandedStates();
@@ -2882,20 +2944,6 @@ public class StatusBar extends SystemUI implements
action.onDismiss(); action.onDismiss();
} }
} }
@Override
public void onConfigChanged(Configuration newConfig) {
updateResources();
updateDisplaySize(); // populates mDisplayMetrics
if (DEBUG) {
Log.v(TAG, "configuration changed: " + mContext.getResources().getConfiguration());
}
mViewHierarchyManager.updateRowStates();
mScreenPinningRequest.onConfigurationChanged();
}
/** /**
* Notify the shade controller that the current user changed * Notify the shade controller that the current user changed
* *
@@ -3045,10 +3093,10 @@ public class StatusBar extends SystemUI implements
@Override @Override
public void postQSRunnableDismissingKeyguard(final Runnable runnable) { public void postQSRunnableDismissingKeyguard(final Runnable runnable) {
mHandler.post(() -> { mMainExecutor.execute(() -> {
mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); mStatusBarStateController.setLeaveOpenOnKeyguardHide(true);
executeRunnableDismissingKeyguard(() -> mHandler.post(runnable), null, false, false, executeRunnableDismissingKeyguard(
false); () -> mMainExecutor.execute(runnable), null, false, false, false);
}); });
} }
@@ -3060,7 +3108,7 @@ public class StatusBar extends SystemUI implements
@Override @Override
public void postStartActivityDismissingKeyguard(final PendingIntent intent, public void postStartActivityDismissingKeyguard(final PendingIntent intent,
@Nullable ActivityLaunchAnimator.Controller animationController) { @Nullable ActivityLaunchAnimator.Controller animationController) {
mHandler.post(() -> startPendingIntentDismissingKeyguard(intent, mMainExecutor.execute(() -> startPendingIntentDismissingKeyguard(intent,
null /* intentSentUiThreadCallback */, animationController)); null /* intentSentUiThreadCallback */, animationController));
} }
@@ -3072,7 +3120,7 @@ public class StatusBar extends SystemUI implements
@Override @Override
public void postStartActivityDismissingKeyguard(Intent intent, int delay, public void postStartActivityDismissingKeyguard(Intent intent, int delay,
@Nullable ActivityLaunchAnimator.Controller animationController) { @Nullable ActivityLaunchAnimator.Controller animationController) {
mHandler.postDelayed( mMainExecutor.executeDelayed(
() -> () ->
startActivityDismissingKeyguard(intent, true /* onlyProvisioned */, startActivityDismissingKeyguard(intent, true /* onlyProvisioned */,
true /* dismissShade */, true /* dismissShade */,
@@ -3142,7 +3190,7 @@ public class StatusBar extends SystemUI implements
mNotificationPanelViewController.cancelAnimation(); mNotificationPanelViewController.cancelAnimation();
onLaunchTransitionFadingEnded(); onLaunchTransitionFadingEnded();
} }
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT); mMessageRouter.cancelMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
if (mUserSwitcherController != null && mUserSwitcherController.useFullscreenUserSwitcher()) { if (mUserSwitcherController != null && mUserSwitcherController.useFullscreenUserSwitcher()) {
mStatusBarStateController.setState(StatusBarState.FULLSCREEN_USER_SWITCHER); mStatusBarStateController.setState(StatusBarState.FULLSCREEN_USER_SWITCHER);
} else if (!mPulseExpansionHandler.isWakingToShadeLocked()) { } else if (!mPulseExpansionHandler.isWakingToShadeLocked()) {
@@ -3183,7 +3231,7 @@ public class StatusBar extends SystemUI implements
*/ */
public void fadeKeyguardAfterLaunchTransition(final Runnable beforeFading, public void fadeKeyguardAfterLaunchTransition(final Runnable beforeFading,
Runnable endRunnable) { Runnable endRunnable) {
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT); mMessageRouter.cancelMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
mLaunchTransitionEndRunnable = endRunnable; mLaunchTransitionEndRunnable = endRunnable;
Runnable hideRunnable = () -> { Runnable hideRunnable = () -> {
mKeyguardStateController.setLaunchTransitionFadingAway(true); mKeyguardStateController.setLaunchTransitionFadingAway(true);
@@ -3232,8 +3280,8 @@ public class StatusBar extends SystemUI implements
* because the launched app crashed or something else went wrong. * because the launched app crashed or something else went wrong.
*/ */
public void startLaunchTransitionTimeout() { public void startLaunchTransitionTimeout() {
mHandler.sendEmptyMessageDelayed(MSG_LAUNCH_TRANSITION_TIMEOUT, mMessageRouter.sendMessageDelayed(
LAUNCH_TRANSITION_TIMEOUT_MS); MSG_LAUNCH_TRANSITION_TIMEOUT, LAUNCH_TRANSITION_TIMEOUT_MS);
} }
private void onLaunchTransitionTimeout() { private void onLaunchTransitionTimeout() {
@@ -3288,7 +3336,7 @@ public class StatusBar extends SystemUI implements
if (mQSPanelController != null) { if (mQSPanelController != null) {
mQSPanelController.refreshAllTiles(); mQSPanelController.refreshAllTiles();
} }
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT); mMessageRouter.cancelMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
releaseGestureWakeLock(); releaseGestureWakeLock();
mNotificationPanelViewController.onAffordanceLaunchEnded(); mNotificationPanelViewController.onAffordanceLaunchEnded();
mNotificationPanelViewController.cancelAnimation(); mNotificationPanelViewController.cancelAnimation();
@@ -3516,69 +3564,7 @@ public class StatusBar extends SystemUI implements
mNotificationPanelViewController.collapseWithDuration(duration); mNotificationPanelViewController.collapseWithDuration(duration);
} }
@Override
public void onStatePreChange(int oldState, int newState) {
// If we're visible and switched to SHADE_LOCKED (the user dragged
// down on the lockscreen), clear notification LED, vibration,
// ringing.
// Other transitions are covered in handleVisibleToUserChanged().
if (mVisible && (newState == StatusBarState.SHADE_LOCKED
|| mStatusBarStateController.goingToFullShade())) {
clearNotificationEffects();
}
if (newState == StatusBarState.KEYGUARD) {
mRemoteInputManager.onPanelCollapsed();
maybeEscalateHeadsUp();
}
}
@Override
public void onStateChanged(int newState) {
mState = newState;
updateReportRejectedTouchVisibility();
mDozeServiceHost.updateDozing();
updateTheme();
mNavigationBarController.touchAutoDim(mDisplayId);
Trace.beginSection("StatusBar#updateKeyguardState");
if (mState == StatusBarState.KEYGUARD && mStatusBarView != null) {
mStatusBarView.removePendingHideExpandedRunnables();
}
updateDozingState();
checkBarModes();
updateScrimController();
mPresenter.updateMediaMetaData(false, mState != StatusBarState.KEYGUARD);
updateKeyguardState();
Trace.endSection();
}
@Override
public void onDozeAmountChanged(float linear, float eased) {
if (mFeatureFlags.useNewLockscreenAnimations()
&& !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) {
mLightRevealScrim.setRevealAmount(1f - linear);
}
}
@Override
public void onDozingChanged(boolean isDozing) {
Trace.beginSection("StatusBar#updateDozing");
mDozing = isDozing;
// Collapse the notification panel if open
boolean dozingAnimated = mDozeServiceHost.getDozingRequested()
&& mDozeParameters.shouldControlScreenOff();
mNotificationPanelViewController.resetViews(dozingAnimated);
updateQsExpansionEnabled();
mKeyguardViewMediator.setDozing(mDozing);
mNotificationsController.requestNotificationUpdate("onDozingChanged");
updateDozingState();
mDozeServiceHost.updateDozing();
updateScrimController();
updateReportRejectedTouchVisibility();
Trace.endSection();
}
/** /**
* Updates the light reveal effect to reflect the reason we're waking or sleeping (for example, * Updates the light reveal effect to reflect the reason we're waking or sleeping (for example,
@@ -3720,7 +3706,7 @@ public class StatusBar extends SystemUI implements
// This gets executed before we will show Keyguard, so post it in order that the state // This gets executed before we will show Keyguard, so post it in order that the state
// is correct. // is correct.
mHandler.post(() -> mCommandQueueCallbacks.onCameraLaunchGestureDetected( mMainExecutor.execute(() -> mCommandQueueCallbacks.onCameraLaunchGestureDetected(
mLastCameraLaunchSource)); mLastCameraLaunchSource));
} }
@@ -3729,7 +3715,7 @@ public class StatusBar extends SystemUI implements
// This gets executed before we will show Keyguard, so post it in order that the // This gets executed before we will show Keyguard, so post it in order that the
// state is correct. // state is correct.
mHandler.post( mMainExecutor.execute(
() -> mCommandQueueCallbacks.onEmergencyActionLaunchGestureDetected()); () -> mCommandQueueCallbacks.onEmergencyActionLaunchGestureDetected());
} }
updateIsKeyguard(); updateIsKeyguard();
@@ -4198,7 +4184,7 @@ public class StatusBar extends SystemUI implements
} }
private void postOnUiThread(Runnable runnable) { private void postOnUiThread(Runnable runnable) {
mMainThreadHandler.post(runnable); mMainExecutor.execute(runnable);
} }
/** /**

View File

@@ -255,19 +255,9 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks {
} }
} }
@Override
public void preloadRecentApps() {
mStatusBar.resetHandlerMsg(StatusBar.MSG_PRELOAD_RECENT_APPS);
}
@Override
public void cancelPreloadRecentApps() {
mStatusBar.resetHandlerMsg(StatusBar.MSG_CANCEL_PRELOAD_RECENT_APPS);
}
@Override @Override
public void dismissKeyboardShortcutsMenu() { public void dismissKeyboardShortcutsMenu() {
mStatusBar.resetHandlerMsg(StatusBar.MSG_DISMISS_KEYBOARD_SHORTCUTS_MENU); mStatusBar.resendMessage(StatusBar.MSG_DISMISS_KEYBOARD_SHORTCUTS_MENU);
} }
/** /**
* State is one or more of the DISABLE constants from StatusBarManager. * State is one or more of the DISABLE constants from StatusBarManager.
@@ -330,13 +320,6 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks {
} }
} }
if ((diff1 & StatusBarManager.DISABLE_RECENT) != 0) {
if ((state1 & StatusBarManager.DISABLE_RECENT) != 0) {
// close recents if it's visible
mStatusBar.resetHandlerMsg(StatusBar.MSG_HIDE_RECENT_APPS);
}
}
if ((diff1 & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) != 0) { if ((diff1 & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) != 0) {
if (mStatusBar.areNotificationAlertsDisabled()) { if (mStatusBar.areNotificationAlertsDisabled()) {
mHeadsUpManager.releaseAllImmediately(); mHeadsUpManager.releaseAllImmediately();
@@ -544,9 +527,7 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks {
@Override @Override
public void toggleKeyboardShortcutsMenu(int deviceId) { public void toggleKeyboardShortcutsMenu(int deviceId) {
int msg = StatusBar.MSG_TOGGLE_KEYBOARD_SHORTCUTS_MENU; mStatusBar.resendMessage(new StatusBar.KeyboardShortcutsData(deviceId));
mStatusBar.getHandler().removeMessages(msg);
mStatusBar.getHandler().obtainMessage(msg, deviceId, 0).sendToTarget();
} }
@Override @Override

View File

@@ -33,6 +33,7 @@ import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.demomode.DemoModeController; import com.android.systemui.demomode.DemoModeController;
import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.FeatureFlags;
@@ -103,6 +104,8 @@ import com.android.systemui.statusbar.policy.UserInfoControllerImpl;
import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService;
import com.android.systemui.unfold.UnfoldLightRevealOverlayAnimation; import com.android.systemui.unfold.UnfoldLightRevealOverlayAnimation;
import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.concurrency.MessageRouter;
import com.android.systemui.volume.VolumeComponent; import com.android.systemui.volume.VolumeComponent;
import com.android.systemui.wmshell.BubblesManager; import com.android.systemui.wmshell.BubblesManager;
import com.android.unfold.config.UnfoldTransitionConfig; import com.android.unfold.config.UnfoldTransitionConfig;
@@ -217,6 +220,9 @@ public interface StatusBarPhoneModule {
LockscreenShadeTransitionController transitionController, LockscreenShadeTransitionController transitionController,
FeatureFlags featureFlags, FeatureFlags featureFlags,
KeyguardUnlockAnimationController keyguardUnlockAnimationController, KeyguardUnlockAnimationController keyguardUnlockAnimationController,
@Main Handler mainHandler,
@Main DelayableExecutor delayableExecutor,
@Main MessageRouter messageRouter,
WallpaperManager wallpaperManager, WallpaperManager wallpaperManager,
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController, UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
Optional<StartingSurface> startingSurfaceOptional, Optional<StartingSurface> startingSurfaceOptional,
@@ -307,6 +313,9 @@ public interface StatusBarPhoneModule {
transitionController, transitionController,
featureFlags, featureFlags,
keyguardUnlockAnimationController, keyguardUnlockAnimationController,
mainHandler,
delayableExecutor,
messageRouter,
wallpaperManager, wallpaperManager,
unlockedScreenOffAnimationController, unlockedScreenOffAnimationController,
startingSurfaceOptional, startingSurfaceOptional,

View File

@@ -141,6 +141,7 @@ import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService;
import com.android.systemui.unfold.UnfoldLightRevealOverlayAnimation; import com.android.systemui.unfold.UnfoldLightRevealOverlayAnimation;
import com.android.systemui.util.concurrency.FakeExecutor; import com.android.systemui.util.concurrency.FakeExecutor;
import com.android.systemui.util.concurrency.MessageRouterImpl;
import com.android.systemui.util.time.FakeSystemClock; import com.android.systemui.util.time.FakeSystemClock;
import com.android.systemui.volume.VolumeComponent; import com.android.systemui.volume.VolumeComponent;
import com.android.systemui.wmshell.BubblesManager; import com.android.systemui.wmshell.BubblesManager;
@@ -271,7 +272,9 @@ public class StatusBarTest extends SysuiTestCase {
@Mock private OperatorNameViewController mOperatorNameViewController; @Mock private OperatorNameViewController mOperatorNameViewController;
@Mock private OperatorNameViewController.Factory mOperatorNameViewControllerFactory; @Mock private OperatorNameViewController.Factory mOperatorNameViewControllerFactory;
private ShadeController mShadeController; private ShadeController mShadeController;
private FakeExecutor mUiBgExecutor = new FakeExecutor(new FakeSystemClock()); private final FakeSystemClock mFakeSystemClock = new FakeSystemClock();
private FakeExecutor mMainExecutor = new FakeExecutor(mFakeSystemClock);
private FakeExecutor mUiBgExecutor = new FakeExecutor(mFakeSystemClock);
private InitController mInitController = new InitController(); private InitController mInitController = new InitController();
@Before @Before
@@ -436,6 +439,9 @@ public class StatusBarTest extends SysuiTestCase {
mLockscreenTransitionController, mLockscreenTransitionController,
mFeatureFlags, mFeatureFlags,
mKeyguardUnlockAnimationController, mKeyguardUnlockAnimationController,
new Handler(TestableLooper.get(this).getLooper()),
mMainExecutor,
new MessageRouterImpl(mMainExecutor),
mWallpaperManager, mWallpaperManager,
mUnlockedScreenOffAnimationController, mUnlockedScreenOffAnimationController,
Optional.of(mStartingSurface), Optional.of(mStartingSurface),
@@ -702,7 +708,7 @@ public class StatusBarTest extends SysuiTestCase {
} catch (RemoteException e) { } catch (RemoteException e) {
fail(); fail();
} }
TestableLooper.get(this).processAllMessages(); mMainExecutor.runAllReady();
} }
@Test @Test
@@ -721,7 +727,7 @@ public class StatusBarTest extends SysuiTestCase {
} catch (RemoteException e) { } catch (RemoteException e) {
fail(); fail();
} }
TestableLooper.get(this).processAllMessages(); mMainExecutor.runAllReady();
} }
@Test @Test
@@ -739,7 +745,7 @@ public class StatusBarTest extends SysuiTestCase {
} catch (RemoteException e) { } catch (RemoteException e) {
fail(); fail();
} }
TestableLooper.get(this).processAllMessages(); mMainExecutor.runAllReady();
} }
@Test @Test
@@ -753,15 +759,6 @@ public class StatusBarTest extends SysuiTestCase {
new PrintWriter(new ByteArrayOutputStream()), "var", /* transitions= */ null); new PrintWriter(new ByteArrayOutputStream()), "var", /* transitions= */ null);
} }
@Test
@RunWithLooper(setAsMainLooper = true)
public void testUpdateKeyguardState_DoesNotCrash() {
mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD);
when(mLockscreenUserManager.getCurrentProfiles()).thenReturn(
new SparseArray<>());
mStatusBar.onStateChanged(StatusBarState.SHADE);
}
@Test @Test
public void testFingerprintNotification_UpdatesScrims() { public void testFingerprintNotification_UpdatesScrims() {
mStatusBar.notifyBiometricAuthModeChanged(); mStatusBar.notifyBiometricAuthModeChanged();