summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java17
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;
}