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

Commit 798e5cd0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Play longpress haptic on AOD longpress of lock-icon" into main

parents 810c4aed 53811f5e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@ import com.android.systemui.util.concurrency.FakeExecutor;
import com.android.systemui.util.time.FakeSystemClock;
import com.android.systemui.util.time.SystemClock;

import com.google.android.msdl.domain.MSDLPlayer;

import dagger.Lazy;

import kotlinx.coroutines.CoroutineScope;
@@ -310,7 +312,8 @@ public class UdfpsControllerTest extends SysuiTestCase {
                mPowerInteractor,
                mock(CoroutineScope.class),
                UserActivityNotifierKosmosKt.getUserActivityNotifier(mKosmos),
                mWakefulnessLifecycle
                mWakefulnessLifecycle,
                mock(MSDLPlayer.class)
        );
        verify(mFingerprintManager).setUdfpsOverlayController(mOverlayCaptor.capture());
        mOverlayController = mOverlayCaptor.getValue();
+18 −8
Original line number Diff line number Diff line
@@ -114,6 +114,9 @@ import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.concurrency.Execution;
import com.android.systemui.util.time.SystemClock;

import com.google.android.msdl.data.model.MSDLToken;
import com.google.android.msdl.domain.MSDLPlayer;

import dagger.Lazy;

import kotlin.Unit;
@@ -189,6 +192,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
    @NonNull private final CoroutineScope mScope;
    @NonNull private final InputManager mInputManager;
    @NonNull private final SelectedUserInteractor mSelectedUserInteractor;
    @NonNull private final MSDLPlayer mMsdlPlayer;
    private final boolean mIgnoreRefreshRate;
    private final KeyguardTransitionInteractor mKeyguardTransitionInteractor;

@@ -719,7 +723,8 @@ public class UdfpsController implements DozeReceiver, Dumpable {
            @NonNull PowerInteractor powerInteractor,
            @Application CoroutineScope scope,
            UserActivityNotifier userActivityNotifier,
            Lazy<WakefulnessLifecycle> wakefulnessLifecycle) {
            Lazy<WakefulnessLifecycle> wakefulnessLifecycle,
            MSDLPlayer msdlPlayer) {
        mContext = context;
        mExecution = execution;
        mVibrator = vibrator;
@@ -772,6 +777,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
        mDeviceEntryUdfpsTouchOverlayViewModel = deviceEntryUdfpsTouchOverlayViewModel;
        mDefaultUdfpsTouchOverlayViewModel = defaultUdfpsTouchOverlayViewModel;
        mPromptUdfpsTouchOverlayViewModel = promptUdfpsTouchOverlayViewModel;
        mMsdlPlayer = msdlPlayer;

        mDumpManager.registerDumpable(TAG, this);

@@ -916,6 +922,9 @@ public class UdfpsController implements DozeReceiver, Dumpable {
            mKeyguardViewManager.showPrimaryBouncer(true, "UdfpsController#onAodInterrupt");

            // play the same haptic as the DeviceEntryIcon longpress
            if (Flags.msdlFeedback()) {
                mMsdlPlayer.playToken(MSDLToken.LONG_PRESS, null);
            } else {
                if (mOverlay != null && mOverlay.getTouchOverlay() != null) {
                    mVibrator.performHapticFeedback(
                            mOverlay.getTouchOverlay(),
@@ -925,6 +934,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
                    Log.e(TAG, "No haptics played. Could not obtain overlay view to perform"
                            + "vibration. Either the controller overlay is null or has no view");
                }
            }
            return;
        }