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

Commit 53811f5e authored by beverlyt's avatar beverlyt
Browse files

Play longpress haptic on AOD longpress of lock-icon

Fixes: 433400360
Flag: EXEMPT bugfix
Test: atest UdfpsControllerTest
Test: enable aod; enroll UDFPS; trigger lockdown;
on AOD, longpress lock icon and observe haptic
Change-Id: Ie9d6ec76195fbc9bf7de2c8420f82c8b56763e28

Change-Id: I8b9289edf38619db0308137a9780733306d3c83d
parent cd66423b
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;
        }