From 9356205dfc434d1c82d943a08d33131edac215ae Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 01/19] RESTRICT AUTOMERGE Update string 1. Replace "An untrusted Bluetooth device" to "A Bluetooth device". 2. Replace "Deny" to "Don't allow" https://docs.google.com/document/d/18bVSIAyX4MNpNeCvxqyZu7CXcBUcdV0pnh-gzVprjqU/edit?ts=60709637 Bug: 167403112 Test: send intent to test right prompts message is pop up. make -j42 RunSettingsRoboTests Change-Id: I38da15d4b1fb08671f6352458cbf3f735b4083bc (cherry picked from commit 38fc9a91b53e82c092c1324f5ba3085740e7dcdf) --- res/values/strings.xml | 11 +++++++---- .../bluetooth/BluetoothPermissionActivity.java | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 5652c0156ad..16753148eb1 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -12149,15 +12149,18 @@ media - Untrusted device wants to access your messages. Tap for details. + A device wants to access your messages. Tap for details. Allow access to messages? - An untrusted Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. - Untrusted device wants to access your contacts and call log. Tap for details. + A device wants to access your contacts and call log. Tap for details. Allow access to contacts and call log? - An untrusted Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + + + Don\u2019t allow diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 0cca4a4ec51..8794b08129b 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -135,7 +135,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements } p.mPositiveButtonText = getString(R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.deny); + p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); From f4f2fae30639266131b847260e7fc1b20c2dfa31 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 02/19] RESTRICT AUTOMERGE Update string 1. Replace "An untrusted Bluetooth device" to "A Bluetooth device". 2. Replace "Deny" to "Don't allow" https://docs.google.com/document/d/18bVSIAyX4MNpNeCvxqyZu7CXcBUcdV0pnh-gzVprjqU/edit?ts=60709637 Bug: 167403112 Test: send intent to test right prompts message is pop up. make -j42 RunSettingsRoboTests Change-Id: I38da15d4b1fb08671f6352458cbf3f735b4083bc (cherry picked from commit 38fc9a91b53e82c092c1324f5ba3085740e7dcdf) --- res/values/strings.xml | 11 +++++++---- .../bluetooth/BluetoothPermissionActivity.java | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 226398ea5eb..ad87e75f871 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -12198,15 +12198,18 @@ Unavailable because bedtime mode is on - Untrusted device wants to access your messages. Tap for details. + A device wants to access your messages. Tap for details. Allow access to messages? - An untrusted Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. - Untrusted device wants to access your contacts and call log. Tap for details. + A device wants to access your contacts and call log. Tap for details. Allow access to contacts and call log? - An untrusted Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + + + Don\u2019t allow diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 0cca4a4ec51..8794b08129b 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -135,7 +135,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements } p.mPositiveButtonText = getString(R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.deny); + p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); From 80d8b03d027f3dffb85958f849be3b5316791107 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 03/19] 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) --- res/values/strings.xml | 21 +++++++++++++++++ .../BluetoothPermissionActivity.java | 23 ++++++++++++------- .../bluetooth/BluetoothPermissionRequest.java | 12 ++++++---- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index ad87e75f871..811a44c7c56 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -12212,4 +12212,25 @@ Don\u2019t allow + + + SIM card access request + + A device wants to access your SIM card. Tap for details. + + Allow access to SIM card? + + A Bluetooth device, %1$s, wants to access data on your SIM card. This includes your contacts.\n\nWhile connected, %2$s will receive all calls made to %3$s. + + Bluetooth device available + + A device wants to connect. Tap for details. + + Connect to Bluetooth device? + + %1$s wants to connect to this phone.\n\nYou haven\u2019t connected to %2$s before. + + Don\u2019t connect + + Connect diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 8794b08129b..211bcc6f4b4 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -25,6 +25,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; +import android.telephony.TelephonyManager; import android.util.Log; import android.view.View; import android.widget.Button; @@ -94,13 +95,13 @@ public class BluetoothPermissionActivity extends AlertActivity implements if(DEBUG) Log.i(TAG, "onCreate() Request type: " + mRequestType); if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) { - showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType); + showDialog(getString(R.string.bluetooth_connect_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) { showDialog(getString(R.string.bluetooth_phonebook_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) { showDialog(getString(R.string.bluetooth_message_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_SIM_ACCESS) { - showDialog(getString(R.string.bluetooth_sap_request), mRequestType); + showDialog(getString(R.string.bluetooth_sim_card_access_dialog_title), mRequestType); } else { Log.e(TAG, "Error: bad request type: " + mRequestType); @@ -133,9 +134,14 @@ public class BluetoothPermissionActivity extends AlertActivity implements p.mView = createSapDialogView(); break; } - p.mPositiveButtonText = getString(R.string.allow); + p.mPositiveButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_positive : R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); + p.mNegativeButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_negative + : R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); @@ -156,8 +162,8 @@ public class BluetoothPermissionActivity extends AlertActivity implements String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_connection_dialog_text, - mRemoteName)); + messageView.setText(getString(R.string.bluetooth_connect_access_dialog_content, + mRemoteName, mRemoteName)); return mView; } @@ -181,10 +187,11 @@ public class BluetoothPermissionActivity extends AlertActivity implements private View createSapDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); + TelephonyManager tm = getSystemService(TelephonyManager.class); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_sap_acceptance_dialog_text, - mRemoteName, mRemoteName)); + messageView.setText(getString(R.string.bluetooth_sim_card_access_dialog_content, + mRemoteName, mRemoteName, tm.getLine1Number())); return mView; } diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index de957a7eb91..791ade425be 100644 --- 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 { R.string.bluetooth_message_access_notification_content); break; case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS: - title = context.getString(R.string.bluetooth_sap_request); - message = context.getString(R.string.bluetooth_sap_acceptance_dialog_text, + title = context.getString( + R.string.bluetooth_sim_card_access_notification_title); + message = context.getString( + R.string.bluetooth_sim_card_access_notification_content, deviceAlias, deviceAlias); break; default: - title = context.getString(R.string.bluetooth_connection_permission_request); - message = context.getString(R.string.bluetooth_connection_dialog_text, + title = context.getString( + R.string.bluetooth_connect_access_notification_title); + message = context.getString( + R.string.bluetooth_connect_access_notification_content, deviceAlias, deviceAlias); break; } From a5046f219a545246f244f0dc003eefdeb1dfeb93 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 04/19] 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) --- res/values/strings.xml | 21 +++++++++++++++++ .../BluetoothPermissionActivity.java | 23 ++++++++++++------- .../bluetooth/BluetoothPermissionRequest.java | 12 ++++++---- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 16753148eb1..d6d780f71d0 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -12163,4 +12163,25 @@ Don\u2019t allow + + + SIM card access request + + A device wants to access your SIM card. Tap for details. + + Allow access to SIM card? + + A Bluetooth device, %1$s, wants to access data on your SIM card. This includes your contacts.\n\nWhile connected, %2$s will receive all calls made to %3$s. + + Bluetooth device available + + A device wants to connect. Tap for details. + + Connect to Bluetooth device? + + %1$s wants to connect to this phone.\n\nYou haven\u2019t connected to %2$s before. + + Don\u2019t connect + + Connect diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 8794b08129b..211bcc6f4b4 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -25,6 +25,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; +import android.telephony.TelephonyManager; import android.util.Log; import android.view.View; import android.widget.Button; @@ -94,13 +95,13 @@ public class BluetoothPermissionActivity extends AlertActivity implements if(DEBUG) Log.i(TAG, "onCreate() Request type: " + mRequestType); if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) { - showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType); + showDialog(getString(R.string.bluetooth_connect_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) { showDialog(getString(R.string.bluetooth_phonebook_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) { showDialog(getString(R.string.bluetooth_message_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_SIM_ACCESS) { - showDialog(getString(R.string.bluetooth_sap_request), mRequestType); + showDialog(getString(R.string.bluetooth_sim_card_access_dialog_title), mRequestType); } else { Log.e(TAG, "Error: bad request type: " + mRequestType); @@ -133,9 +134,14 @@ public class BluetoothPermissionActivity extends AlertActivity implements p.mView = createSapDialogView(); break; } - p.mPositiveButtonText = getString(R.string.allow); + p.mPositiveButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_positive : R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); + p.mNegativeButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_negative + : R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); @@ -156,8 +162,8 @@ public class BluetoothPermissionActivity extends AlertActivity implements String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_connection_dialog_text, - mRemoteName)); + messageView.setText(getString(R.string.bluetooth_connect_access_dialog_content, + mRemoteName, mRemoteName)); return mView; } @@ -181,10 +187,11 @@ public class BluetoothPermissionActivity extends AlertActivity implements private View createSapDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); + TelephonyManager tm = getSystemService(TelephonyManager.class); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_sap_acceptance_dialog_text, - mRemoteName, mRemoteName)); + messageView.setText(getString(R.string.bluetooth_sim_card_access_dialog_content, + mRemoteName, mRemoteName, tm.getLine1Number())); return mView; } diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index de957a7eb91..791ade425be 100644 --- 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 { R.string.bluetooth_message_access_notification_content); break; case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS: - title = context.getString(R.string.bluetooth_sap_request); - message = context.getString(R.string.bluetooth_sap_acceptance_dialog_text, + title = context.getString( + R.string.bluetooth_sim_card_access_notification_title); + message = context.getString( + R.string.bluetooth_sim_card_access_notification_content, deviceAlias, deviceAlias); break; default: - title = context.getString(R.string.bluetooth_connection_permission_request); - message = context.getString(R.string.bluetooth_connection_dialog_text, + title = context.getString( + R.string.bluetooth_connect_access_notification_title); + message = context.getString( + R.string.bluetooth_connect_access_notification_content, deviceAlias, deviceAlias); break; } From 7ce80425eeb4028b984d7d3d3bbd019bf8a5b815 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 05/19] RESTRICT AUTOMERGE Update string 1. Replace "An untrusted Bluetooth device" to "A Bluetooth device". 2. Replace "Deny" to "Don't allow" https://docs.google.com/document/d/18bVSIAyX4MNpNeCvxqyZu7CXcBUcdV0pnh-gzVprjqU/edit?ts=60709637 Bug: 167403112 Test: send intent to test right prompts message is pop up. make -j42 RunSettingsRoboTests Change-Id: I38da15d4b1fb08671f6352458cbf3f735b4083bc (cherry picked from commit 38fc9a91b53e82c092c1324f5ba3085740e7dcdf) --- res/values/strings.xml | 11 +++++++---- .../bluetooth/BluetoothPermissionActivity.java | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index e4906af075f..70e7f17d5a9 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -11316,15 +11316,18 @@ Settings managed by your IT admin - Untrusted device wants to access your messages. Tap for details. + A device wants to access your messages. Tap for details. Allow access to messages? - An untrusted Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. - Untrusted device wants to access your contacts and call log. Tap for details. + A device wants to access your contacts and call log. Tap for details. Allow access to contacts and call log? - An untrusted Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + + + Don\u2019t allow diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 0cca4a4ec51..8794b08129b 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -135,7 +135,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements } p.mPositiveButtonText = getString(R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.deny); + p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); From fa504b8e01405fa529670b6ac6112d0241c2ff86 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 06/19] 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) --- res/values/strings.xml | 21 +++++++++++++++++ .../BluetoothPermissionActivity.java | 23 ++++++++++++------- .../bluetooth/BluetoothPermissionRequest.java | 12 ++++++---- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 70e7f17d5a9..a8a2d73d163 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -11330,4 +11330,25 @@ Don\u2019t allow + + + SIM card access request + + A device wants to access your SIM card. Tap for details. + + Allow access to SIM card? + + A Bluetooth device, %1$s, wants to access data on your SIM card. This includes your contacts.\n\nWhile connected, %2$s will receive all calls made to %3$s. + + Bluetooth device available + + A device wants to connect. Tap for details. + + Connect to Bluetooth device? + + %1$s wants to connect to this phone.\n\nYou haven\u2019t connected to %2$s before. + + Don\u2019t connect + + Connect diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 8794b08129b..211bcc6f4b4 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -25,6 +25,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; +import android.telephony.TelephonyManager; import android.util.Log; import android.view.View; import android.widget.Button; @@ -94,13 +95,13 @@ public class BluetoothPermissionActivity extends AlertActivity implements if(DEBUG) Log.i(TAG, "onCreate() Request type: " + mRequestType); if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) { - showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType); + showDialog(getString(R.string.bluetooth_connect_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) { showDialog(getString(R.string.bluetooth_phonebook_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) { showDialog(getString(R.string.bluetooth_message_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_SIM_ACCESS) { - showDialog(getString(R.string.bluetooth_sap_request), mRequestType); + showDialog(getString(R.string.bluetooth_sim_card_access_dialog_title), mRequestType); } else { Log.e(TAG, "Error: bad request type: " + mRequestType); @@ -133,9 +134,14 @@ public class BluetoothPermissionActivity extends AlertActivity implements p.mView = createSapDialogView(); break; } - p.mPositiveButtonText = getString(R.string.allow); + p.mPositiveButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_positive : R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); + p.mNegativeButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_negative + : R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); @@ -156,8 +162,8 @@ public class BluetoothPermissionActivity extends AlertActivity implements String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_connection_dialog_text, - mRemoteName)); + messageView.setText(getString(R.string.bluetooth_connect_access_dialog_content, + mRemoteName, mRemoteName)); return mView; } @@ -181,10 +187,11 @@ public class BluetoothPermissionActivity extends AlertActivity implements private View createSapDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); + TelephonyManager tm = getSystemService(TelephonyManager.class); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_sap_acceptance_dialog_text, - mRemoteName, mRemoteName)); + messageView.setText(getString(R.string.bluetooth_sim_card_access_dialog_content, + mRemoteName, mRemoteName, tm.getLine1Number())); return mView; } diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index de957a7eb91..791ade425be 100644 --- 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 { R.string.bluetooth_message_access_notification_content); break; case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS: - title = context.getString(R.string.bluetooth_sap_request); - message = context.getString(R.string.bluetooth_sap_acceptance_dialog_text, + title = context.getString( + R.string.bluetooth_sim_card_access_notification_title); + message = context.getString( + R.string.bluetooth_sim_card_access_notification_content, deviceAlias, deviceAlias); break; default: - title = context.getString(R.string.bluetooth_connection_permission_request); - message = context.getString(R.string.bluetooth_connection_dialog_text, + title = context.getString( + R.string.bluetooth_connect_access_notification_title); + message = context.getString( + R.string.bluetooth_connect_access_notification_content, deviceAlias, deviceAlias); break; } From 79ae54ca2d982f1c6bad9f2910109b342ad66940 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 07/19] RESTRICT AUTOMERGE Update string 1. Replace "An untrusted Bluetooth device" to "A Bluetooth device". 2. Replace "Deny" to "Don't allow" https://docs.google.com/document/d/18bVSIAyX4MNpNeCvxqyZu7CXcBUcdV0pnh-gzVprjqU/edit?ts=60709637 Bug: 167403112 Test: send intent to test right prompts message is pop up. make -j42 RunSettingsRoboTests Change-Id: I38da15d4b1fb08671f6352458cbf3f735b4083bc (cherry picked from commit 38fc9a91b53e82c092c1324f5ba3085740e7dcdf) --- res/values/strings.xml | 11 +++++++---- .../bluetooth/BluetoothPermissionActivity.java | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 19ed03f7cfa..5dff727a8f3 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -10087,15 +10087,18 @@ Devices - Untrusted device wants to access your messages. Tap for details. + A device wants to access your messages. Tap for details. Allow access to messages? - An untrusted Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. - Untrusted device wants to access your contacts and call log. Tap for details. + A device wants to access your contacts and call log. Tap for details. Allow access to contacts and call log? - An untrusted Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + + + Don\u2019t allow diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 122292cee65..4047a5de71c 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -137,7 +137,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements } p.mPositiveButtonText = getString(R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.deny); + p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); From 65e3c68e6fbfb1d6762718a190416a2bff36962c Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 08/19] 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) --- res/values/strings.xml | 21 +++++++++++++++++ .../BluetoothPermissionActivity.java | 23 ++++++++++++------- .../bluetooth/BluetoothPermissionRequest.java | 12 ++++++---- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 5dff727a8f3..64cbf901b0d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -10101,4 +10101,25 @@ Don\u2019t allow + + + SIM card access request + + A device wants to access your SIM card. Tap for details. + + Allow access to SIM card? + + A Bluetooth device, %1$s, wants to access data on your SIM card. This includes your contacts.\n\nWhile connected, %2$s will receive all calls made to %3$s. + + Bluetooth device available + + A device wants to connect. Tap for details. + + Connect to Bluetooth device? + + %1$s wants to connect to this phone.\n\nYou haven\u2019t connected to %2$s before. + + Don\u2019t connect + + Connect diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 4047a5de71c..5bad4d5db12 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -25,6 +25,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; +import android.telephony.TelephonyManager; import android.support.v7.preference.Preference; import android.util.Log; import android.view.View; @@ -96,13 +97,13 @@ public class BluetoothPermissionActivity extends AlertActivity implements if(DEBUG) Log.i(TAG, "onCreate() Request type: " + mRequestType); if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) { - showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType); + showDialog(getString(R.string.bluetooth_connect_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) { showDialog(getString(R.string.bluetooth_phonebook_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) { showDialog(getString(R.string.bluetooth_message_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_SIM_ACCESS) { - showDialog(getString(R.string.bluetooth_sap_request), mRequestType); + showDialog(getString(R.string.bluetooth_sim_card_access_dialog_title), mRequestType); } else { Log.e(TAG, "Error: bad request type: " + mRequestType); @@ -135,9 +136,14 @@ public class BluetoothPermissionActivity extends AlertActivity implements p.mView = createSapDialogView(); break; } - p.mPositiveButtonText = getString(R.string.allow); + p.mPositiveButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_positive : R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); + p.mNegativeButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_negative + : R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); @@ -158,8 +164,8 @@ public class BluetoothPermissionActivity extends AlertActivity implements String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_connection_dialog_text, - mRemoteName)); + messageView.setText(getString(R.string.bluetooth_connect_access_dialog_content, + mRemoteName, mRemoteName)); return mView; } @@ -183,10 +189,11 @@ public class BluetoothPermissionActivity extends AlertActivity implements private View createSapDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); + TelephonyManager tm = getSystemService(TelephonyManager.class); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_sap_acceptance_dialog_text, - mRemoteName, mRemoteName)); + messageView.setText(getString(R.string.bluetooth_sim_card_access_dialog_content, + mRemoteName, mRemoteName, tm.getLine1Number())); return mView; } diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index 4783a2811ae..5450f4e4edc 100644 --- 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 { R.string.bluetooth_message_access_notification_content); break; case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS: - title = context.getString(R.string.bluetooth_sap_request); - message = context.getString(R.string.bluetooth_sap_acceptance_dialog_text, + title = context.getString( + R.string.bluetooth_sim_card_access_notification_title); + message = context.getString( + R.string.bluetooth_sim_card_access_notification_content, deviceAlias, deviceAlias); break; default: - title = context.getString(R.string.bluetooth_connection_permission_request); - message = context.getString(R.string.bluetooth_connection_dialog_text, + title = context.getString( + R.string.bluetooth_connect_access_notification_title); + message = context.getString( + R.string.bluetooth_connect_access_notification_content, deviceAlias, deviceAlias); break; } From 3d6641a468bdb296af29bd222b3bc55ed62b78bc Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 09/19] RESTRICT AUTOMERGE Update string 1. Replace "An untrusted Bluetooth device" to "A Bluetooth device". 2. Replace "Deny" to "Don't allow" https://docs.google.com/document/d/18bVSIAyX4MNpNeCvxqyZu7CXcBUcdV0pnh-gzVprjqU/edit?ts=60709637 Bug: 167403112 Test: send intent to test right prompts message is pop up. make -j42 RunSettingsRoboTests Change-Id: I38da15d4b1fb08671f6352458cbf3f735b4083bc (cherry picked from commit 38fc9a91b53e82c092c1324f5ba3085740e7dcdf) --- res/values/strings.xml | 11 +++++++---- .../bluetooth/BluetoothPermissionActivity.java | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index d1a438a9f59..1989a4ddcdb 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -9054,15 +9054,18 @@ This feature is not available on this device - Untrusted device wants to access your messages. Tap for details. + A device wants to access your messages. Tap for details. Allow access to messages? - An untrusted Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your messages.\n\nYou haven\u2019t connected to %2$s before. - Untrusted device wants to access your contacts and call log. Tap for details. + A device wants to access your contacts and call log. Tap for details. Allow access to contacts and call log? - An untrusted Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + A Bluetooth device, %1$s, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to %2$s before. + + + Don\u2019t allow diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 122292cee65..4047a5de71c 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -137,7 +137,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements } p.mPositiveButtonText = getString(R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.deny); + p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); From 8fe8e0fc211d4f36cce2865a17c834573ec25211 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 3 Jun 2021 16:38:24 +0800 Subject: [PATCH 10/19] 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) --- res/values/strings.xml | 21 +++++++++++++++++ .../BluetoothPermissionActivity.java | 23 ++++++++++++------- .../bluetooth/BluetoothPermissionRequest.java | 12 ++++++---- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 1989a4ddcdb..3f23d035adb 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -9068,4 +9068,25 @@ Don\u2019t allow + + + SIM card access request + + A device wants to access your SIM card. Tap for details. + + Allow access to SIM card? + + A Bluetooth device, %1$s, wants to access data on your SIM card. This includes your contacts.\n\nWhile connected, %2$s will receive all calls made to %3$s. + + Bluetooth device available + + A device wants to connect. Tap for details. + + Connect to Bluetooth device? + + %1$s wants to connect to this phone.\n\nYou haven\u2019t connected to %2$s before. + + Don\u2019t connect + + Connect diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 4047a5de71c..5bad4d5db12 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -25,6 +25,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; +import android.telephony.TelephonyManager; import android.support.v7.preference.Preference; import android.util.Log; import android.view.View; @@ -96,13 +97,13 @@ public class BluetoothPermissionActivity extends AlertActivity implements if(DEBUG) Log.i(TAG, "onCreate() Request type: " + mRequestType); if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) { - showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType); + showDialog(getString(R.string.bluetooth_connect_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) { showDialog(getString(R.string.bluetooth_phonebook_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) { showDialog(getString(R.string.bluetooth_message_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_SIM_ACCESS) { - showDialog(getString(R.string.bluetooth_sap_request), mRequestType); + showDialog(getString(R.string.bluetooth_sim_card_access_dialog_title), mRequestType); } else { Log.e(TAG, "Error: bad request type: " + mRequestType); @@ -135,9 +136,14 @@ public class BluetoothPermissionActivity extends AlertActivity implements p.mView = createSapDialogView(); break; } - p.mPositiveButtonText = getString(R.string.allow); + p.mPositiveButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_positive : R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.request_manage_bluetooth_permission_dont_allow); + p.mNegativeButtonText = getString( + requestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION + ? R.string.bluetooth_connect_access_dialog_negative + : R.string.request_manage_bluetooth_permission_dont_allow); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); @@ -158,8 +164,8 @@ public class BluetoothPermissionActivity extends AlertActivity implements String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_connection_dialog_text, - mRemoteName)); + messageView.setText(getString(R.string.bluetooth_connect_access_dialog_content, + mRemoteName, mRemoteName)); return mView; } @@ -183,10 +189,11 @@ public class BluetoothPermissionActivity extends AlertActivity implements private View createSapDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); + TelephonyManager tm = getSystemService(TelephonyManager.class); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); - messageView.setText(getString(R.string.bluetooth_sap_acceptance_dialog_text, - mRemoteName, mRemoteName)); + messageView.setText(getString(R.string.bluetooth_sim_card_access_dialog_content, + mRemoteName, mRemoteName, tm.getLine1Number())); return mView; } diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index 4783a2811ae..5450f4e4edc 100644 --- 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 { R.string.bluetooth_message_access_notification_content); break; case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS: - title = context.getString(R.string.bluetooth_sap_request); - message = context.getString(R.string.bluetooth_sap_acceptance_dialog_text, + title = context.getString( + R.string.bluetooth_sim_card_access_notification_title); + message = context.getString( + R.string.bluetooth_sim_card_access_notification_content, deviceAlias, deviceAlias); break; default: - title = context.getString(R.string.bluetooth_connection_permission_request); - message = context.getString(R.string.bluetooth_connection_dialog_text, + title = context.getString( + R.string.bluetooth_connect_access_notification_title); + message = context.getString( + R.string.bluetooth_connect_access_notification_content, deviceAlias, deviceAlias); break; } From df00a3bc6904b6a0df2637a5f5eae524b7335f5e Mon Sep 17 00:00:00 2001 From: Tsung-Mao Fang Date: Wed, 23 Jun 2021 17:53:59 +0800 Subject: [PATCH 11/19] Consistent color between status bar and app bar In Android S, we add the transparent color to navigation bar and status bar for consistent color between status bar and app bar. So, we should add this change for oveall setting theme since most pages should apply new app bar now. Thus, we don't need to override the subsetting style for different activities one by one. Homepage doesn't have new Android S tool bar, so we shouldn't adopt it. Test: Try to launch all the pages as many as possible. Fix: 190797935 Change-Id: Ic4083de5477371f1d0eea2d66f020e4469fa3f86 --- AndroidManifest.xml | 19 +------------------ res/values-night/themes.xml | 3 +++ res/values/themes.xml | 7 +++++++ 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 6f6482daeb5..d554dd8f57b 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -141,7 +141,6 @@ @@ -182,7 +181,6 @@ @@ -419,7 +417,6 @@ android:label="@string/apn_settings" android:launchMode="singleTask" android:exported="true" - android:theme="@style/Theme.SubSettings" android:configChanges="orientation|keyboardHidden|screenSize"> @@ -474,7 +471,6 @@ @@ -499,7 +495,6 @@ @@ -507,7 +502,6 @@ @@ -713,8 +707,7 @@ + android:label="@string/assist_and_voice_input_title"> @@ -1154,7 +1147,6 @@ @@ -1332,7 +1324,6 @@ @@ -1495,7 +1486,6 @@ @@ -1528,7 +1518,6 @@ @@ -2084,7 +2073,6 @@ @@ -2455,7 +2443,6 @@ @@ -2469,7 +2456,6 @@ @@ -3030,7 +3016,6 @@ @@ -3720,7 +3705,6 @@ android:name="Settings$GestureNavigationSettingsActivity" android:label="@string/gesture_settings_activity_title" android:exported="true" - android:theme="@style/Theme.SubSettings" android:enabled="true"> @@ -3804,7 +3788,6 @@ android:permission="android.permission.BIND_JOB_SERVICE" /> diff --git a/res/values-night/themes.xml b/res/values-night/themes.xml index b95a5a0f87f..a77bb066e8d 100644 --- a/res/values-night/themes.xml +++ b/res/values-night/themes.xml @@ -22,6 +22,9 @@ @*android:color/primary_device_default_settings @*android:color/primary_dark_device_default_settings ?android:attr/colorPrimaryDark + + @android:color/black + ?attr/colorPrimaryDark