Migrate ICaptivePortal to stable AIDL
Also add required API for the captive portal app to stop using hidden
members.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Merged-In: I62b457e709fa199822bb8f80b0eab990be4ded93
Change-Id: I62b457e709fa199822bb8f80b0eab990be4ded93
diff --git a/Android.bp b/Android.bp
index a21cd28..416613d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -187,7 +187,6 @@
"core/java/android/hardware/radio/ITunerCallback.aidl",
"core/java/android/hardware/soundtrigger/IRecognitionStatusCallback.aidl",
"core/java/android/hardware/usb/IUsbManager.aidl",
- "core/java/android/net/ICaptivePortal.aidl",
"core/java/android/net/IConnectivityManager.aidl",
"core/java/android/net/IIpConnectivityMetrics.aidl",
"core/java/android/net/IEthernetManager.aidl",
@@ -826,6 +825,7 @@
srcs: [
"core/java/android/net/ApfCapabilitiesParcelable.aidl",
"core/java/android/net/DhcpResultsParcelable.aidl",
+ "core/java/android/net/ICaptivePortal.aidl",
"core/java/android/net/INetworkMonitor.aidl",
"core/java/android/net/INetworkMonitorCallbacks.aidl",
"core/java/android/net/IIpMemoryStore.aidl",
diff --git a/api/system-current.txt b/api/system-current.txt
index 7cade61..322786c 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -3025,6 +3025,8 @@
package android.net {
public class CaptivePortal implements android.os.Parcelable {
+ ctor public CaptivePortal(android.os.IBinder);
+ method public void useNetwork();
field public static final int APP_RETURN_DISMISSED = 0; // 0x0
field public static final int APP_RETURN_UNWANTED = 1; // 0x1
field public static final int APP_RETURN_WANTED_AS_IS = 2; // 0x2
diff --git a/api/test-current.txt b/api/test-current.txt
index 1c00cc4..d5ab31f 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -599,6 +599,8 @@
package android.net {
public class CaptivePortal implements android.os.Parcelable {
+ ctor public CaptivePortal(android.os.IBinder);
+ method public void useNetwork();
field public static final int APP_RETURN_DISMISSED = 0; // 0x0
field public static final int APP_RETURN_UNWANTED = 1; // 0x1
field public static final int APP_RETURN_WANTED_AS_IS = 2; // 0x2
diff --git a/core/java/android/net/CaptivePortal.java b/core/java/android/net/CaptivePortal.java
index 4047068..3b01266 100644
--- a/core/java/android/net/CaptivePortal.java
+++ b/core/java/android/net/CaptivePortal.java
@@ -45,6 +45,8 @@
private final IBinder mBinder;
/** @hide */
+ @SystemApi
+ @TestApi
public CaptivePortal(IBinder binder) {
mBinder = binder;
}
@@ -107,6 +109,8 @@
* connectivity for apps because the captive portal is still in place.
* @hide
*/
+ @SystemApi
+ @TestApi
public void useNetwork() {
try {
ICaptivePortal.Stub.asInterface(mBinder).appResponse(APP_RETURN_WANTED_AS_IS);
diff --git a/core/java/android/net/ICaptivePortal.aidl b/core/java/android/net/ICaptivePortal.aidl
index a013e79..56ae57d 100644
--- a/core/java/android/net/ICaptivePortal.aidl
+++ b/core/java/android/net/ICaptivePortal.aidl
@@ -20,7 +20,6 @@
* Interface to inform NetworkMonitor of decisions of app handling captive portal.
* @hide
*/
-interface ICaptivePortal
-{
- oneway void appResponse(int response);
+oneway interface ICaptivePortal {
+ void appResponse(int response);
}