Don't access keyguard from instant apps.

Test: cts-instant-tradefed run cts-instant -m CtsViewTestCases

bug:109652548

Change-Id: I6f8bb714bd98fd53068b2662633a9155d64b274c
This commit is contained in:
Svet Ganov
2018-06-07 20:20:34 -07:00
parent 10422896ed
commit 3ea66c319c

View File

@@ -2032,7 +2032,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
* Do this in onKeyUp since the Search key is also used for
* chording quick launch shortcuts.
*/
if (getKeyguardManager().inKeyguardRestrictedInputMode()) {
if (isNotInstantAppAndKeyguardRestricted()) {
break;
}
if ((getContext().getResources().getConfiguration().uiMode
@@ -2056,6 +2056,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
return false;
}
private boolean isNotInstantAppAndKeyguardRestricted() {
return !getContext().getPackageManager().isInstantApp()
&& getKeyguardManager().inKeyguardRestrictedInputMode();
}
@Override
protected void onActive() {
}