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

Commit d94cd5c0 authored by Pavel Grafov's avatar Pavel Grafov
Browse files

Add cross-user check to streaming policy getters

Bug: 235822336
Bug: 235821829
Test: atest CtsDevicePolicyTestCases:android.devicepolicy.cts.NearbyAppStreamingPolicyTest
Test: atest CtsDevicePolicyTestCases:android.devicepolicy.cts.NearbyNotificationStreamingPolicyTest
Change-Id: If8c10b5742f256d0b954a89634f2ca3e41d46778
parent 635dcd86
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7709,6 +7709,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        Preconditions.checkCallAuthorization(
                isProfileOwner(caller) || isDefaultDeviceOwner(caller)
                        || hasCallingOrSelfPermission(permission.READ_NEARBY_STREAMING_POLICY));
        Preconditions.checkCallAuthorization(hasCrossUsersPermission(caller, userId));
        synchronized (getLockObject()) {
            if (mOwners.hasProfileOwner(userId) || mOwners.hasDeviceOwner()) {
@@ -7749,6 +7750,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        Preconditions.checkCallAuthorization(
                isProfileOwner(caller) || isDefaultDeviceOwner(caller)
                        || hasCallingOrSelfPermission(permission.READ_NEARBY_STREAMING_POLICY));
        Preconditions.checkCallAuthorization(hasCrossUsersPermission(caller, userId));
        synchronized (getLockObject()) {
            if (mOwners.hasProfileOwner(userId) || mOwners.hasDeviceOwner()) {