• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisão817f4b339bf8315a513c500d232a086c40b9299c (tree)
Hora2021-07-01 20:01:42
AutorHugh Chen <hughchen@goog...>
CommiterAndroid Build Coastguard Worker

Mensagem de Log

RESTRICT AUTOMERGE Fix phishing attacks over Bluetooth due to unclear warning message

This CL add more prompts presented for users to avoid phishing attacks.

Screenshot:
https://screenshot.googleplex.com/p5PZbphN46ddPFV.png
https://screenshot.googleplex.com/6Q2wKfPbNQmTtx8.png
https://screenshot.googleplex.com/987VpYgNUZL2K4T.png
https://screenshot.googleplex.com/9eVg6SAGScVXU8U.png

Bug: 167403112
Test: manually test
Change-Id: Iadec059b662fd91754ad573bbe688702cdd3c9af
(cherry picked from commit 10e459921953825d34e70cc4da846aac703d913c)
(cherry picked from commit 80d8b03d027f3dffb85958f849be3b5316791107)

Mudança Sumário

Diff

--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -12212,4 +12212,25 @@
1221212212
1221312213 <!-- Label for button to not allow grant the permission for remote devices. [CHAR_LIMIT=50] -->
1221412214 <string name="request_manage_bluetooth_permission_dont_allow">Don\u2019t allow</string>
12215+
12216+ <!-- Bluetooth sim card permission alert for notification title [CHAR LIMIT=none] -->
12217+ <string name="bluetooth_sim_card_access_notification_title">SIM card access request</string>
12218+ <!-- Bluetooth sim card permission alert for notification content [CHAR LIMIT=none] -->
12219+ <string name="bluetooth_sim_card_access_notification_content">A device wants to access your SIM card. Tap for details.</string>
12220+ <!-- Bluetooth sim card permission alert for dialog title [CHAR LIMIT=none] -->
12221+ <string name="bluetooth_sim_card_access_dialog_title">Allow access to SIM card?</string>
12222+ <!-- Bluetooth sim card permission alert for dialog content [CHAR LIMIT=none] -->
12223+ <string name="bluetooth_sim_card_access_dialog_content">A Bluetooth device, <xliff:g id="device_name" example="My device">%1$s</xliff:g>, wants to access data on your SIM card. This includes your contacts.\n\nWhile connected, <xliff:g id="device_name" example="My device">%2$s</xliff:g> will receive all calls made to <xliff:g id="phone_number" example="0912345678">%3$s</xliff:g>.</string>
12224+ <!-- Bluetooth connect permission alert for notification title [CHAR LIMIT=none] -->
12225+ <string name="bluetooth_connect_access_notification_title">Bluetooth device available</string>
12226+ <!-- Bluetooth connect permission alert for notification content [CHAR LIMIT=none] -->
12227+ <string name="bluetooth_connect_access_notification_content">A device wants to connect. Tap for details.</string>
12228+ <!-- Bluetooth connect permission alert for dialog title [CHAR LIMIT=none] -->
12229+ <string name="bluetooth_connect_access_dialog_title">Connect to Bluetooth device?</string>
12230+ <!-- Bluetooth connect permission alert for dialog content [CHAR LIMIT=none] -->
12231+ <string name="bluetooth_connect_access_dialog_content"><xliff:g id="device_name" example="My device">%1$s</xliff:g> wants to connect to this phone.\n\nYou haven\u2019t connected to <xliff:g id="device_name" example="My device">%2$s</xliff:g> before.</string>
12232+ <!-- Strings for Dialog don't connect button -->
12233+ <string name="bluetooth_connect_access_dialog_negative">Don\u2019t connect</string>
12234+ <!-- Strings for Dialog connect button -->
12235+ <string name="bluetooth_connect_access_dialog_positive">Connect</string>
1221512236 </resources>
--- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java
+++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java
@@ -25,6 +25,7 @@ import android.content.DialogInterface;
2525 import android.content.Intent;
2626 import android.content.IntentFilter;
2727 import android.os.Bundle;
28+import android.telephony.TelephonyManager;
2829 import android.util.Log;
2930 import android.view.View;
3031 import android.widget.Button;
@@ -94,13 +95,13 @@ public class BluetoothPermissionActivity extends AlertActivity implements
9495 if(DEBUG) Log.i(TAG, "onCreate() Request type: " + mRequestType);
9596
9697 if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) {
97- showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType);
98+ showDialog(getString(R.string.bluetooth_connect_access_dialog_title), mRequestType);
9899 } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) {
99100 showDialog(getString(R.string.bluetooth_phonebook_access_dialog_title), mRequestType);
100101 } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) {
101102 showDialog(getString(R.string.bluetooth_message_access_dialog_title), mRequestType);
102103 } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_SIM_ACCESS) {
103- showDialog(getString(R.string.bluetooth_sap_request), mRequestType);
104+ showDialog(getString(R.string.bluetooth_sim_card_access_dialog_title), mRequestType);
104105 }
105106 else {
106107 Log.e(TAG, "Error: bad request type: " + mRequestType);
@@ -133,9 +134,14 @@ public class BluetoothPermissionActivity extends AlertActivity implements
133134 p.mView = createSapDialogView();
134135 break;
135136 }
136- p.mPositiveButtonText = getString(R.string.allow);
137+ p.mPositiveButtonText = getString(
138+ requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION
139+ ? R.string.bluetooth_connect_access_dialog_positive : R.string.allow);
137140 p.mPositiveButtonListener = this;
138- p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow);
141+ p.mNegativeButtonText = getString(
142+ requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION
143+ ? R.string.bluetooth_connect_access_dialog_negative
144+ : R.string.request_manage_bluetooth_permission_dont_allow);
139145 p.mNegativeButtonListener = this;
140146 mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
141147 setupAlert();
@@ -156,8 +162,8 @@ public class BluetoothPermissionActivity extends AlertActivity implements
156162 String mRemoteName = Utils.createRemoteName(this, mDevice);
157163 mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null);
158164 messageView = (TextView)mView.findViewById(R.id.message);
159- messageView.setText(getString(R.string.bluetooth_connection_dialog_text,
160- mRemoteName));
165+ messageView.setText(getString(R.string.bluetooth_connect_access_dialog_content,
166+ mRemoteName, mRemoteName));
161167 return mView;
162168 }
163169
@@ -181,10 +187,11 @@ public class BluetoothPermissionActivity extends AlertActivity implements
181187
182188 private View createSapDialogView() {
183189 String mRemoteName = Utils.createRemoteName(this, mDevice);
190+ TelephonyManager tm = getSystemService(TelephonyManager.class);
184191 mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null);
185192 messageView = (TextView)mView.findViewById(R.id.message);
186- messageView.setText(getString(R.string.bluetooth_sap_acceptance_dialog_text,
187- mRemoteName, mRemoteName));
193+ messageView.setText(getString(R.string.bluetooth_sim_card_access_dialog_content,
194+ mRemoteName, mRemoteName, tm.getLine1Number()));
188195 return mView;
189196 }
190197
--- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java
+++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java
@@ -144,13 +144,17 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
144144 R.string.bluetooth_message_access_notification_content);
145145 break;
146146 case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS:
147- title = context.getString(R.string.bluetooth_sap_request);
148- message = context.getString(R.string.bluetooth_sap_acceptance_dialog_text,
147+ title = context.getString(
148+ R.string.bluetooth_sim_card_access_notification_title);
149+ message = context.getString(
150+ R.string.bluetooth_sim_card_access_notification_content,
149151 deviceAlias, deviceAlias);
150152 break;
151153 default:
152- title = context.getString(R.string.bluetooth_connection_permission_request);
153- message = context.getString(R.string.bluetooth_connection_dialog_text,
154+ title = context.getString(
155+ R.string.bluetooth_connect_access_notification_title);
156+ message = context.getString(
157+ R.string.bluetooth_connect_access_notification_content,
154158 deviceAlias, deviceAlias);
155159 break;
156160 }