From 1e6b1860231ec42434d17e1d857a09ca30f790f1 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Sun, 20 Jan 2019 14:00:34 +0900 Subject: 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 --- Android.bp | 2 +- api/system-current.txt | 2 ++ api/test-current.txt | 2 ++ core/java/android/net/CaptivePortal.java | 4 ++++ core/java/android/net/ICaptivePortal.aidl | 5 ++--- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Android.bp b/Android.bp index a21cd2803267..416613d03e79 100644 --- a/Android.bp +++ b/Android.bp @@ -187,7 +187,6 @@ java_defaults { "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 @@ aidl_interface { 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 7cade61d9ad5..322786c713bf 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -3025,6 +3025,8 @@ package android.metrics { 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 1c00cc4ae70c..d5ab31f9c74c 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -599,6 +599,8 @@ package android.media.audiofx { 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 4047068f1c7b..3b0126673779 100644 --- a/core/java/android/net/CaptivePortal.java +++ b/core/java/android/net/CaptivePortal.java @@ -45,6 +45,8 @@ public class CaptivePortal implements Parcelable { private final IBinder mBinder; /** @hide */ + @SystemApi + @TestApi public CaptivePortal(IBinder binder) { mBinder = binder; } @@ -107,6 +109,8 @@ public class CaptivePortal implements Parcelable { * 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 a013e79106e7..56ae57dc0e8d 100644 --- a/core/java/android/net/ICaptivePortal.aidl +++ b/core/java/android/net/ICaptivePortal.aidl @@ -20,7 +20,6 @@ package android.net; * 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); } -- cgit v1.2.3-59-g8ed1b