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

Commit 79012b04 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Wakeup display on taps before entering true AoD" into tm-qpr-dev am: 88deb417

parents 3f4b7c90 88deb417
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -147,10 +147,10 @@ public interface FalsingManager {
    }

    /**
     * Listener that is alerted when a double tap is required to confirm a single tap.
     * Listener that is alerted when an additional tap is required to confirm a single tap.
     **/
    interface FalsingTapListener {
        void onDoubleTapRequired();
        void onAdditionalTapRequired();
    }

    /** Passed to {@link FalsingManager#onProximityEvent}. */
+2 −2
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ public class BrightLineFalsingManager implements FalsingManager {
                        FalsingClassifier.Result.falsed(
                                0, getClass().getSimpleName(), "bad history"));
                logDebug("False Single Tap: true (bad history)");
                mFalsingTapListeners.forEach(FalsingTapListener::onDoubleTapRequired);
                mFalsingTapListeners.forEach(FalsingTapListener::onAdditionalTapRequired);
                return true;
            } else {
                mPriorResults = getPassedResult(0.1);
@@ -321,7 +321,7 @@ public class BrightLineFalsingManager implements FalsingManager {
                mHistoryTracker.falseBelief(),
                mHistoryTracker.falseConfidence());
        mPriorResults = Collections.singleton(result);
        logDebug("False Double Tap: " + result.isFalse());
        logDebug("False Double Tap: " + result.isFalse() + " reason=" + result.getReason());
        return result.isFalse();
    }

+1 −3
Original line number Diff line number Diff line
@@ -303,9 +303,7 @@ class FalsingCollectorImpl implements FalsingCollector {

    @Override
    public void onTouchEvent(MotionEvent ev) {
        if (!mKeyguardStateController.isShowing()
                || (mStatusBarStateController.isDozing()
                    && !mStatusBarStateController.isPulsing())) {
        if (!mKeyguardStateController.isShowing()) {
            avoidGesture();
            return;
        }
+15 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_Q
import static com.android.systemui.statusbar.StatusBarState.KEYGUARD;
import static com.android.systemui.statusbar.StatusBarState.SHADE;
import static com.android.systemui.statusbar.StatusBarState.SHADE_LOCKED;
import static com.android.systemui.statusbar.VibratorHelper.TOUCH_VIBRATION_ATTRIBUTES;
import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_ALL;
import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_FOLD_TO_AOD;
import static com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManagerKt.STATE_CLOSED;
@@ -62,6 +63,7 @@ import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.os.Bundle;
import android.os.Handler;
import android.os.PowerManager;
import android.os.Process;
import android.os.Trace;
import android.os.UserManager;
import android.os.VibrationEffect;
@@ -236,6 +238,9 @@ public final class NotificationPanelViewController extends PanelViewController {
    private static final boolean SPEW_LOGCAT = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.VERBOSE);
    private static final boolean DEBUG_DRAWABLE = false;

    private static final VibrationEffect ADDITIONAL_TAP_REQUIRED_VIBRATION_EFFECT =
            VibrationEffect.get(VibrationEffect.EFFECT_STRENGTH_MEDIUM, false);

    /**
     * The parallax amount of the quick settings translation when dragging down the panel
     */
@@ -682,14 +687,22 @@ public final class NotificationPanelViewController extends PanelViewController {

    private final FalsingTapListener mFalsingTapListener = new FalsingTapListener() {
        @Override
        public void onDoubleTapRequired() {
        public void onAdditionalTapRequired() {
            if (mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED) {
                mTapAgainViewController.show();
            } else {
                mKeyguardIndicationController.showTransientIndication(
                        R.string.notification_tap_again);
            }
            mVibratorHelper.vibrate(VibrationEffect.EFFECT_STRENGTH_MEDIUM);

            if (!mStatusBarStateController.isDozing()) {
                mVibratorHelper.vibrate(
                        Process.myUid(),
                        mView.getContext().getPackageName(),
                        ADDITIONAL_TAP_REQUIRED_VIBRATION_EFFECT,
                        "falsing-additional-tap-required",
                        TOUCH_VIBRATION_ATTRIBUTES);
            }
        }
    };

+4 −3
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public class NotificationShadeWindowViewController {
    private final AmbientState mAmbientState;
    private final PulsingGestureListener mPulsingGestureListener;

    private GestureDetector mGestureDetector;
    private GestureDetector mPulsingWakeupGestureHandler;
    private View mBrightnessMirror;
    private boolean mTouchActive;
    private boolean mTouchCancelled;
@@ -149,7 +149,8 @@ public class NotificationShadeWindowViewController {
    /** Inflates the {@link R.layout#status_bar_expanded} layout and sets it up. */
    public void setupExpandedStatusBar() {
        mStackScrollLayout = mView.findViewById(R.id.notification_stack_scroller);
        mGestureDetector = new GestureDetector(mView.getContext(), mPulsingGestureListener);
        mPulsingWakeupGestureHandler = new GestureDetector(mView.getContext(),
                mPulsingGestureListener);

        mView.setInteractionEventHandler(new NotificationShadeWindowView.InteractionEventHandler() {
            @Override
@@ -196,7 +197,7 @@ public class NotificationShadeWindowViewController {
                }

                mFalsingCollector.onTouchEvent(ev);
                mGestureDetector.onTouchEvent(ev);
                mPulsingWakeupGestureHandler.onTouchEvent(ev);
                mStatusBarKeyguardViewManager.onTouch(ev);
                if (mBrightnessMirror != null
                        && mBrightnessMirror.getVisibility() == View.VISIBLE) {
Loading