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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user