Allow bypassing setup for Auto in startDockOrHome
Auto allows for setup deferral, so keycode presses for HOME should propagate to the application layer when user setup is in progress. Bug: 140787161 Test: KEYCODE_HOME should trigger an intent with Intent.CATEGORY_HOME Change-Id: I05751f93c44405b28f93789e6f8e6cf0a3f34524 Signed-off-by: Julius D'souza <jdsouza@google.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import static android.app.AppOpsManager.OP_TOAST_WINDOW;
|
|||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
||||||
import static android.content.Context.CONTEXT_RESTRICTED;
|
import static android.content.Context.CONTEXT_RESTRICTED;
|
||||||
import static android.content.Context.WINDOW_SERVICE;
|
import static android.content.Context.WINDOW_SERVICE;
|
||||||
|
import static android.content.pm.PackageManager.FEATURE_AUTOMOTIVE;
|
||||||
import static android.content.pm.PackageManager.FEATURE_HDMI_CEC;
|
import static android.content.pm.PackageManager.FEATURE_HDMI_CEC;
|
||||||
import static android.content.pm.PackageManager.FEATURE_LEANBACK;
|
import static android.content.pm.PackageManager.FEATURE_LEANBACK;
|
||||||
import static android.content.pm.PackageManager.FEATURE_PICTURE_IN_PICTURE;
|
import static android.content.pm.PackageManager.FEATURE_PICTURE_IN_PICTURE;
|
||||||
@@ -385,6 +386,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
BurnInProtectionHelper mBurnInProtectionHelper;
|
BurnInProtectionHelper mBurnInProtectionHelper;
|
||||||
private DisplayFoldController mDisplayFoldController;
|
private DisplayFoldController mDisplayFoldController;
|
||||||
AppOpsManager mAppOpsManager;
|
AppOpsManager mAppOpsManager;
|
||||||
|
private boolean mHasFeatureAuto;
|
||||||
private boolean mHasFeatureWatch;
|
private boolean mHasFeatureWatch;
|
||||||
private boolean mHasFeatureLeanback;
|
private boolean mHasFeatureLeanback;
|
||||||
private boolean mHasFeatureHdmiCec;
|
private boolean mHasFeatureHdmiCec;
|
||||||
@@ -1753,6 +1755,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
mDisplayManager = mContext.getSystemService(DisplayManager.class);
|
mDisplayManager = mContext.getSystemService(DisplayManager.class);
|
||||||
mHasFeatureWatch = mContext.getPackageManager().hasSystemFeature(FEATURE_WATCH);
|
mHasFeatureWatch = mContext.getPackageManager().hasSystemFeature(FEATURE_WATCH);
|
||||||
mHasFeatureLeanback = mContext.getPackageManager().hasSystemFeature(FEATURE_LEANBACK);
|
mHasFeatureLeanback = mContext.getPackageManager().hasSystemFeature(FEATURE_LEANBACK);
|
||||||
|
mHasFeatureAuto = mContext.getPackageManager().hasSystemFeature(FEATURE_AUTOMOTIVE);
|
||||||
mHasFeatureHdmiCec = mContext.getPackageManager().hasSystemFeature(FEATURE_HDMI_CEC);
|
mHasFeatureHdmiCec = mContext.getPackageManager().hasSystemFeature(FEATURE_HDMI_CEC);
|
||||||
mAccessibilityShortcutController =
|
mAccessibilityShortcutController =
|
||||||
new AccessibilityShortcutController(mContext, new Handler(), mCurrentUserId);
|
new AccessibilityShortcutController(mContext, new Handler(), mCurrentUserId);
|
||||||
@@ -5222,7 +5225,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
awakenDreams();
|
awakenDreams();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isUserSetupComplete()) {
|
if (!mHasFeatureAuto && !isUserSetupComplete()) {
|
||||||
Slog.i(TAG, "Not going home because user setup is in progress.");
|
Slog.i(TAG, "Not going home because user setup is in progress.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user