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

Commit d5fee58e authored by Rubin Xu's avatar Rubin Xu Committed by Android Build Coastguard Worker
Browse files

DevicePolicyManager: ignore invalid proxy settings

Ignore exceptions thrown when invalid proxy settings are being
applied, in order to avoid breaking callers performing potentially
security-sensitive operations (like removing an ActiveAdmin)

Bug: 365975561
Test: manual
Flag: EXEMPT bugfix
(cherry picked from commit 2ea32931)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2658e2f12b660e81f8baccd98bcf41a693145ed6)
Merged-In: I496b9ce7a0bbb1e6c245682be57b7357bb432d42
Change-Id: I496b9ce7a0bbb1e6c245682be57b7357bb432d42
parent bae8ab23
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -8708,10 +8708,15 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            Slogf.e(LOG_TAG, "Invalid proxy properties, ignoring: " + proxyProperties.toString());
            return;
        }
        try {
            mInjector.settingsGlobalPutString(Global.GLOBAL_HTTP_PROXY_HOST, data[0]);
            mInjector.settingsGlobalPutInt(Global.GLOBAL_HTTP_PROXY_PORT, proxyPort);
            mInjector.settingsGlobalPutString(Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
                    exclusionList);
        } catch (Exception e) {
            //Ignore any potential errors from SettingsProvider, b/365975561
            Slogf.w(LOG_TAG, "Fail to save proxy", e);
        }
    }
    /**