Merge "Remove EXTRA_PROXY_INFO." into sc-dev

This commit is contained in:
Lorenzo Colitti
2021-04-27 13:57:12 +00:00
committed by Android (Google) Code Review
5 changed files with 14 additions and 4 deletions

View File

@@ -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";
}

View File

@@ -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);
}

View File

@@ -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";

View File

@@ -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 {

View File

@@ -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);