diff options
| author | 2023-09-12 21:59:47 +0000 | |
|---|---|---|
| committer | 2023-09-12 22:07:51 +0000 | |
| commit | dfd500cad25f0a08882b077883216c9245a42a6b (patch) | |
| tree | e3b8a8f36765cbb96b20c848d82ade2718ddce0f | |
| parent | 0c3c52b8826143ad117a3919ed0cfb98a23049e7 (diff) | |
[CS] Remove CentralSurfaces#clearNotificationEffects.
Bug: 277764509
Test: receive HUN w/ sound on and pull down on HUN -> verify sound is
cut short
Test: atest NotificationPanelViewControllerTest
Change-Id: I2a04df315a048bf4a4094bd23a51f6ec7492240a
6 files changed, 25 insertions, 18 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 246ea0ed1e13..ca5d7b3e8a85 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -97,6 +97,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.policy.SystemBarUtils; +import com.android.internal.statusbar.IStatusBarService; import com.android.internal.util.LatencyTracker; import com.android.keyguard.ActiveUnlockConfig; import com.android.keyguard.FaceAuthApiRequestReason; @@ -336,6 +337,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private final KeyguardUserSwitcherComponent.Factory mKeyguardUserSwitcherComponentFactory; private final KeyguardStatusBarViewComponent.Factory mKeyguardStatusBarViewComponentFactory; private final FragmentService mFragmentService; + private final IStatusBarService mStatusBarService; private final ScrimController mScrimController; private final LockscreenShadeTransitionController mLockscreenShadeTransitionController; private final TapAgainViewController mTapAgainViewController; @@ -744,6 +746,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump NavigationBarController navigationBarController, QuickSettingsController quickSettingsController, FragmentService fragmentService, + IStatusBarService statusBarService, ContentResolver contentResolver, ShadeHeaderController shadeHeaderController, ScreenOffAnimationController screenOffAnimationController, @@ -874,6 +877,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mKeyguardQsUserSwitchComponentFactory = keyguardQsUserSwitchComponentFactory; mKeyguardUserSwitcherComponentFactory = keyguardUserSwitcherComponentFactory; mFragmentService = fragmentService; + mStatusBarService = statusBarService; mSettingsChangeObserver = new SettingsChangeObserver(handler); mSplitShadeEnabled = LargeScreenUtils.shouldUseSplitNotificationShade(mResources); @@ -3036,7 +3040,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private void setHeadsUpManager(HeadsUpManagerPhone headsUpManager) { mHeadsUpManager = headsUpManager; mHeadsUpManager.addListener(mOnHeadsUpChangedListener); - mHeadsUpTouchHelper = new HeadsUpTouchHelper(headsUpManager, + mHeadsUpTouchHelper = new HeadsUpTouchHelper( + headsUpManager, + mStatusBarService, mNotificationStackScrollLayoutController.getHeadsUpCallback(), new HeadsUpNotificationViewControllerImpl()); } @@ -5318,11 +5324,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump public void startExpand(float x, float y, boolean startTracking, float expandedHeight) { startExpandMotion(x, y, startTracking, expandedHeight); } - - @Override - public void clearNotificationEffects() { - mCentralSurfaces.clearNotificationEffects(); - } } private final class ShadeAccessibilityDelegate extends AccessibilityDelegate { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index 67c0c94d6544..c4c8721c9752 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -303,8 +303,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner { void awakenDreams(); - void clearNotificationEffects(); - boolean isBouncerShowing(); boolean isBouncerShowingScrimmed(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt index 98ba6d91413f..ad242544a318 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt @@ -85,7 +85,6 @@ abstract class CentralSurfacesEmptyImpl : CentralSurfaces { override fun shouldIgnoreTouch() = false override fun isDeviceInteractive() = false override fun awakenDreams() {} - override fun clearNotificationEffects() {} override fun isBouncerShowing() = false override fun isBouncerShowingScrimmed() = false override fun isBouncerShowingOverDream() = false diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index b45a688e6760..b6cabc6dd5b2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -3153,11 +3153,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } } - /** - * Clear Buzz/Beep/Blink. - */ - @Override - public void clearNotificationEffects() { + private void clearNotificationEffects() { try { mBarService.clearNotificationEffects(); } catch (RemoteException e) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java index 16c2e36af6b8..dcbaac20eacc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java @@ -17,9 +17,11 @@ package com.android.systemui.statusbar.phone; import android.content.Context; +import android.os.RemoteException; import android.view.MotionEvent; import android.view.ViewConfiguration; +import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.Gefingerpoken; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; @@ -31,6 +33,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableView; public class HeadsUpTouchHelper implements Gefingerpoken { private final HeadsUpManagerPhone mHeadsUpManager; + private final IStatusBarService mStatusBarService; private final Callback mCallback; private int mTrackingPointer; private final float mTouchSlop; @@ -43,9 +46,11 @@ public class HeadsUpTouchHelper implements Gefingerpoken { private ExpandableNotificationRow mPickedChild; public HeadsUpTouchHelper(HeadsUpManagerPhone headsUpManager, + IStatusBarService statusBarService, Callback callback, HeadsUpNotificationViewController notificationPanelView) { mHeadsUpManager = headsUpManager; + mStatusBarService = statusBarService; mCallback = callback; mPanel = notificationPanelView; Context context = mCallback.getContext(); @@ -119,7 +124,7 @@ public class HeadsUpTouchHelper implements Gefingerpoken { // This call needs to be after the expansion start otherwise we will get a // flicker of one frame as it's not expanded yet. mHeadsUpManager.unpinAll(true); - mPanel.clearNotificationEffects(); + clearNotificationEffects(); endMotion(); return true; } @@ -175,6 +180,14 @@ public class HeadsUpTouchHelper implements Gefingerpoken { mTouchingHeadsUpView = false; } + private void clearNotificationEffects() { + try { + mStatusBarService.clearNotificationEffects(); + } catch (RemoteException e) { + // Won't fail unless the world has ended. + } + } + public interface Callback { ExpandableView getChildAtRawPosition(float touchX, float touchY); boolean isExpanded(); @@ -191,8 +204,5 @@ public class HeadsUpTouchHelper implements Gefingerpoken { /** Called when a MotionEvent is about to trigger expansion. */ void startExpand(float newX, float newY, boolean startTracking, float expandedHeight); - - /** Clear any effects that were added for the expansion. */ - void clearNotificationEffects(); } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java index 1c9ec27c6a1b..4f57fd0d0a92 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java @@ -65,6 +65,7 @@ import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.testing.UiEventLoggerFake; +import com.android.internal.statusbar.IStatusBarService; import com.android.internal.util.LatencyTracker; import com.android.keyguard.KeyguardClockSwitch; import com.android.keyguard.KeyguardClockSwitchController; @@ -271,6 +272,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { @Mock protected KeyguardIndicationController mKeyguardIndicationController; @Mock protected FragmentService mFragmentService; @Mock protected FragmentHostManager mFragmentHostManager; + @Mock protected IStatusBarService mStatusBarService; @Mock protected NotificationRemoteInputManager mNotificationRemoteInputManager; @Mock protected RecordingController mRecordingController; @Mock protected LockscreenGestureLogger mLockscreenGestureLogger; @@ -621,6 +623,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mNavigationBarController, mQsController, mFragmentService, + mStatusBarService, mContentResolver, mShadeHeaderController, mScreenOffAnimationController, |