From 6d996e01383383e42498c31ef1e0e33c990c8212 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 7 Jan 2021 00:58:58 +0000 Subject: [PATCH 1/3] DO NOT MERGE: resolve merge conflicts of c17ec818af7159f4fd678dab3bbad7ef308a7be4 to rvc-qpr-dev Bug: 167403112 Test: send intent to test right prompts message is pop up. make -j42 RunSettingsRoboTests Change-Id: Iec4d1963e626829b696c2047c5979a684119acf7 Merged-In: Iec4d1963e626829b696c2047c5979a684119acf7 (cherry picked from commit dc2b694a5478660ce51814838fb348f9dba71ba2) --- res/values/strings.xml | 13 +++++++++++++ .../bluetooth/BluetoothPermissionActivity.java | 12 ++++++------ .../bluetooth/BluetoothPermissionRequest.java | 9 +++++---- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 8bc30d8c0d6..f02d11f656a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -12196,4 +12196,17 @@ Unavailable because bedtime mode is on + + + Untrusted 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. + + Untrusted 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. diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index be383dc02ba..e40e30dd0a0 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -99,9 +99,9 @@ public class BluetoothPermissionActivity extends AlertActivity implements if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) { showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) { - showDialog(getString(R.string.bluetooth_phonebook_request), mRequestType); + showDialog(getString(R.string.bluetooth_phonebook_access_dialog_title), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) { - showDialog(getString(R.string.bluetooth_map_request), mRequestType); + 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); } @@ -136,9 +136,9 @@ public class BluetoothPermissionActivity extends AlertActivity implements p.mView = createSapDialogView(); break; } - p.mPositiveButtonText = getString(R.string.yes); + p.mPositiveButtonText = getString(R.string.allow); p.mPositiveButtonListener = this; - p.mNegativeButtonText = getString(R.string.no); + p.mNegativeButtonText = getString(R.string.deny); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); @@ -168,7 +168,7 @@ 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_pb_acceptance_dialog_text, + messageView.setText(getString(R.string.bluetooth_phonebook_access_dialog_content, mRemoteName, mRemoteName)); return mView; } @@ -177,7 +177,7 @@ 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_map_acceptance_dialog_text, + messageView.setText(getString(R.string.bluetooth_message_access_dialog_content, mRemoteName, mRemoteName)); return mView; } diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index 5fffa3a2356..177bd893558 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java @@ -140,13 +140,13 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { switch (mRequestType) { case BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS: title = context.getString(R.string.bluetooth_phonebook_request); - message = context.getString(R.string.bluetooth_pb_acceptance_dialog_text, - deviceAlias, deviceAlias); + message = context.getString( + R.string.bluetooth_phonebook_access_notification_content); break; case BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS: title = context.getString(R.string.bluetooth_map_request); - message = context.getString(R.string.bluetooth_map_acceptance_dialog_text, - deviceAlias, deviceAlias); + message = context.getString( + R.string.bluetooth_message_access_notification_content); break; case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS: title = context.getString(R.string.bluetooth_sap_request); @@ -172,6 +172,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { .setContentTitle(title) .setTicker(message) .setContentText(message) + .setStyle(new Notification.BigTextStyle().bigText(message)) .setSmallIcon(android.R.drawable.stat_sys_data_bluetooth) .setAutoCancel(true) .setPriority(Notification.PRIORITY_MAX) From a1669905f1617e41e1c95733bef90c45272f9376 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Tue, 22 Dec 2020 14:26:44 +0800 Subject: [PATCH 2/3] RESTRICT AUTOMERGE Update String Remove brackets. Bug: 176106404 Bug: 167403112 Test: build pass Change-Id: Ib9a3c4fa3c6ea1ca54244d672bdc3e12d51a719f (cherry picked from commit 085f70d48d50da1b689f8343505e844655e5b1f1) --- res/values/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index f02d11f656a..226398ea5eb 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -12202,11 +12202,11 @@ Allow access to messages? - An untrusted Bluetooth device, [%1$s], wants to access your messages.\n\nYou haven\u2019t connected to [%2$s] before. + An untrusted 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. 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. + 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. From d4f04398c71f67bc13f85e098e1dc71d840c1a4a Mon Sep 17 00:00:00 2001 From: Andras Kloczl Date: Tue, 9 Mar 2021 20:38:56 +0000 Subject: [PATCH 3/3] Prevent using invalid result uri during multi user image change Test: manual Bug: 172939189 Change-Id: I3e6f6200e82e86d6a2085652906ad2d0d44814f5 Merged-In: Id2e598878b3250e8b3590905c6def561e2437d55 Merged-In: I15e15ad88b768a5b679de32c5429d921d850a3cb (cherry picked from commit 07e414017c0d1f0c82006a8b59dc404baf696844) --- .../android/settings/users/EditUserPhotoController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/android/settings/users/EditUserPhotoController.java b/src/com/android/settings/users/EditUserPhotoController.java index a20513a3664..60f720eacf7 100644 --- a/src/com/android/settings/users/EditUserPhotoController.java +++ b/src/com/android/settings/users/EditUserPhotoController.java @@ -36,6 +36,7 @@ import android.os.UserHandle; import android.os.UserManager; import android.provider.ContactsContract.DisplayPhoto; import android.provider.MediaStore; +import android.util.EventLog; import android.util.Log; import android.view.Gravity; import android.view.View; @@ -116,6 +117,14 @@ public class EditUserPhotoController { } final Uri pictureUri = data != null && data.getData() != null ? data.getData() : mTakePictureUri; + + // Check if the result is a content uri + if (!ContentResolver.SCHEME_CONTENT.equals(pictureUri.getScheme())) { + Log.e(TAG, "Invalid pictureUri scheme: " + pictureUri.getScheme()); + EventLog.writeEvent(0x534e4554, "172939189", -1, pictureUri.getPath()); + return false; + } + switch (requestCode) { case REQUEST_CODE_CROP_PHOTO: onPhotoCropped(pictureUri, true);