Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25747491 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/23434561',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/23434561', 'googleplex-android-review.googlesource.com/23483309'] into sparse-10203748-L48300000960976884.
SPARSE_CHANGE: I9354d3f5b77ca9f5ed2a12938e3c225fed4422ab
SPARSE_CHANGE: I2014de938edcee5a3da1faa9b4ba4e6769cad304

Change-Id: Ib5aa19607befc07d981756253e0e7846fdee6408
parents 4e380aaa 78e3efe8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ object Flags {

    // TODO(b/270987164): Tracking Bug
    @JvmField
    val TRACKPAD_GESTURE_FEATURES = unreleasedFlag(1205, "trackpad_gesture_features", teamfood = true)
    val TRACKPAD_GESTURE_FEATURES = releasedFlag(1205, "trackpad_gesture_features")

    // TODO(b/263826204): Tracking Bug
    @JvmField
+12 −13
Original line number Diff line number Diff line
@@ -11113,7 +11113,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                || hasCallingOrSelfPermission(permission.INTERACT_ACROSS_USERS);
    }
    private boolean canUserUseLockTaskLocked(int userId) {
    private boolean canDPCManagedUserUseLockTaskLocked(int userId) {
        if (isUserAffiliatedWithDeviceLocked(userId)) {
            return true;
        }
@@ -11123,13 +11123,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            return false;
        }
        
        if (!isPermissionCheckFlagEnabled() && !isPolicyEngineForFinanceFlagEnabled()) {
        final ComponentName profileOwner = getProfileOwnerAsUser(userId);
        if (profileOwner == null) {
            return false;
        }
        }
        // Managed profiles are not allowed to use lock task
        if (isManagedProfile(userId)) {
            return false;
@@ -11142,7 +11139,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        final int userId = caller.getUserId();
        enforceCanQuery(MANAGE_DEVICE_POLICY_LOCK_TASK, caller.getPackageName(), userId);
        if (!canUserUseLockTaskLocked(userId)) {
        if ((isDeviceOwner(caller) || isProfileOwner(caller))
                && !canDPCManagedUserUseLockTaskLocked(userId)) {
            throw new SecurityException("User " + userId + " is not allowed to use lock task");
        }
    }
@@ -11158,7 +11156,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                caller.getPackageName(),
                userId
        );
        if (!canUserUseLockTaskLocked(userId)) {
        if ((isDeviceOwner(caller) || isProfileOwner(caller))
                && !canDPCManagedUserUseLockTaskLocked(userId)) {
            throw new SecurityException("User " + userId + " is not allowed to use lock task");
        }
        return enforcingAdmin;
@@ -11169,7 +11168,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                || isDefaultDeviceOwner(caller) || isFinancedDeviceOwner(caller));
        final int userId =  caller.getUserId();
        if (!canUserUseLockTaskLocked(userId)) {
        if (!canDPCManagedUserUseLockTaskLocked(userId)) {
            throw new SecurityException("User " + userId + " is not allowed to use lock task");
        }
    }
@@ -15101,7 +15100,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            final List<UserInfo> userInfos = mUserManager.getAliveUsers();
            for (int i = userInfos.size() - 1; i >= 0; i--) {
                int userId = userInfos.get(i).id;
                if (canUserUseLockTaskLocked(userId)) {
                if (canDPCManagedUserUseLockTaskLocked(userId)) {
                    continue;
                }