Merge "Add startCaptivePortalApp to system API" am: 1756295fc5 am: c5472a3cf7 am: 8020cb4517

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639899

Change-Id: Ia3be29892f62b82d23a165bc8334a083c674aefb
This commit is contained in:
Chiachang Wang
2021-03-19 13:09:03 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 2 deletions

View File

@@ -4469,12 +4469,20 @@ public class ConnectivityManager {
/**
* Requests that the system open the captive portal app on the specified network.
*
* <p>This is to be used on networks where a captive portal was detected, as per
* {@link NetworkCapabilities#NET_CAPABILITY_CAPTIVE_PORTAL}.
*
* @param network The network to log into.
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
public void startCaptivePortalApp(Network network) {
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
@RequiresPermission(anyOf = {
android.Manifest.permission.NETWORK_SETTINGS,
android.Manifest.permission.NETWORK_STACK,
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
})
public void startCaptivePortalApp(@NonNull Network network) {
try {
mService.startCaptivePortalApp(network);
} catch (RemoteException e) {