Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 275e6f75 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'no-internet-notification' into mnc-dev

* changes:
  Pass in the netId using intent data, not intent extras.
  Reword "no internet access" dialog to conform with mocks.
parents 3e0514d7 25935892
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1591,7 +1591,7 @@
    <string name="wifi_hotspot_connect">CONNECT</string>

    <!-- Dialog text to tell the user that the selected network does not have Internet access. -->
    <string name="no_internet_access_text">This network has no Internet access. Use this network anyway?</string>
    <string name="no_internet_access_text">This network has no Internet access. Stay connected?</string>
    <string name="no_internet_access_remember">Don\u2019t ask again for this network</string>

    <!-- Button label to connect to a Wi-Fi network -->
+11 −5
Original line number Diff line number Diff line
@@ -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;
        }
@@ -112,8 +118,8 @@ public final class WifiNoInternetDialog extends AlertActivity implements
        final AlertController.AlertParams ap = mAlertParams;
        ap.mTitle = mNetworkName;
        ap.mMessage = getString(R.string.no_internet_access_text);
        ap.mPositiveButtonText = getString(android.R.string.ok);
        ap.mNegativeButtonText = getString(android.R.string.cancel);
        ap.mPositiveButtonText = getString(R.string.yes);
        ap.mNegativeButtonText = getString(R.string.no);
        ap.mPositiveButtonListener = this;
        ap.mNegativeButtonListener = this;