Add startCaptivePortalApp to system API
The API is already used by settings and should be usable by setup wizards. It is the only way for a caller outside of the system_server to trigger the captive portal application. The API is already CTS tested in android.net.cts.CaptivePortalTest. Fixes: 182871577 Test: atest CtsNetTestCases:android.net.cts.CaptivePortalTest Change-Id: Ie8d9a546b54524ba837715baa94a07d1f993d8d3
This commit is contained in:
committed by
Chiachang Wang
parent
56564e061c
commit
8238a7665a
@@ -4461,12 +4461,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) {
|
||||
|
||||
Reference in New Issue
Block a user