Remove EXTRA_PROXY_INFO.
This has been deprecated since M because it very error-prone, and
there are documented replacements.
Test: m
Bug: 171872228
Change-Id: Ide9846a26fc440b3ec5b4e4b444a046e738de3d6
diff --git a/framework/src/android/net/ProxyInfo.java b/framework/src/android/net/ProxyInfo.java
index 745e20f..0deda37 100644
--- a/framework/src/android/net/ProxyInfo.java
+++ b/framework/src/android/net/ProxyInfo.java
@@ -37,8 +37,9 @@
* 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 f572b46..bc0929c 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 @@
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 @@
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);