Merge "Bump the required SDK level to U for isUidNetworkingBlocked" into main
This commit is contained in:
commit
b5391d27cc
1 changed files with 6 additions and 1 deletions
|
|
@ -74,6 +74,7 @@ import android.util.Range;
|
|||
import android.util.SparseIntArray;
|
||||
|
||||
import com.android.internal.annotations.GuardedBy;
|
||||
import com.android.modules.utils.build.SdkLevel;
|
||||
|
||||
import libcore.net.event.NetworkEventDispatcher;
|
||||
|
||||
|
|
@ -6278,9 +6279,13 @@ public class ConnectivityManager {
|
|||
// Only the system server process and the network stack have access.
|
||||
@FlaggedApi(Flags.SUPPORT_IS_UID_NETWORKING_BLOCKED)
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
@RequiresApi(Build.VERSION_CODES.TIRAMISU) // BPF maps were only mainlined in T
|
||||
// Note b/326143935 kernel bug can trigger crash on some T device.
|
||||
@RequiresApi(VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
@RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK)
|
||||
public boolean isUidNetworkingBlocked(int uid, boolean isNetworkMetered) {
|
||||
if (!SdkLevel.isAtLeastU()) {
|
||||
Log.wtf(TAG, "isUidNetworkingBlocked is not supported on pre-U devices");
|
||||
}
|
||||
final BpfNetMapsReader reader = BpfNetMapsReader.getInstance();
|
||||
// Note that before V, the data saver status in bpf is written by ConnectivityService
|
||||
// when receiving {@link #ACTION_RESTRICT_BACKGROUND_CHANGED}. Thus,
|
||||
|
|
|
|||
Loading…
Reference in a new issue