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

Commit d2b8ec4f authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android (Google) Code Review
Browse files

Merge "Remove EXTRA_PROXY_INFO." into sc-dev

parents 39f3d9bb bd446384
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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";
  }
+4 −0
Original line number Diff line number Diff line
@@ -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);
  }
+1 −0
Original line number Diff line number Diff line
@@ -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";
+3 −2
Original line number Diff line number Diff line
@@ -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 {

+6 −1
Original line number Diff line number Diff line
@@ -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);