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

This commit is contained in:
Nicolò Mazzucato authored and Android (Google) Code Review committed 2022-08-10 09:32:53 +00:00
commit 92b4a88f78
2 files changed
+22

No files matched your search

@@ -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.
*
@@ -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);