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

Commit b399812c authored by Nicolò Mazzucato's avatar Nicolò Mazzucato Committed by Automerger Merge Worker
Browse files

Merge "Disable hinge sensor while the screen is off" into tm-qpr-dev am: 92b4a88f am: b793cac6

parents 1edf184c b793cac6
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);