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

Commit bb6d2f17 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:ca2faa1036823e23907f2836d4893a1daf11202c)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:bdd8fbba5bfa3f0c6ea838e1882ad394100a8109)
Merged-In: I496b9ce7a0bbb1e6c245682be57b7357bb432d42
Change-Id: I496b9ce7a0bbb1e6c245682be57b7357bb432d42
parent 354820f6
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -8641,10 +8641,15 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            Slogf.e(LOG_TAG, "Invalid proxy properties, ignoring: " + proxyProperties.toString());
            return;
        }
        mInjector.settingsGlobalPutString(Settings.Global.GLOBAL_HTTP_PROXY_HOST, data[0]);
        mInjector.settingsGlobalPutInt(Settings.Global.GLOBAL_HTTP_PROXY_PORT, proxyPort);
        mInjector.settingsGlobalPutString(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
        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);
        }
    }
    /**