Loading core/api/module-lib-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ package android.net { field public static final int TRANSPORT_TEST = 7; // 0x7 } public final class Proxy { method public static void setHttpProxyConfiguration(@Nullable android.net.ProxyInfo); } public final class TcpRepairWindow { ctor public TcpRepairWindow(int, int, int, int, int, int); field public final int maxWindow; Loading core/java/android/app/ActivityThread.java +19 −22 Original line number Diff line number Diff line Loading @@ -88,7 +88,6 @@ import android.graphics.ImageDecoder; import android.hardware.display.DisplayManagerGlobal; import android.inputmethodservice.InputMethodService; import android.net.ConnectivityManager; import android.net.IConnectivityManager; import android.net.Proxy; import android.net.Uri; import android.os.AsyncTask; Loading Loading @@ -6546,25 +6545,6 @@ public final class ActivityThread extends ClientTransactionHandler { HardwareRenderer.setDebuggingEnabled(isAppDebuggable || Build.IS_DEBUGGABLE); HardwareRenderer.setPackageName(data.appInfo.packageName); /** * Initialize the default http proxy in this process for the reasons we set the time zone. */ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "Setup proxies"); final IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE); if (b != null) { // In pre-boot mode (doing initial launch to collect password), not // all system is up. This includes the connectivity service, so don't // crash if we can't get it. final IConnectivityManager service = IConnectivityManager.Stub.asInterface(b); try { Proxy.setHttpProxySystemProperty(service.getProxyForNetwork(null)); } catch (RemoteException e) { Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); throw e.rethrowFromSystemServer(); } } Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); // Instrumentation info affects the class loader, so load it before // setting up the app context. final InstrumentationInfo ii; Loading Loading @@ -6603,6 +6583,23 @@ public final class ActivityThread extends ClientTransactionHandler { updateLocaleListFromAppContext(appContext, mResourcesManager.getConfiguration().getLocales()); // Initialize the default http proxy in this process. Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "Setup proxies"); try { // In pre-boot mode (doing initial launch to collect password), not all system is up. // This includes the connectivity service, so trying to obtain ConnectivityManager at // that point would return null. Check whether the ConnectivityService is available, and // avoid crashing with a NullPointerException if it is not. final IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE); if (b != null) { final ConnectivityManager cm = appContext.getSystemService(ConnectivityManager.class); Proxy.setHttpProxyConfiguration(cm.getDefaultProxy()); } } finally { Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } if (!Process.isIsolated()) { final int oldMask = StrictMode.allowThreadDiskWritesMask(); try { Loading Loading @@ -7429,8 +7426,8 @@ public final class ActivityThread extends ClientTransactionHandler { } public static void updateHttpProxy(@NonNull Context context) { final ConnectivityManager cm = ConnectivityManager.from(context); Proxy.setHttpProxySystemProperty(cm.getDefaultProxy()); final ConnectivityManager cm = context.getSystemService(ConnectivityManager.class); Proxy.setHttpProxyConfiguration(cm.getDefaultProxy()); } @UnsupportedAppUsage Loading packages/Connectivity/framework/src/android/net/ConnectivityManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -4606,7 +4606,7 @@ public class ConnectivityManager { // Set HTTP proxy system properties to match network. // TODO: Deprecate this static method and replace it with a non-static version. try { Proxy.setHttpProxySystemProperty(getInstance().getDefaultProxy()); Proxy.setHttpProxyConfiguration(getInstance().getDefaultProxy()); } catch (SecurityException e) { // The process doesn't have ACCESS_NETWORK_STATE, so we can't fetch the proxy. Log.e(TAG, "Can't set proxy properties", e); Loading packages/Connectivity/framework/src/android/net/Proxy.java +17 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,10 @@ package android.net; import android.annotation.Nullable; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.os.Build; Loading Loading @@ -185,7 +187,19 @@ public final class Proxy { /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static final void setHttpProxySystemProperty(ProxyInfo p) { @Deprecated public static void setHttpProxySystemProperty(ProxyInfo p) { setHttpProxyConfiguration(p); } /** * Set HTTP proxy configuration for the process to match the provided ProxyInfo. * * If the provided ProxyInfo is null, the proxy configuration will be cleared. * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public static void setHttpProxyConfiguration(@Nullable ProxyInfo p) { String host = null; String port = null; String exclList = null; Loading @@ -196,11 +210,11 @@ public final class Proxy { exclList = ProxyUtils.exclusionListAsString(p.getExclusionList()); pacFileUrl = p.getPacFileUrl(); } setHttpProxySystemProperty(host, port, exclList, pacFileUrl); setHttpProxyConfiguration(host, port, exclList, pacFileUrl); } /** @hide */ public static final void setHttpProxySystemProperty(String host, String port, String exclList, public static void setHttpProxyConfiguration(String host, String port, String exclList, Uri pacFileUrl) { if (exclList != null) exclList = exclList.replace(",", "|"); if (false) Log.d(TAG, "setHttpProxySystemProperty :"+host+":"+port+" - "+exclList); Loading Loading
core/api/module-lib-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ package android.net { field public static final int TRANSPORT_TEST = 7; // 0x7 } public final class Proxy { method public static void setHttpProxyConfiguration(@Nullable android.net.ProxyInfo); } public final class TcpRepairWindow { ctor public TcpRepairWindow(int, int, int, int, int, int); field public final int maxWindow; Loading
core/java/android/app/ActivityThread.java +19 −22 Original line number Diff line number Diff line Loading @@ -88,7 +88,6 @@ import android.graphics.ImageDecoder; import android.hardware.display.DisplayManagerGlobal; import android.inputmethodservice.InputMethodService; import android.net.ConnectivityManager; import android.net.IConnectivityManager; import android.net.Proxy; import android.net.Uri; import android.os.AsyncTask; Loading Loading @@ -6546,25 +6545,6 @@ public final class ActivityThread extends ClientTransactionHandler { HardwareRenderer.setDebuggingEnabled(isAppDebuggable || Build.IS_DEBUGGABLE); HardwareRenderer.setPackageName(data.appInfo.packageName); /** * Initialize the default http proxy in this process for the reasons we set the time zone. */ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "Setup proxies"); final IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE); if (b != null) { // In pre-boot mode (doing initial launch to collect password), not // all system is up. This includes the connectivity service, so don't // crash if we can't get it. final IConnectivityManager service = IConnectivityManager.Stub.asInterface(b); try { Proxy.setHttpProxySystemProperty(service.getProxyForNetwork(null)); } catch (RemoteException e) { Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); throw e.rethrowFromSystemServer(); } } Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); // Instrumentation info affects the class loader, so load it before // setting up the app context. final InstrumentationInfo ii; Loading Loading @@ -6603,6 +6583,23 @@ public final class ActivityThread extends ClientTransactionHandler { updateLocaleListFromAppContext(appContext, mResourcesManager.getConfiguration().getLocales()); // Initialize the default http proxy in this process. Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "Setup proxies"); try { // In pre-boot mode (doing initial launch to collect password), not all system is up. // This includes the connectivity service, so trying to obtain ConnectivityManager at // that point would return null. Check whether the ConnectivityService is available, and // avoid crashing with a NullPointerException if it is not. final IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE); if (b != null) { final ConnectivityManager cm = appContext.getSystemService(ConnectivityManager.class); Proxy.setHttpProxyConfiguration(cm.getDefaultProxy()); } } finally { Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } if (!Process.isIsolated()) { final int oldMask = StrictMode.allowThreadDiskWritesMask(); try { Loading Loading @@ -7429,8 +7426,8 @@ public final class ActivityThread extends ClientTransactionHandler { } public static void updateHttpProxy(@NonNull Context context) { final ConnectivityManager cm = ConnectivityManager.from(context); Proxy.setHttpProxySystemProperty(cm.getDefaultProxy()); final ConnectivityManager cm = context.getSystemService(ConnectivityManager.class); Proxy.setHttpProxyConfiguration(cm.getDefaultProxy()); } @UnsupportedAppUsage Loading
packages/Connectivity/framework/src/android/net/ConnectivityManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -4606,7 +4606,7 @@ public class ConnectivityManager { // Set HTTP proxy system properties to match network. // TODO: Deprecate this static method and replace it with a non-static version. try { Proxy.setHttpProxySystemProperty(getInstance().getDefaultProxy()); Proxy.setHttpProxyConfiguration(getInstance().getDefaultProxy()); } catch (SecurityException e) { // The process doesn't have ACCESS_NETWORK_STATE, so we can't fetch the proxy. Log.e(TAG, "Can't set proxy properties", e); Loading
packages/Connectivity/framework/src/android/net/Proxy.java +17 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,10 @@ package android.net; import android.annotation.Nullable; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.os.Build; Loading Loading @@ -185,7 +187,19 @@ public final class Proxy { /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static final void setHttpProxySystemProperty(ProxyInfo p) { @Deprecated public static void setHttpProxySystemProperty(ProxyInfo p) { setHttpProxyConfiguration(p); } /** * Set HTTP proxy configuration for the process to match the provided ProxyInfo. * * If the provided ProxyInfo is null, the proxy configuration will be cleared. * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public static void setHttpProxyConfiguration(@Nullable ProxyInfo p) { String host = null; String port = null; String exclList = null; Loading @@ -196,11 +210,11 @@ public final class Proxy { exclList = ProxyUtils.exclusionListAsString(p.getExclusionList()); pacFileUrl = p.getPacFileUrl(); } setHttpProxySystemProperty(host, port, exclList, pacFileUrl); setHttpProxyConfiguration(host, port, exclList, pacFileUrl); } /** @hide */ public static final void setHttpProxySystemProperty(String host, String port, String exclList, public static void setHttpProxyConfiguration(String host, String port, String exclList, Uri pacFileUrl) { if (exclList != null) exclList = exclList.replace(",", "|"); if (false) Log.d(TAG, "setHttpProxySystemProperty :"+host+":"+port+" - "+exclList); Loading