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

Commit ab3fed9b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix null App name in Wi-Fi scanning prompt dialog" into qt-dev

parents 76ffb2df b0aee6ab
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -2237,6 +2237,8 @@
    <string name="wifi_carrier_content">Connect via <xliff:g id="name">%1$s</xliff:g></string>
    <string name="wifi_carrier_content">Connect via <xliff:g id="name">%1$s</xliff:g></string>
    <string name="wifi_scan_always_turnon_message">To improve location accuracy and for other purposes, <xliff:g id="app_name">%1$s</xliff:g> wants to turn on network scanning, even when Wi-Fi is off.\n\nAllow this for all apps that want to scan?</string>
    <string name="wifi_scan_always_turnon_message">To improve location accuracy and for other purposes, <xliff:g id="app_name">%1$s</xliff:g> wants to turn on network scanning, even when Wi-Fi is off.\n\nAllow this for all apps that want to scan?</string>
    <!-- Message to inform user, an unknown app want to enable network scanning.  [CHAR LIMIT=200] -->
    <string name="wifi_scan_always_turn_on_message_unknown">To improve location accuracy and for other purposes, an unknown app wants to turn on network scanning, even when Wi\u2011Fi is off.\n\nAllow this for all apps that want to scan?</string>
    <!-- Message informing the user how to turn off  [CHAR LIMIT=200] -->
    <!-- Message informing the user how to turn off  [CHAR LIMIT=200] -->
    <string name="wifi_scan_always_turnoff_message">To turn this off, go to Advanced in the overflow menu.</string>
    <string name="wifi_scan_always_turnoff_message">To turn this off, go to Advanced in the overflow menu.</string>
    <string name="wifi_scan_always_confirm_allow">Allow</string>
    <string name="wifi_scan_always_confirm_allow">Allow</string>
+4 −1
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.pm.PackageManager;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.Bundle;
import android.provider.Settings;
import android.provider.Settings;
import android.text.TextUtils;


import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.DialogFragment;
@@ -132,7 +133,9 @@ public class WifiScanModeActivity extends FragmentActivity {
        @Override
        @Override
        public Dialog onCreateDialog(Bundle savedInstanceState) {
        public Dialog onCreateDialog(Bundle savedInstanceState) {
            return new AlertDialog.Builder(getActivity())
            return new AlertDialog.Builder(getActivity())
                    .setMessage(getString(R.string.wifi_scan_always_turnon_message, mApp))
                    .setMessage(TextUtils.isEmpty(mApp) ?
                        getString(R.string.wifi_scan_always_turn_on_message_unknown) :
                        getString(R.string.wifi_scan_always_turnon_message, mApp))
                    .setPositiveButton(R.string.wifi_scan_always_confirm_allow,
                    .setPositiveButton(R.string.wifi_scan_always_confirm_allow,
                            new DialogInterface.OnClickListener() {
                            new DialogInterface.OnClickListener() {
                                public void onClick(DialogInterface dialog, int whichButton) {
                                public void onClick(DialogInterface dialog, int whichButton) {