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

Commit 3d6ae232 authored by Selim Cinek's avatar Selim Cinek
Browse files

Introducing new PulseExpansionHandler for dragging down while pulsing

This also uses the same wake-up animation now when we're pulsing.

Test: atest SystemUITests
Bug: 125942236
Change-Id: I34a0eff6ecc2280aa983740e4273b344d073ca6e
parent 3fe7e7e1
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -380,6 +380,20 @@ public class DataCollector implements SensorEventListener {
        addEvent(PhoneEvent.ON_NOTIFICATION_START_DRAGGING_DOWN);
    }

    public void onStartExpandingFromPulse() {
        if (DEBUG) {
            Log.d(TAG, "onStartExpandingFromPulse");
        }
        // TODO: maybe add event
    }

    public void onExpansionFromPulseStopped() {
        if (DEBUG) {
            Log.d(TAG, "onExpansionFromPulseStopped");
        }
        // TODO: maybe add event
    }

    public void onNotificatonStopDraggingDown() {
        if (DEBUG) {
            Log.d(TAG, "onNotificationStopDraggingDown");
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ public abstract class Classifier {
    public static final int RIGHT_AFFORDANCE = 6;
    public static final int GENERIC = 7;
    public static final int BOUNCER_UNLOCK = 8;
    public static final int PULSE_EXPAND = 9;

    /**
     * Contains all the information about touch events from which the classifier can query
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ public class DirectionEvaluator {
        boolean vertical = Math.abs(yDiff) >= Math.abs(xDiff);
        switch (type) {
            case Classifier.QUICK_SETTINGS:
            case Classifier.PULSE_EXPAND:
            case Classifier.NOTIFICATION_DRAG_DOWN:
                if (!vertical || yDiff <= 0.0) {
                    return falsingEvaluation;
+12 −0
Original line number Diff line number Diff line
@@ -408,10 +408,22 @@ public class FalsingManager implements SensorEventListener, StateListener {
        mDataCollector.onNotificatonStartDraggingDown();
    }

    public void onStartExpandingFromPulse() {
        if (FalsingLog.ENABLED) {
            FalsingLog.i("onStartExpandingFromPulse", "");
        }
        mHumanInteractionClassifier.setType(Classifier.PULSE_EXPAND);
        mDataCollector.onStartExpandingFromPulse();
    }

    public void onNotificatonStopDraggingDown() {
        mDataCollector.onNotificatonStopDraggingDown();
    }

    public void onExpansionFromPulseStopped() {
        mDataCollector.onExpansionFromPulseStopped();
    }

    public void onNotificationDismissed() {
        mDataCollector.onNotificationDismissed();
    }
+2 −1
Original line number Diff line number Diff line
@@ -128,7 +128,8 @@ public class HumanInteractionClassifier extends Classifier {
        // sent to the classifiers until the finger moves far enough. When the finger if lifted
        // up, the last MotionEvent which was far enough from the finger is set as the final
        // MotionEvent and sent to the Classifiers.
        if (mCurrentType == Classifier.NOTIFICATION_DRAG_DOWN) {
        if (mCurrentType == Classifier.NOTIFICATION_DRAG_DOWN
                || mCurrentType == Classifier.PULSE_EXPAND) {
            mBufferedEvents.add(MotionEvent.obtain(event));
            Point pointEnd = new Point(event.getX() / mDpi, event.getY() / mDpi);

Loading