From 538f079d20e79aad0d5076af10ea98eb8369553b Mon Sep 17 00:00:00 2001 From: lifr Date: Mon, 28 Jun 2021 15:09:27 +0800 Subject: [PATCH] Cleanup the public API getActiveNetworkForUid on AOSP In order to make ConnectivityService the mainline module in ANDROID 12, The earliest ConnectivityService API getActiveNetworkForUid was exposed. But after that public api getActiveNetworkForUid and all callers (Outside the module) has been deleted or replaced in android 12 version. So we should delete the public API in AOSP to keep the APIs of Android 12 & AOSP consistent and also avoid using it again in AOSP. The commit is equivalent to ag/14029494, but done in a different repo. Bug: 183465229 Test: atest ConnectivityControllerTest Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f Change-Id: I50a39d6391c88bbb914a63fdb17bae6851591c01 --- framework/api/current.txt | 1 - framework/src/android/net/ConnectivityManager.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/api/current.txt b/framework/api/current.txt index 715a532b60..13ecb1236d 100644 --- a/framework/api/current.txt +++ b/framework/api/current.txt @@ -68,7 +68,6 @@ package android.net { method public boolean bindProcessToNetwork(@Nullable android.net.Network); method @NonNull public android.net.SocketKeepalive createSocketKeepalive(@NonNull android.net.Network, @NonNull android.net.IpSecManager.UdpEncapsulationSocket, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback); method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.Network getActiveNetwork(); - method @Nullable @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public android.net.Network getActiveNetworkForUid(int); method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo getActiveNetworkInfo(); method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo[] getAllNetworkInfo(); method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.Network[] getAllNetworks(); diff --git a/framework/src/android/net/ConnectivityManager.java b/framework/src/android/net/ConnectivityManager.java index 14ec608354..eecd12cf3e 100644 --- a/framework/src/android/net/ConnectivityManager.java +++ b/framework/src/android/net/ConnectivityManager.java @@ -1187,7 +1187,8 @@ public class ConnectivityManager { * * @return a {@link Network} object for the current default network for the * given UID or {@code null} if no default network is currently active - * TODO: b/183465229 Cleanup getActiveNetworkForUid once b/165835257 is fixed + * + * @hide */ @RequiresPermission(android.Manifest.permission.NETWORK_STACK) @Nullable