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

Commit dfd500ca authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[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
parent 0c3c52b8
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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 {
+0 −2
Original line number Diff line number Diff line
@@ -303,8 +303,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner {

    void awakenDreams();

    void clearNotificationEffects();

    boolean isBouncerShowing();

    boolean isBouncerShowingScrimmed();
+0 −1
Original line number Diff line number Diff line
@@ -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
+1 −5
Original line number Diff line number Diff line
@@ -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) {
+14 −4
Original line number Diff line number Diff line
@@ -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();
    }
}
Loading