Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +2 −9 Original line number Diff line number Diff line Loading @@ -207,12 +207,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi /** Whether or not the BubbleStackView has been added to the WindowManager. */ private boolean mAddedToWindowManager = false; /** * Value from {@link NotificationShadeWindowController#getForceHasTopUi()} when we forced top UI * due to expansion. We'll restore this value when the stack collapses. */ private boolean mHadTopUi = false; // Listens to user switch so bubbles can be saved and restored. private final NotificationLockscreenUserManager mNotifUserManager; Loading Loading @@ -1303,7 +1297,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi // Collapsing? Do this first before remaining steps. if (update.expandedChanged && !update.expanded) { mStackView.setExpanded(false); mNotificationShadeWindowController.setForceHasTopUi(mHadTopUi); mNotificationShadeWindowController.setRequestTopUi(false, TAG); } // Do removals, if any. Loading Loading @@ -1393,8 +1387,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi if (update.expandedChanged && update.expanded) { if (mStackView != null) { mStackView.setExpanded(true); mHadTopUi = mNotificationShadeWindowController.getForceHasTopUi(); mNotificationShadeWindowController.setForceHasTopUi(true); mNotificationShadeWindowController.setRequestTopUi(true, TAG); } } Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +2 −4 Original line number Diff line number Diff line Loading @@ -2129,7 +2129,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private boolean mShowing; private float mScrimAlpha; private ResetOrientationData mResetOrientationData; private boolean mHadTopUi; private final NotificationShadeWindowController mNotificationShadeWindowController; private final NotificationShadeDepthController mDepthController; private final SysUiState mSysUiState; Loading Loading @@ -2397,8 +2396,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, public void show() { super.show(); mShowing = true; mHadTopUi = mNotificationShadeWindowController.getForceHasTopUi(); mNotificationShadeWindowController.setForceHasTopUi(true); mNotificationShadeWindowController.setRequestTopUi(true, TAG); mSysUiState.setFlag(SYSUI_STATE_GLOBAL_ACTIONS_SHOWING, true) .commitUpdate(mContext.getDisplayId()); Loading Loading @@ -2499,7 +2497,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, dismissOverflow(true); dismissPowerOptions(true); if (mControlsUiController != null) mControlsUiController.hide(); mNotificationShadeWindowController.setForceHasTopUi(mHadTopUi); mNotificationShadeWindowController.setRequestTopUi(false, TAG); mDepthController.updateGlobalDialogVisibility(0, null /* view */); mSysUiState.setFlag(SYSUI_STATE_GLOBAL_ACTIONS_SHOWING, false) .commitUpdate(mContext.getDisplayId()); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowController.java +15 −8 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ import java.lang.ref.WeakReference; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.function.Consumer; import javax.inject.Inject; Loading Loading @@ -432,7 +434,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable, } private void applyHasTopUi(State state) { mHasTopUiChanged = state.mForceHasTopUi || isExpanded(state); mHasTopUiChanged = !state.mComponentsForcingTopUi.isEmpty() || isExpanded(state); } private void applyNotTouchable(State state) { Loading Loading @@ -635,12 +637,17 @@ public class NotificationShadeWindowController implements Callback, Dumpable, apply(mCurrentState); } public boolean getForceHasTopUi() { return mCurrentState.mForceHasTopUi; /** * SystemUI may need top-ui to avoid jank when performing animations. After the * animation is performed, the component should remove itself from the list of features that * are forcing SystemUI to be top-ui. */ public void setRequestTopUi(boolean requestTopUi, String componentTag) { if (requestTopUi) { mCurrentState.mComponentsForcingTopUi.add(componentTag); } else { mCurrentState.mComponentsForcingTopUi.remove(componentTag); } public void setForceHasTopUi(boolean forceHasTopUi) { mCurrentState.mForceHasTopUi = forceHasTopUi; apply(mCurrentState); } Loading @@ -663,7 +670,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable, boolean mBackdropShowing; boolean mWallpaperSupportsAmbientMode; boolean mNotTouchable; boolean mForceHasTopUi; Set<String> mComponentsForcingTopUi = new HashSet<>(); /** * The {@link StatusBar} state from the status bar. Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +14 −2 Original line number Diff line number Diff line Loading @@ -213,7 +213,6 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BatteryController.BatteryStateChangeCallback; import com.android.systemui.statusbar.policy.BrightnessMirrorController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; Loading Loading @@ -2397,18 +2396,31 @@ public class StatusBar extends SystemUI implements DemoMode, new WirelessChargingAnimation.Callback() { @Override public void onAnimationStarting() { mNotificationShadeWindowController.setRequestTopUi(true, TAG); CrossFadeHelper.fadeOut(mNotificationPanelViewController.getView(), 1); } @Override public void onAnimationEnded() { CrossFadeHelper.fadeIn(mNotificationPanelViewController.getView()); mNotificationShadeWindowController.setRequestTopUi(false, TAG); } }, mDozing).show(animationDelay); } else { // workspace WirelessChargingAnimation.makeWirelessChargingAnimation(mContext, null, transmittingBatteryLevel, batteryLevel, null, false).show(animationDelay); transmittingBatteryLevel, batteryLevel, new WirelessChargingAnimation.Callback() { @Override public void onAnimationStarting() { mNotificationShadeWindowController.setRequestTopUi(true, TAG); } @Override public void onAnimationEnded() { mNotificationShadeWindowController.setRequestTopUi(false, TAG); } }, false).show(animationDelay); } } Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +2 −9 Original line number Diff line number Diff line Loading @@ -207,12 +207,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi /** Whether or not the BubbleStackView has been added to the WindowManager. */ private boolean mAddedToWindowManager = false; /** * Value from {@link NotificationShadeWindowController#getForceHasTopUi()} when we forced top UI * due to expansion. We'll restore this value when the stack collapses. */ private boolean mHadTopUi = false; // Listens to user switch so bubbles can be saved and restored. private final NotificationLockscreenUserManager mNotifUserManager; Loading Loading @@ -1303,7 +1297,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi // Collapsing? Do this first before remaining steps. if (update.expandedChanged && !update.expanded) { mStackView.setExpanded(false); mNotificationShadeWindowController.setForceHasTopUi(mHadTopUi); mNotificationShadeWindowController.setRequestTopUi(false, TAG); } // Do removals, if any. Loading Loading @@ -1393,8 +1387,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi if (update.expandedChanged && update.expanded) { if (mStackView != null) { mStackView.setExpanded(true); mHadTopUi = mNotificationShadeWindowController.getForceHasTopUi(); mNotificationShadeWindowController.setForceHasTopUi(true); mNotificationShadeWindowController.setRequestTopUi(true, TAG); } } Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +2 −4 Original line number Diff line number Diff line Loading @@ -2129,7 +2129,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private boolean mShowing; private float mScrimAlpha; private ResetOrientationData mResetOrientationData; private boolean mHadTopUi; private final NotificationShadeWindowController mNotificationShadeWindowController; private final NotificationShadeDepthController mDepthController; private final SysUiState mSysUiState; Loading Loading @@ -2397,8 +2396,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, public void show() { super.show(); mShowing = true; mHadTopUi = mNotificationShadeWindowController.getForceHasTopUi(); mNotificationShadeWindowController.setForceHasTopUi(true); mNotificationShadeWindowController.setRequestTopUi(true, TAG); mSysUiState.setFlag(SYSUI_STATE_GLOBAL_ACTIONS_SHOWING, true) .commitUpdate(mContext.getDisplayId()); Loading Loading @@ -2499,7 +2497,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, dismissOverflow(true); dismissPowerOptions(true); if (mControlsUiController != null) mControlsUiController.hide(); mNotificationShadeWindowController.setForceHasTopUi(mHadTopUi); mNotificationShadeWindowController.setRequestTopUi(false, TAG); mDepthController.updateGlobalDialogVisibility(0, null /* view */); mSysUiState.setFlag(SYSUI_STATE_GLOBAL_ACTIONS_SHOWING, false) .commitUpdate(mContext.getDisplayId()); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowController.java +15 −8 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ import java.lang.ref.WeakReference; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.function.Consumer; import javax.inject.Inject; Loading Loading @@ -432,7 +434,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable, } private void applyHasTopUi(State state) { mHasTopUiChanged = state.mForceHasTopUi || isExpanded(state); mHasTopUiChanged = !state.mComponentsForcingTopUi.isEmpty() || isExpanded(state); } private void applyNotTouchable(State state) { Loading Loading @@ -635,12 +637,17 @@ public class NotificationShadeWindowController implements Callback, Dumpable, apply(mCurrentState); } public boolean getForceHasTopUi() { return mCurrentState.mForceHasTopUi; /** * SystemUI may need top-ui to avoid jank when performing animations. After the * animation is performed, the component should remove itself from the list of features that * are forcing SystemUI to be top-ui. */ public void setRequestTopUi(boolean requestTopUi, String componentTag) { if (requestTopUi) { mCurrentState.mComponentsForcingTopUi.add(componentTag); } else { mCurrentState.mComponentsForcingTopUi.remove(componentTag); } public void setForceHasTopUi(boolean forceHasTopUi) { mCurrentState.mForceHasTopUi = forceHasTopUi; apply(mCurrentState); } Loading @@ -663,7 +670,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable, boolean mBackdropShowing; boolean mWallpaperSupportsAmbientMode; boolean mNotTouchable; boolean mForceHasTopUi; Set<String> mComponentsForcingTopUi = new HashSet<>(); /** * The {@link StatusBar} state from the status bar. Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +14 −2 Original line number Diff line number Diff line Loading @@ -213,7 +213,6 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BatteryController.BatteryStateChangeCallback; import com.android.systemui.statusbar.policy.BrightnessMirrorController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; Loading Loading @@ -2397,18 +2396,31 @@ public class StatusBar extends SystemUI implements DemoMode, new WirelessChargingAnimation.Callback() { @Override public void onAnimationStarting() { mNotificationShadeWindowController.setRequestTopUi(true, TAG); CrossFadeHelper.fadeOut(mNotificationPanelViewController.getView(), 1); } @Override public void onAnimationEnded() { CrossFadeHelper.fadeIn(mNotificationPanelViewController.getView()); mNotificationShadeWindowController.setRequestTopUi(false, TAG); } }, mDozing).show(animationDelay); } else { // workspace WirelessChargingAnimation.makeWirelessChargingAnimation(mContext, null, transmittingBatteryLevel, batteryLevel, null, false).show(animationDelay); transmittingBatteryLevel, batteryLevel, new WirelessChargingAnimation.Callback() { @Override public void onAnimationStarting() { mNotificationShadeWindowController.setRequestTopUi(true, TAG); } @Override public void onAnimationEnded() { mNotificationShadeWindowController.setRequestTopUi(false, TAG); } }, false).show(animationDelay); } } Loading