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

Commit f27fc6ca authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

store preferential configs if no error from CS

store preferential configs in deivice policy only if no error from
connectivity service

Bug: 283999128
Test: Added new test to CTS and ran PreferentialNetworkServiceTest
Merged-In: I8421e4d21b8719426cfb998d96742e065641efcd
Change-Id: I8421e4d21b8719426cfb998d96742e065641efcd
parent 3f21f5a8
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -14836,6 +14836,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                "Caller is not managed profile owner or device owner;"
                        + " only managed profile owner or device owner may control the preferential"
                        + " network service");
        try {
            updateNetworkPreferenceForUser(caller.getUserId(), preferentialNetworkServiceConfigs);
            synchronized (getLockObject()) {
                final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked(
                        caller.getUserId());
@@ -14846,7 +14849,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                    saveSettingsLocked(caller.getUserId());
                }
            }
        updateNetworkPreferenceForUser(caller.getUserId(), preferentialNetworkServiceConfigs);
        } catch (Exception e) {
            Slogf.e(LOG_TAG, "Failed to set preferential network service configs");
            throw e;
        }
        DevicePolicyEventLogger
                .createEvent(DevicePolicyEnums.SET_PREFERENTIAL_NETWORK_SERVICE_ENABLED)
                .setBoolean(preferentialNetworkServiceConfigs