Make TouchInteractionService direct boot aware
- Add directBootAware="true" to TouchInteractionService manifest component
- Add DeviceLockedInputConsumer which just sends a home intent on touch down
Test:
- Reboot
- Swipe up anywhere to get to bouncer (pin/password/pattern)
- Click "Emergency" to launch dialer while still in direct boot
- Swipe up from the nav bar to exit/bring up bouncer
Test:
- Lock screen
- Double press power to launch camera
- Swipe up from nav bar to exit/bring up bouncer
Bug: 125364936
Change-Id: I7a4cd2dc3a635daf4bb9a643a1e5251ca4e91e33
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 74fa447..7bb6071 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -19,12 +19,14 @@
import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_ICON_PARAMS;
import static com.android.launcher3.util.SecureSettingsObserver.newNotificationSettingsObserver;
+import android.app.KeyguardManager;
import android.content.ComponentName;
import android.content.ContentProviderClient;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Handler;
+import android.os.Process;
import android.util.Log;
import com.android.launcher3.compat.LauncherAppsCompat;
@@ -66,6 +68,9 @@
}
private LauncherAppState(Context context) {
+ if (!UserManagerCompat.getInstance(context).isUserUnlocked(Process.myUserHandle())) {
+ throw new RuntimeException("LauncherAppState should not start in direct boot mode");
+ }
if (getLocalProvider(context) == null) {
throw new RuntimeException(
"Initializing LauncherAppState in the absence of LauncherProvider");