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

Commit f994c1fe authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Android (Google) Code Review
Browse files

Merge "[CS] Remove CentralSurfaces#clearNotificationEffects." into main

parents 4a983ac1 dfd500ca
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;
@@ -335,6 +336,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;
@@ -742,6 +744,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
            NavigationBarController navigationBarController,
            QuickSettingsController quickSettingsController,
            FragmentService fragmentService,
            IStatusBarService statusBarService,
            ContentResolver contentResolver,
            ShadeHeaderController shadeHeaderController,
            ScreenOffAnimationController screenOffAnimationController,
@@ -872,6 +875,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mKeyguardQsUserSwitchComponentFactory = keyguardQsUserSwitchComponentFactory;
        mKeyguardUserSwitcherComponentFactory = keyguardUserSwitcherComponentFactory;
        mFragmentService = fragmentService;
        mStatusBarService = statusBarService;
        mSettingsChangeObserver = new SettingsChangeObserver(handler);
        mSplitShadeEnabled =
                LargeScreenUtils.shouldUseSplitNotificationShade(mResources);
@@ -3033,7 +3037,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());
    }
@@ -5279,11 +5285,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
@@ -301,8 +301,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
@@ -84,7 +84,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
@@ -3146,11 +3146,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