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

Commit 4de598cb authored by Sooraj Sasindran's avatar Sooraj Sasindran Committed by Automerger Merge Worker
Browse files

Merge "Allow device owner to configure preferential network service" into...

Merge "Allow device owner to configure preferential network service" into tm-dev am: 5d4978d3 am: 094bcc6a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18185943



Change-Id: I0af8615f4e34f9b0b19e79b26bbae30a4224b048
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bba8a92f 094bcc6a
Loading
Loading
Loading
Loading
+17 −8
Original line number Diff line number Diff line
@@ -8511,6 +8511,13 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        }
    }
    private boolean isDeviceOwnerUserId(int userId) {
        synchronized (getLockObject()) {
            return mOwners.getDeviceOwnerComponent() != null
                    && mOwners.getDeviceOwnerUserId() == userId;
        }
    }
    private boolean isDeviceOwnerPackage(String packageName, int userId) {
        synchronized (getLockObject()) {
            return mOwners.hasDeviceOwner()
@@ -12108,10 +12115,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            return;
        }
        final CallerIdentity caller = getCallerIdentity();
        Preconditions.checkCallAuthorization(isProfileOwner(caller)
        Preconditions.checkCallAuthorization((isProfileOwner(caller)
                        && isManagedProfile(caller.getUserId()))
                        || isDefaultDeviceOwner(caller),
                "Caller is not profile owner or device owner;"
                        + " only profile owner or device owner may control the preferential"
                "Caller is not managed profile owner or device owner;"
                        + " only managed profile owner or device owner may control the preferential"
                        + " network service");
        synchronized (getLockObject()) {
            final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked(
@@ -12138,11 +12146,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        }
        final CallerIdentity caller = getCallerIdentity();
        Preconditions.checkCallAuthorization(isProfileOwner(caller)
        Preconditions.checkCallAuthorization((isProfileOwner(caller)
                        && isManagedProfile(caller.getUserId()))
                        || isDefaultDeviceOwner(caller),
                "Caller is not profile owner or device owner;"
                        + " only profile owner or device owner may retrieve the preferential"
                        + " network service configurations");
                "Caller is not managed profile owner or device owner;"
                        + " only managed profile owner or device owner may retrieve the "
                        + "preferential network service configurations");
        synchronized (getLockObject()) {
            final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked(
                    caller.getUserId());
@@ -18257,7 +18266,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
    private void updateNetworkPreferenceForUser(int userId,
            List<PreferentialNetworkServiceConfig> preferentialNetworkServiceConfigs) {
        if (!isManagedProfile(userId)) {
        if (!isManagedProfile(userId) && !isDeviceOwnerUserId(userId)) {
            return;
        }
        List<ProfileNetworkPreference> preferences = new ArrayList<>();