Merge "Fix NPE in streamin policy getters."

This commit is contained in:
Pavel Grafov
2023-01-19 16:39:06 +00:00
committed by Android (Google) Code Review

View File

@@ -7960,13 +7960,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
Preconditions.checkCallAuthorization(hasCrossUsersPermission(caller, userId));
synchronized (getLockObject()) {
if (mOwners.hasProfileOwner(userId) || mOwners.hasDeviceOwner()) {
final ActiveAdmin admin = getDeviceOrProfileOwnerAdminLocked(userId);
return admin.mNearbyNotificationStreamingPolicy;
}
final ActiveAdmin admin = getDeviceOrProfileOwnerAdminLocked(userId);
return admin != null
? admin.mNearbyNotificationStreamingPolicy
: NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY;
}
return NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY;
}
@Override
@@ -8001,13 +7999,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
Preconditions.checkCallAuthorization(hasCrossUsersPermission(caller, userId));
synchronized (getLockObject()) {
if (mOwners.hasProfileOwner(userId) || mOwners.hasDeviceOwner()) {
final ActiveAdmin admin = getDeviceOrProfileOwnerAdminLocked(userId);
return admin.mNearbyAppStreamingPolicy;
}
final ActiveAdmin admin = getDeviceOrProfileOwnerAdminLocked(userId);
return admin != null
? admin.mNearbyAppStreamingPolicy
: NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY;
}
return NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY;
}
/**