diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-06-10 22:49:52 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2015-06-10 23:38:16 +0900 |
commit | 25935892092a9efe31c075555f0e9e6fc72d795c (patch) | |
tree | c1027ae921c560689e559d024df2f204beb698c6 /src/com/android/settings/wifi | |
parent | dcc61554263e91c80b27ab64a9bc80302fda096f (diff) | |
download | packages_apps_Settings-25935892092a9efe31c075555f0e9e6fc72d795c.zip packages_apps_Settings-25935892092a9efe31c075555f0e9e6fc72d795c.tar.gz packages_apps_Settings-25935892092a9efe31c075555f0e9e6fc72d795c.tar.bz2 |
Pass in the netId using intent data, not intent extras.
This allows ConnectivityService to use different PendingIntents
for different dialogs; two PendingIntents that differ in their
data are treated as different, but two PendingIntents that differ
only in their extras are treated as being the same.
Bug: 20081183
Change-Id: Ie1bdcf2a0a0747be815ea528db0cb34f5ab415b9
Diffstat (limited to 'src/com/android/settings/wifi')
-rw-r--r-- | src/com/android/settings/wifi/WifiNoInternetDialog.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/settings/wifi/WifiNoInternetDialog.java b/src/com/android/settings/wifi/WifiNoInternetDialog.java index 9705248..b870873 100644 --- a/src/com/android/settings/wifi/WifiNoInternetDialog.java +++ b/src/com/android/settings/wifi/WifiNoInternetDialog.java @@ -54,15 +54,21 @@ public final class WifiNoInternetDialog extends AlertActivity implements final Intent intent = getIntent(); if (intent == null || - !intent.getAction().equals(ConnectivityManager.ACTION_PROMPT_UNVALIDATED)) { + !intent.getAction().equals(ConnectivityManager.ACTION_PROMPT_UNVALIDATED) || + !"netId".equals(intent.getScheme())) { Log.e(TAG, "Unexpected intent " + intent + ", exiting"); finish(); return; } - mNetwork = intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK); + try { + mNetwork = new Network(Integer.parseInt(intent.getData().getSchemeSpecificPart())); + } catch (NullPointerException|NumberFormatException e) { + mNetwork = null; + } + if (mNetwork == null) { - Log.e(TAG, "ACTION_PROMPT_UNVALIDATED for null network, exiting"); + Log.e(TAG, "Can't determine network from '" + intent.getData() + "' , exiting"); finish(); return; } |