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

Commit 2ea32931 authored by Rubin Xu's avatar Rubin Xu
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
Change-Id: I496b9ce7a0bbb1e6c245682be57b7357bb432d42
parent b19d2266
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -8731,10 +8731,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);
        }
    }
    /**