Replace the way to get the network for no internet dialog

It's a refactor work for incoming connectivity mainline. The
network information contained in the no ineternet 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.

Update the corresponding logic in Settings.

Bug: 172183305
Test: manually test with no internet dialog and check the
      behavior and log
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiNoInternetDialogTest
Change-Id: I75c04d6f1c2159ae990f6015551eb39d99266336
diff --git a/src/com/android/settings/wifi/WifiNoInternetDialog.java b/src/com/android/settings/wifi/WifiNoInternetDialog.java
index ccfda3a..10f4c79 100644
--- a/src/com/android/settings/wifi/WifiNoInternetDialog.java
+++ b/src/com/android/settings/wifi/WifiNoInternetDialog.java
@@ -65,22 +65,17 @@
         super.onCreate(savedInstanceState);
 
         final Intent intent = getIntent();
-        if (intent == null || !isKnownAction(intent) || !"netId".equals(intent.getScheme())) {
+        if (intent == null || !isKnownAction(intent)) {
             Log.e(TAG, "Unexpected intent " + intent + ", exiting");
             finish();
             return;
         }
 
         mAction = intent.getAction();
-
-        try {
-            mNetwork = new Network(Integer.parseInt(intent.getData().getSchemeSpecificPart()));
-        } catch (NullPointerException|NumberFormatException e) {
-            mNetwork = null;
-        }
+        mNetwork = intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK);
 
         if (mNetwork == null) {
-            Log.e(TAG, "Can't determine network from '" + intent.getData() + "' , exiting");
+            Log.e(TAG, "Can't determine network from intent extra, exiting");
             finish();
             return;
         }