Merge "[FUI22] Support getAllNetworkStateSnapshot" am: 4c73e05c1d am: 773a813dc2 am: ee3fc01443
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614779 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I52f8339bd1cda35a3f26f28fd3c0165f6f6ff91e
This commit is contained in:
@@ -1258,6 +1258,25 @@ public class ConnectivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of {@link NetworkStateSnapshot}s, one for each network that is currently
|
||||
* connected.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
@RequiresPermission(anyOf = {
|
||||
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK,
|
||||
android.Manifest.permission.NETWORK_STACK,
|
||||
android.Manifest.permission.NETWORK_SETTINGS})
|
||||
@NonNull
|
||||
public List<NetworkStateSnapshot> getAllNetworkStateSnapshot() {
|
||||
try {
|
||||
return mService.getAllNetworkStateSnapshot();
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link Network} object currently serving a given type, or
|
||||
* null if the given type is not connected.
|
||||
|
||||
Reference in New Issue
Block a user