From 08d3691f9e66736dc5db465c1306b77819c85dd0 Mon Sep 17 00:00:00 2001 From: Chiachang Wang Date: Thu, 18 Mar 2021 16:20:27 +0800 Subject: [PATCH] Send a Network instead of network id for wifi no internet dialog It's a refactor work for incoming connectivity mainline. The network information contained in the no internet notification action was placed the target network id. The receiver which is Settings will need to construct the network from the network id using the hidden Network constructor. Since Network is moving into module, Settings will not be able to access it. Apps should use Network instead of network id, so just send the network object to Settings. Bug: 172183305 Test: manually test with no internet dialog and check the behavior and log Test: atest FrameworksNetTests Change-Id: I68acc70a26a27eeeb9ab7af068a459905839f942 --- services/core/java/com/android/server/ConnectivityService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 3194bdcaad..4f0f980fa8 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -4350,7 +4350,7 @@ public class ConnectivityService extends IConnectivityManager.Stub Intent intent = new Intent(action); if (type != NotificationType.PRIVATE_DNS_BROKEN) { - intent.setData(Uri.fromParts("netId", Integer.toString(nai.network.getNetId()), null)); + intent.putExtra(ConnectivityManager.EXTRA_NETWORK, nai.network); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // Some OEMs have their own Settings package. Thus, need to get the current using // Settings package name instead of just use default name "com.android.settings".