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

Skip to content
Snippets Groups Projects
Commit bb6f5b26 authored by Xin Li's avatar Xin Li
Browse files

DO NOT MERGE - Merge RQ2A.210505.003.

Bug: 187544653
Merged-In: I3e6f6200e82e86d6a2085652906ad2d0d44814f5
Change-Id: I9a8ebe5b65b682015225c8c1ba9de1984bac7a8d
parents 6811428c 2f2b6c60
Branches
No related tags found
No related merge requests found
...@@ -12193,4 +12193,17 @@ ...@@ -12193,4 +12193,17 @@
   
<!-- Summary for see all preference when bluetooth is disable [CHAR LIMIT=none]--> <!-- Summary for see all preference when bluetooth is disable [CHAR LIMIT=none]-->
<string name="connected_device_see_all_summary">Bluetooth will turn on</string> <string name="connected_device_see_all_summary">Bluetooth will turn on</string>
<!-- Bluetooth message permission alert for notification content [CHAR LIMIT=none] -->
<string name="bluetooth_message_access_notification_content">Untrusted device wants to access your messages. Tap for details.</string>
<!-- Bluetooth message permission alert for dialog title [CHAR LIMIT=none] -->
<string name="bluetooth_message_access_dialog_title">Allow access to messages?</string>
<!-- Bluetooth message permission alert for dialog content [CHAR LIMIT=none] -->
<string name="bluetooth_message_access_dialog_content">An untrusted Bluetooth device, <xliff:g id="device_name" example="My device">%1$s</xliff:g>, wants to access your messages.\n\nYou haven\u2019t connected to <xliff:g id="device_name" example="My device">%2$s</xliff:g> before.</string>
<!-- Bluetooth phonebook permission alert for notification content [CHAR LIMIT=none] -->
<string name="bluetooth_phonebook_access_notification_content">Untrusted device wants to access your contacts and call log. Tap for details.</string>
<!-- Bluetooth phonebook permission alert for dialog title [CHAR LIMIT=none] -->
<string name="bluetooth_phonebook_access_dialog_title">Allow access to contacts and call log?</string>
<!-- Bluetooth phonebook permission alert for dialog content [CHAR LIMIT=none] -->
<string name="bluetooth_phonebook_access_dialog_content">An untrusted Bluetooth device, <xliff:g id="device_name" example="My device">%1$s</xliff:g>, wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to <xliff:g id="device_name" example="My device">%2$s</xliff:g> before.</string>
</resources> </resources>
...@@ -99,9 +99,9 @@ public class BluetoothPermissionActivity extends AlertActivity implements ...@@ -99,9 +99,9 @@ public class BluetoothPermissionActivity extends AlertActivity implements
if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) { if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) {
showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType); showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType);
} else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) { } 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) { } 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) { } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_SIM_ACCESS) {
showDialog(getString(R.string.bluetooth_sap_request), mRequestType); showDialog(getString(R.string.bluetooth_sap_request), mRequestType);
} }
...@@ -136,9 +136,9 @@ public class BluetoothPermissionActivity extends AlertActivity implements ...@@ -136,9 +136,9 @@ public class BluetoothPermissionActivity extends AlertActivity implements
p.mView = createSapDialogView(); p.mView = createSapDialogView();
break; break;
} }
p.mPositiveButtonText = getString(R.string.yes); p.mPositiveButtonText = getString(R.string.allow);
p.mPositiveButtonListener = this; p.mPositiveButtonListener = this;
p.mNegativeButtonText = getString(R.string.no); p.mNegativeButtonText = getString(R.string.deny);
p.mNegativeButtonListener = this; p.mNegativeButtonListener = this;
mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
setupAlert(); setupAlert();
...@@ -168,7 +168,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements ...@@ -168,7 +168,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements
String mRemoteName = Utils.createRemoteName(this, mDevice); String mRemoteName = Utils.createRemoteName(this, mDevice);
mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null);
messageView = (TextView)mView.findViewById(R.id.message); 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)); mRemoteName, mRemoteName));
return mView; return mView;
} }
...@@ -177,7 +177,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements ...@@ -177,7 +177,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements
String mRemoteName = Utils.createRemoteName(this, mDevice); String mRemoteName = Utils.createRemoteName(this, mDevice);
mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null);
messageView = (TextView)mView.findViewById(R.id.message); 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)); mRemoteName, mRemoteName));
return mView; return mView;
} }
......
...@@ -140,13 +140,13 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { ...@@ -140,13 +140,13 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
switch (mRequestType) { switch (mRequestType) {
case BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS: case BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS:
title = context.getString(R.string.bluetooth_phonebook_request); title = context.getString(R.string.bluetooth_phonebook_request);
message = context.getString(R.string.bluetooth_pb_acceptance_dialog_text, message = context.getString(
deviceAlias, deviceAlias); R.string.bluetooth_phonebook_access_notification_content);
break; break;
case BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS: case BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS:
title = context.getString(R.string.bluetooth_map_request); title = context.getString(R.string.bluetooth_map_request);
message = context.getString(R.string.bluetooth_map_acceptance_dialog_text, message = context.getString(
deviceAlias, deviceAlias); R.string.bluetooth_message_access_notification_content);
break; break;
case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS: case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS:
title = context.getString(R.string.bluetooth_sap_request); title = context.getString(R.string.bluetooth_sap_request);
...@@ -172,6 +172,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { ...@@ -172,6 +172,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
.setContentTitle(title) .setContentTitle(title)
.setTicker(message) .setTicker(message)
.setContentText(message) .setContentText(message)
.setStyle(new Notification.BigTextStyle().bigText(message))
.setSmallIcon(android.R.drawable.stat_sys_data_bluetooth) .setSmallIcon(android.R.drawable.stat_sys_data_bluetooth)
.setAutoCancel(true) .setAutoCancel(true)
.setPriority(Notification.PRIORITY_MAX) .setPriority(Notification.PRIORITY_MAX)
......
...@@ -36,6 +36,7 @@ import android.os.UserHandle; ...@@ -36,6 +36,7 @@ import android.os.UserHandle;
import android.os.UserManager; import android.os.UserManager;
import android.provider.ContactsContract.DisplayPhoto; import android.provider.ContactsContract.DisplayPhoto;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.util.EventLog;
import android.util.Log; import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
...@@ -116,6 +117,14 @@ public class EditUserPhotoController { ...@@ -116,6 +117,14 @@ public class EditUserPhotoController {
} }
final Uri pictureUri = data != null && data.getData() != null final Uri pictureUri = data != null && data.getData() != null
? data.getData() : mTakePictureUri; ? 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) { switch (requestCode) {
case REQUEST_CODE_CROP_PHOTO: case REQUEST_CODE_CROP_PHOTO:
onPhotoCropped(pictureUri, true); onPhotoCropped(pictureUri, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment