diff options
| author | 2023-04-25 15:03:09 +0000 | |
|---|---|---|
| committer | 2023-04-25 15:06:23 +0000 | |
| commit | abe0cd49d1404838a68a4d3b72c7582f15a3f6ac (patch) | |
| tree | 03abdc9af69c72e5e1f5a97b603a2aadfde21586 | |
| parent | 29ddb4d350a8fd3d1e42baa2b98e007fbb651669 (diff) | |
Fix bug in isManagedKiosk
Fixes: 279567430
Test: atest com.google.android.gts.devicepolicy.DeviceOwnerTest#testIsManagedKiosk_lockTaskSystemInfoFeature_returnsFalse
Change-Id: I29e63ef20571f1d29cd7372ab068567da62c1e5d
| -rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index f6bc93ab2491..82c4f1ab4a1f 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -20156,9 +20156,20 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } private boolean isLockTaskFeatureEnabled(int lockTaskFeature) throws RemoteException { - //TODO(b/175285301): Explicitly get the user's identity to check. - int lockTaskFeatures = - getUserData(getCurrentForegroundUserId()).mLockTaskFeatures; + int lockTaskFeatures = 0; + if (isPolicyEngineForFinanceFlagEnabled()) { + LockTaskPolicy policy = mDevicePolicyEngine.getResolvedPolicy( + PolicyDefinition.LOCK_TASK, getCurrentForegroundUserId()); + lockTaskFeatures = policy == null + // We default on the power button menu, in order to be consistent with pre-P + // behaviour. + ? DevicePolicyManager.LOCK_TASK_FEATURE_GLOBAL_ACTIONS + : policy.getFlags(); + } else { + //TODO(b/175285301): Explicitly get the user's identity to check. + lockTaskFeatures = + getUserData(getCurrentForegroundUserId()).mLockTaskFeatures; + } return (lockTaskFeatures & lockTaskFeature) == lockTaskFeature; } |