Merge "Bad Wi-Fi: Change strings to carrier specs" into nyc-dr1-dev
This commit is contained in:
@@ -1752,10 +1752,11 @@
|
|||||||
<string name="no_internet_access_remember">Don\u2019t ask again for this network</string>
|
<string name="no_internet_access_remember">Don\u2019t ask again for this network</string>
|
||||||
|
|
||||||
<!-- Dialog text to tell the user that the selected network has lost Internet access, and asking the user whether they want to avoid this network. -->
|
<!-- Dialog text to tell the user that the selected network has lost Internet access, and asking the user whether they want to avoid this network. -->
|
||||||
<string name="lost_internet_access_title">Switch to cellular data?</string>
|
<string name="lost_internet_access_title">Wi\u2011Fi is not connected to the Internet</string>
|
||||||
<string name="lost_internet_access_text">Wi\u2011Fi lost Internet access. Your device can switch to cellular automatically when Wi\u2011Fi isn\u2019t working. Additional charges may apply.</string>
|
<string name="lost_internet_access_text">You can switch to the cellular network whenever Wi\u2011Fi has a bad connection. Data usage may apply.</string>
|
||||||
<string name="lost_internet_access_switch">Switch automatically</string>
|
<string name="lost_internet_access_switch">Switch to cellular</string>
|
||||||
<string name="lost_internet_access_cancel">Stay on Wi\u2011Fi</string>
|
<string name="lost_internet_access_cancel">Stay on Wi\u2011Fi</string>
|
||||||
|
<string name="lost_internet_access_persist">Never show again</string>
|
||||||
|
|
||||||
<!-- Button label to connect to a Wi-Fi network -->
|
<!-- Button label to connect to a Wi-Fi network -->
|
||||||
<string name="wifi_connect">Connect</string>
|
<string name="wifi_connect">Connect</string>
|
||||||
|
@@ -138,14 +138,16 @@ public final class WifiNoInternetDialog extends AlertActivity implements
|
|||||||
ap.mPositiveButtonListener = this;
|
ap.mPositiveButtonListener = this;
|
||||||
ap.mNegativeButtonListener = this;
|
ap.mNegativeButtonListener = this;
|
||||||
|
|
||||||
if (ACTION_PROMPT_UNVALIDATED.equals(mAction)) {
|
final LayoutInflater inflater = LayoutInflater.from(ap.mContext);
|
||||||
final LayoutInflater inflater = LayoutInflater.from(ap.mContext);
|
final View checkbox = inflater.inflate(
|
||||||
final View checkbox = inflater.inflate(
|
com.android.internal.R.layout.always_use_checkbox, null);
|
||||||
com.android.internal.R.layout.always_use_checkbox, null);
|
ap.mView = checkbox;
|
||||||
ap.mView = checkbox;
|
mAlwaysAllow = (CheckBox) checkbox.findViewById(com.android.internal.R.id.alwaysUse);
|
||||||
|
|
||||||
mAlwaysAllow = (CheckBox) checkbox.findViewById(com.android.internal.R.id.alwaysUse);
|
if (ACTION_PROMPT_UNVALIDATED.equals(mAction)) {
|
||||||
mAlwaysAllow.setText(getString(R.string.no_internet_access_remember));
|
mAlwaysAllow.setText(getString(R.string.no_internet_access_remember));
|
||||||
|
} else {
|
||||||
|
mAlwaysAllow.setText(getString(R.string.lost_internet_access_persist));
|
||||||
}
|
}
|
||||||
|
|
||||||
setupAlert();
|
setupAlert();
|
||||||
@@ -175,6 +177,7 @@ public final class WifiNoInternetDialog extends AlertActivity implements
|
|||||||
Log.d(TAG, "LOST_INTERNET: " + action);
|
Log.d(TAG, "LOST_INTERNET: " + action);
|
||||||
// Only ever set the setting to 1. The values understood by ConnectivityService are null
|
// Only ever set the setting to 1. The values understood by ConnectivityService are null
|
||||||
// (use carrier default) or 1 (avoid bad networks regardless of carrier).
|
// (use carrier default) or 1 (avoid bad networks regardless of carrier).
|
||||||
|
// TODO: Use a value other than 1 here to indicate a persisted "yes" or "no" given mAlwaysAllow.
|
||||||
if (accept) {
|
if (accept) {
|
||||||
Settings.Global.putInt(mAlertParams.mContext.getContentResolver(),
|
Settings.Global.putInt(mAlertParams.mContext.getContentResolver(),
|
||||||
Settings.Global.NETWORK_AVOID_BAD_WIFI, 1);
|
Settings.Global.NETWORK_AVOID_BAD_WIFI, 1);
|
||||||
|
Reference in New Issue
Block a user