Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +32 −6 Original line number Diff line number Diff line Loading @@ -393,6 +393,9 @@ public final class NotificationPanelViewController implements Dumpable { private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; private int mQsTrackingPointer; private VelocityTracker mQsVelocityTracker; private TrackingStartedListener mTrackingStartedListener; private OpenCloseListener mOpenCloseListener; private GestureRecorder mGestureRecorder; private boolean mQsTracking; /** Whether the ongoing gesture might both trigger the expansion in both the view and QS. */ private boolean mConflictingQsExpansionGesture; Loading Loading @@ -1362,6 +1365,14 @@ public final class NotificationPanelViewController implements Dumpable { mKeyguardIndicationController.setIndicationArea(mKeyguardBottomArea); } void setOpenCloseListener(OpenCloseListener openCloseListener) { mOpenCloseListener = openCloseListener; } void setTrackingStartedListener(TrackingStartedListener trackingStartedListener) { mTrackingStartedListener = trackingStartedListener; } private void updateGestureExclusionRect() { Rect exclusionRect = calculateGestureExclusionRect(); mView.setSystemGestureExclusionRects(exclusionRect.isEmpty() ? Collections.emptyList() Loading Loading @@ -1936,9 +1947,9 @@ public final class NotificationPanelViewController implements Dumpable { } private void fling(float vel) { GestureRecorder gr = mCentralSurfaces.getGestureRecorder(); if (gr != null) { gr.tag("fling " + ((vel > 0) ? "open" : "closed"), "notifications,v=" + vel); if (mGestureRecorder != null) { mGestureRecorder.tag("fling " + ((vel > 0) ? "open" : "closed"), "notifications,v=" + vel); } fling(vel, true, 1.0f /* collapseSpeedUpFactor */, false); } Loading Loading @@ -3726,7 +3737,7 @@ public final class NotificationPanelViewController implements Dumpable { mFalsingCollector.onTrackingStarted(!mKeyguardStateController.canDismissLockScreen()); endClosing(); mTracking = true; mCentralSurfaces.onTrackingStarted(); mTrackingStartedListener.onTrackingStarted(); notifyExpandingStarted(); updatePanelExpansionAndVisibility(); mScrimController.onTrackingStarted(); Loading Loading @@ -3960,7 +3971,7 @@ public final class NotificationPanelViewController implements Dumpable { } private void onClosingFinished() { mCentralSurfaces.onClosingFinished(); mOpenCloseListener.onClosingFinished(); setClosingWithAlphaFadeout(false); mMediaHierarchyManager.closeGuts(); } Loading Loading @@ -4519,11 +4530,13 @@ public final class NotificationPanelViewController implements Dumpable { */ public void initDependencies( CentralSurfaces centralSurfaces, GestureRecorder recorder, Runnable hideExpandedRunnable, NotificationShelfController notificationShelfController) { // TODO(b/254859580): this can be injected. mCentralSurfaces = centralSurfaces; mGestureRecorder = recorder; mHideExpandedRunnable = hideExpandedRunnable; mNotificationStackScrollLayoutController.setShelfController(notificationShelfController); mNotificationShelfController = notificationShelfController; Loading Loading @@ -5772,7 +5785,7 @@ public final class NotificationPanelViewController implements Dumpable { if (mSplitShadeEnabled && !isOnKeyguard()) { setQsExpandImmediate(true); } mCentralSurfaces.makeExpandedVisible(false); mOpenCloseListener.onOpenStarted(); } if (state == STATE_CLOSED) { setQsExpandImmediate(false); Loading Loading @@ -6255,4 +6268,17 @@ public final class NotificationPanelViewController implements Dumpable { return super.performAccessibilityAction(host, action, args); } } /** Listens for when touch tracking begins. */ interface TrackingStartedListener { void onTrackingStarted(); } /** Listens for when shade begins opening of finishes closing. */ interface OpenCloseListener { /** Called when the shade finishes closing. */ void onClosingFinished(); /** Called when the shade starts opening. */ void onOpenStarted(); } } packages/SystemUI/src/com/android/systemui/shade/ShadeController.java +3 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,9 @@ public interface ShadeController { /** Handle status bar touch event. */ void onStatusBarTouch(MotionEvent event); /** Called when the shade finishes collapsing. */ void onClosingFinished(); /** Sets the listener for when the visibility of the shade changes. */ void setVisibilityListener(ShadeVisibilityListener listener); Loading packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java +23 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,16 @@ public final class ShadeControllerImpl implements ShadeController { } } @Override public void onClosingFinished() { runPostCollapseRunnables(); if (!mPresenter.isPresenterFullyCollapsed()) { // if we set it not to be focusable when collapsing, we have to undo it when we aborted // the closing mNotificationShadeWindowController.setNotificationShadeFocusable(true); } } @Override public void instantCollapseShade() { mNotificationPanelViewController.instantCollapse(); Loading Loading @@ -329,5 +339,18 @@ public final class ShadeControllerImpl implements ShadeController { public void setNotificationPanelViewController( NotificationPanelViewController notificationPanelViewController) { mNotificationPanelViewController = notificationPanelViewController; mNotificationPanelViewController.setTrackingStartedListener(this::runPostCollapseRunnables); mNotificationPanelViewController.setOpenCloseListener( new NotificationPanelViewController.OpenCloseListener() { @Override public void onClosingFinished() { ShadeControllerImpl.this.onClosingFinished(); } @Override public void onOpenStarted() { makeExpandedVisible(false); } }); } } packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +0 −14 Original line number Diff line number Diff line Loading @@ -51,7 +51,6 @@ import com.android.systemui.qs.QSPanelController; import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowView; import com.android.systemui.shade.NotificationShadeWindowViewController; import com.android.systemui.statusbar.GestureRecorder; import com.android.systemui.statusbar.LightRevealScrim; import com.android.systemui.statusbar.NotificationPresenter; Loading Loading @@ -286,8 +285,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn void onTouchEvent(MotionEvent event); GestureRecorder getGestureRecorder(); BiometricUnlockController getBiometricUnlockController(); void showWirelessChargingAnimation(int batteryLevel); Loading Loading @@ -402,10 +399,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn LightRevealScrim getLightRevealScrim(); void onTrackingStarted(); void onClosingFinished(); // TODO: Figure out way to remove these. NavigationBarView getNavigationBarView(); Loading Loading @@ -489,13 +482,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn void updateNotificationPanelTouchState(); /** * TODO(b/257041702) delete this * @deprecated Use ShadeController#makeExpandedVisible */ @Deprecated void makeExpandedVisible(boolean force); int getDisplayId(); int getRotation(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +3 −28 Original line number Diff line number Diff line Loading @@ -1257,6 +1257,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mNotificationPanelViewController.initDependencies( this, mGestureRec, mShadeController::makeExpandedInvisible, mNotificationShelfController); Loading Loading @@ -1855,7 +1856,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { public void onLaunchAnimationCancelled(boolean isLaunchForActivity) { if (mPresenter.isPresenterFullyCollapsed() && !mPresenter.isCollapsing() && isLaunchForActivity) { onClosingFinished(); mShadeController.onClosingFinished(); } else { mShadeController.collapseShade(true /* animate */); } Loading @@ -1865,7 +1866,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { @Override public void onLaunchAnimationEnd(boolean launchIsFullScreen) { if (!mPresenter.isCollapsing()) { onClosingFinished(); mShadeController.onClosingFinished(); } if (launchIsFullScreen) { mShadeController.instantCollapseShade(); Loading Loading @@ -2051,11 +2052,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } } @Override public GestureRecorder getGestureRecorder() { return mGestureRec; } @Override public BiometricUnlockController getBiometricUnlockController() { return mBiometricUnlockController; Loading Loading @@ -3338,21 +3334,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { return mLightRevealScrim; } @Override public void onTrackingStarted() { mShadeController.runPostCollapseRunnables(); } @Override public void onClosingFinished() { mShadeController.runPostCollapseRunnables(); if (!mPresenter.isPresenterFullyCollapsed()) { // if we set it not to be focusable when collapsing, we have to undo it when we aborted // the closing mNotificationShadeWindowController.setNotificationShadeFocusable(true); } } // TODO: Figure out way to remove these. @Override public NavigationBarView getNavigationBarView() { Loading Loading @@ -3584,12 +3565,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mNotificationIconAreaController.setAnimationsEnabled(!disabled); } //TODO(b/257041702) delete @Override public void makeExpandedVisible(boolean force) { mShadeController.makeExpandedVisible(force); } final ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() { @Override public void onScreenTurningOn(Runnable onDrawn) { Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +32 −6 Original line number Diff line number Diff line Loading @@ -393,6 +393,9 @@ public final class NotificationPanelViewController implements Dumpable { private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; private int mQsTrackingPointer; private VelocityTracker mQsVelocityTracker; private TrackingStartedListener mTrackingStartedListener; private OpenCloseListener mOpenCloseListener; private GestureRecorder mGestureRecorder; private boolean mQsTracking; /** Whether the ongoing gesture might both trigger the expansion in both the view and QS. */ private boolean mConflictingQsExpansionGesture; Loading Loading @@ -1362,6 +1365,14 @@ public final class NotificationPanelViewController implements Dumpable { mKeyguardIndicationController.setIndicationArea(mKeyguardBottomArea); } void setOpenCloseListener(OpenCloseListener openCloseListener) { mOpenCloseListener = openCloseListener; } void setTrackingStartedListener(TrackingStartedListener trackingStartedListener) { mTrackingStartedListener = trackingStartedListener; } private void updateGestureExclusionRect() { Rect exclusionRect = calculateGestureExclusionRect(); mView.setSystemGestureExclusionRects(exclusionRect.isEmpty() ? Collections.emptyList() Loading Loading @@ -1936,9 +1947,9 @@ public final class NotificationPanelViewController implements Dumpable { } private void fling(float vel) { GestureRecorder gr = mCentralSurfaces.getGestureRecorder(); if (gr != null) { gr.tag("fling " + ((vel > 0) ? "open" : "closed"), "notifications,v=" + vel); if (mGestureRecorder != null) { mGestureRecorder.tag("fling " + ((vel > 0) ? "open" : "closed"), "notifications,v=" + vel); } fling(vel, true, 1.0f /* collapseSpeedUpFactor */, false); } Loading Loading @@ -3726,7 +3737,7 @@ public final class NotificationPanelViewController implements Dumpable { mFalsingCollector.onTrackingStarted(!mKeyguardStateController.canDismissLockScreen()); endClosing(); mTracking = true; mCentralSurfaces.onTrackingStarted(); mTrackingStartedListener.onTrackingStarted(); notifyExpandingStarted(); updatePanelExpansionAndVisibility(); mScrimController.onTrackingStarted(); Loading Loading @@ -3960,7 +3971,7 @@ public final class NotificationPanelViewController implements Dumpable { } private void onClosingFinished() { mCentralSurfaces.onClosingFinished(); mOpenCloseListener.onClosingFinished(); setClosingWithAlphaFadeout(false); mMediaHierarchyManager.closeGuts(); } Loading Loading @@ -4519,11 +4530,13 @@ public final class NotificationPanelViewController implements Dumpable { */ public void initDependencies( CentralSurfaces centralSurfaces, GestureRecorder recorder, Runnable hideExpandedRunnable, NotificationShelfController notificationShelfController) { // TODO(b/254859580): this can be injected. mCentralSurfaces = centralSurfaces; mGestureRecorder = recorder; mHideExpandedRunnable = hideExpandedRunnable; mNotificationStackScrollLayoutController.setShelfController(notificationShelfController); mNotificationShelfController = notificationShelfController; Loading Loading @@ -5772,7 +5785,7 @@ public final class NotificationPanelViewController implements Dumpable { if (mSplitShadeEnabled && !isOnKeyguard()) { setQsExpandImmediate(true); } mCentralSurfaces.makeExpandedVisible(false); mOpenCloseListener.onOpenStarted(); } if (state == STATE_CLOSED) { setQsExpandImmediate(false); Loading Loading @@ -6255,4 +6268,17 @@ public final class NotificationPanelViewController implements Dumpable { return super.performAccessibilityAction(host, action, args); } } /** Listens for when touch tracking begins. */ interface TrackingStartedListener { void onTrackingStarted(); } /** Listens for when shade begins opening of finishes closing. */ interface OpenCloseListener { /** Called when the shade finishes closing. */ void onClosingFinished(); /** Called when the shade starts opening. */ void onOpenStarted(); } }
packages/SystemUI/src/com/android/systemui/shade/ShadeController.java +3 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,9 @@ public interface ShadeController { /** Handle status bar touch event. */ void onStatusBarTouch(MotionEvent event); /** Called when the shade finishes collapsing. */ void onClosingFinished(); /** Sets the listener for when the visibility of the shade changes. */ void setVisibilityListener(ShadeVisibilityListener listener); Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java +23 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,16 @@ public final class ShadeControllerImpl implements ShadeController { } } @Override public void onClosingFinished() { runPostCollapseRunnables(); if (!mPresenter.isPresenterFullyCollapsed()) { // if we set it not to be focusable when collapsing, we have to undo it when we aborted // the closing mNotificationShadeWindowController.setNotificationShadeFocusable(true); } } @Override public void instantCollapseShade() { mNotificationPanelViewController.instantCollapse(); Loading Loading @@ -329,5 +339,18 @@ public final class ShadeControllerImpl implements ShadeController { public void setNotificationPanelViewController( NotificationPanelViewController notificationPanelViewController) { mNotificationPanelViewController = notificationPanelViewController; mNotificationPanelViewController.setTrackingStartedListener(this::runPostCollapseRunnables); mNotificationPanelViewController.setOpenCloseListener( new NotificationPanelViewController.OpenCloseListener() { @Override public void onClosingFinished() { ShadeControllerImpl.this.onClosingFinished(); } @Override public void onOpenStarted() { makeExpandedVisible(false); } }); } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +0 −14 Original line number Diff line number Diff line Loading @@ -51,7 +51,6 @@ import com.android.systemui.qs.QSPanelController; import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowView; import com.android.systemui.shade.NotificationShadeWindowViewController; import com.android.systemui.statusbar.GestureRecorder; import com.android.systemui.statusbar.LightRevealScrim; import com.android.systemui.statusbar.NotificationPresenter; Loading Loading @@ -286,8 +285,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn void onTouchEvent(MotionEvent event); GestureRecorder getGestureRecorder(); BiometricUnlockController getBiometricUnlockController(); void showWirelessChargingAnimation(int batteryLevel); Loading Loading @@ -402,10 +399,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn LightRevealScrim getLightRevealScrim(); void onTrackingStarted(); void onClosingFinished(); // TODO: Figure out way to remove these. NavigationBarView getNavigationBarView(); Loading Loading @@ -489,13 +482,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn void updateNotificationPanelTouchState(); /** * TODO(b/257041702) delete this * @deprecated Use ShadeController#makeExpandedVisible */ @Deprecated void makeExpandedVisible(boolean force); int getDisplayId(); int getRotation(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +3 −28 Original line number Diff line number Diff line Loading @@ -1257,6 +1257,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mNotificationPanelViewController.initDependencies( this, mGestureRec, mShadeController::makeExpandedInvisible, mNotificationShelfController); Loading Loading @@ -1855,7 +1856,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { public void onLaunchAnimationCancelled(boolean isLaunchForActivity) { if (mPresenter.isPresenterFullyCollapsed() && !mPresenter.isCollapsing() && isLaunchForActivity) { onClosingFinished(); mShadeController.onClosingFinished(); } else { mShadeController.collapseShade(true /* animate */); } Loading @@ -1865,7 +1866,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { @Override public void onLaunchAnimationEnd(boolean launchIsFullScreen) { if (!mPresenter.isCollapsing()) { onClosingFinished(); mShadeController.onClosingFinished(); } if (launchIsFullScreen) { mShadeController.instantCollapseShade(); Loading Loading @@ -2051,11 +2052,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } } @Override public GestureRecorder getGestureRecorder() { return mGestureRec; } @Override public BiometricUnlockController getBiometricUnlockController() { return mBiometricUnlockController; Loading Loading @@ -3338,21 +3334,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { return mLightRevealScrim; } @Override public void onTrackingStarted() { mShadeController.runPostCollapseRunnables(); } @Override public void onClosingFinished() { mShadeController.runPostCollapseRunnables(); if (!mPresenter.isPresenterFullyCollapsed()) { // if we set it not to be focusable when collapsing, we have to undo it when we aborted // the closing mNotificationShadeWindowController.setNotificationShadeFocusable(true); } } // TODO: Figure out way to remove these. @Override public NavigationBarView getNavigationBarView() { Loading Loading @@ -3584,12 +3565,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mNotificationIconAreaController.setAnimationsEnabled(!disabled); } //TODO(b/257041702) delete @Override public void makeExpandedVisible(boolean force) { mShadeController.makeExpandedVisible(force); } final ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() { @Override public void onScreenTurningOn(Runnable onDrawn) { Loading