Merge "store preferential configs if no error from CS" into udc-qpr-dev

This commit is contained in:
Treehugger Robot
2023-06-01 21:55:45 +00:00
committed by Android (Google) Code Review

View File

@@ -14837,6 +14837,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
"Caller is not managed profile owner or device owner;" "Caller is not managed profile owner or device owner;"
+ " only managed profile owner or device owner may control the preferential" + " only managed profile owner or device owner may control the preferential"
+ " network service"); + " network service");
try {
updateNetworkPreferenceForUser(caller.getUserId(), preferentialNetworkServiceConfigs);
synchronized (getLockObject()) { synchronized (getLockObject()) {
final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked( final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked(
caller.getUserId()); caller.getUserId());
@@ -14847,7 +14850,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
saveSettingsLocked(caller.getUserId()); saveSettingsLocked(caller.getUserId());
} }
} }
updateNetworkPreferenceForUser(caller.getUserId(), preferentialNetworkServiceConfigs); } catch (Exception e) {
Slogf.e(LOG_TAG, "Failed to set preferential network service configs");
throw e;
}
DevicePolicyEventLogger DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_PREFERENTIAL_NETWORK_SERVICE_ENABLED) .createEvent(DevicePolicyEnums.SET_PREFERENTIAL_NETWORK_SERVICE_ENABLED)
.setBoolean(preferentialNetworkServiceConfigs .setBoolean(preferentialNetworkServiceConfigs