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

Commit 92b4a88f authored by Nicolò Mazzucato's avatar Nicolò Mazzucato Committed by Android (Google) Code Review
Browse files

Merge "Disable hinge sensor while the screen is off" into tm-qpr-dev

parents 16b6511e bd819cdf
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -270,6 +270,18 @@ public class TouchInteractionService extends Service
            MAIN_EXECUTOR.execute(ProxyScreenStatusProvider.INSTANCE::onScreenTurnedOn);
        }

        @BinderThread
        @Override
        public void onScreenTurningOn() {
            MAIN_EXECUTOR.execute(ProxyScreenStatusProvider.INSTANCE::onScreenTurningOn);
        }

        @BinderThread
        @Override
        public void onScreenTurningOff() {
            MAIN_EXECUTOR.execute(ProxyScreenStatusProvider.INSTANCE::onScreenTurningOff);
        }

        /**
         * Preloads the Overview activity.
         *
+10 −0
Original line number Diff line number Diff line
@@ -39,6 +39,16 @@ public class ProxyScreenStatusProvider implements ScreenStatusProvider {
        mListeners.forEach(ScreenListener::onScreenTurnedOn);
    }

    /** Called when the screen is starting to turn on. */
    public void onScreenTurningOn() {
        mListeners.forEach(ScreenListener::onScreenTurningOn);
    }

    /** Called when the screen is starting to turn off. */
    public void onScreenTurningOff() {
        mListeners.forEach(ScreenListener::onScreenTurningOff);
    }

    @Override
    public void addCallback(@NonNull ScreenListener listener) {
        mListeners.add(listener);