diff options
| -rw-r--r-- | core/api/current.txt | 1 | ||||
| -rw-r--r-- | core/api/removed.txt | 4 | ||||
| -rw-r--r-- | core/java/android/net/Proxy.java | 1 | ||||
| -rw-r--r-- | packages/Connectivity/framework/src/android/net/ProxyInfo.java | 5 | ||||
| -rw-r--r-- | services/core/java/com/android/server/connectivity/ProxyTracker.java | 7 |
5 files changed, 14 insertions, 4 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 1030c8feec06..85b6f5615f89 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -26456,7 +26456,6 @@ package android.net { method @Deprecated public static int getDefaultPort(); method @Deprecated public static String getHost(android.content.Context); method @Deprecated public static int getPort(android.content.Context); - field @Deprecated public static final String EXTRA_PROXY_INFO = "android.intent.extra.PROXY_INFO"; field public static final String PROXY_CHANGE_ACTION = "android.intent.action.PROXY_CHANGE"; } diff --git a/core/api/removed.txt b/core/api/removed.txt index ef35c593ed29..cdaa5f53eda0 100644 --- a/core/api/removed.txt +++ b/core/api/removed.txt @@ -252,6 +252,10 @@ package android.net { @IntDef({0x0, 0xa, 0x14, 0x1e}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NetworkBadging.Badging { } + public final class Proxy { + field @Deprecated public static final String EXTRA_PROXY_INFO = "android.intent.extra.PROXY_INFO"; + } + @Deprecated public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory { method @Deprecated public static org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache); } diff --git a/core/java/android/net/Proxy.java b/core/java/android/net/Proxy.java index 77c8a4f4579b..1927e20255e3 100644 --- a/core/java/android/net/Proxy.java +++ b/core/java/android/net/Proxy.java @@ -60,6 +60,7 @@ public final class Proxy { * {@link ConnectivityManager#getDefaultProxy()} or * {@link ConnectivityManager#getLinkProperties(Network)}.{@link LinkProperties#getHttpProxy()} * to get the proxy for the Network(s) they are using. + * @removed */ @Deprecated public static final String EXTRA_PROXY_INFO = "android.intent.extra.PROXY_INFO"; diff --git a/packages/Connectivity/framework/src/android/net/ProxyInfo.java b/packages/Connectivity/framework/src/android/net/ProxyInfo.java index 745e20f1542e..0deda371f6b9 100644 --- a/packages/Connectivity/framework/src/android/net/ProxyInfo.java +++ b/packages/Connectivity/framework/src/android/net/ProxyInfo.java @@ -37,8 +37,9 @@ import java.util.Locale; * Apache HTTP stack. So {@link URLConnection} and Apache's {@code HttpClient} will use * them automatically. * - * Other HTTP stacks will need to obtain the proxy info from - * {@link Proxy#PROXY_CHANGE_ACTION} broadcast as the extra {@link Proxy#EXTRA_PROXY_INFO}. + * Other HTTP stacks will need to obtain the proxy info by watching for the + * {@link Proxy#PROXY_CHANGE_ACTION} broadcast and calling methods such as + * {@link android.net.ConnectivityManager#getDefaultProxy}. */ public class ProxyInfo implements Parcelable { diff --git a/services/core/java/com/android/server/connectivity/ProxyTracker.java b/services/core/java/com/android/server/connectivity/ProxyTracker.java index f572b46a9b58..bc0929c20659 100644 --- a/services/core/java/com/android/server/connectivity/ProxyTracker.java +++ b/services/core/java/com/android/server/connectivity/ProxyTracker.java @@ -55,6 +55,11 @@ public class ProxyTracker { private static final String TAG = ProxyTracker.class.getSimpleName(); private static final boolean DBG = true; + // EXTRA_PROXY_INFO is now @removed. In order to continue sending it, hardcode its value here. + // The Proxy.EXTRA_PROXY_INFO constant is not visible to this code because android.net.Proxy + // a hidden platform constant not visible to mainline modules. + private static final String EXTRA_PROXY_INFO = "android.intent.extra.PROXY_INFO"; + @NonNull private final Context mContext; @@ -253,7 +258,7 @@ public class ProxyTracker { Intent intent = new Intent(Proxy.PROXY_CHANGE_ACTION); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING | Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); - intent.putExtra(Proxy.EXTRA_PROXY_INFO, proxyInfo); + intent.putExtra(EXTRA_PROXY_INFO, proxyInfo); final long ident = Binder.clearCallingIdentity(); try { mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL); |