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

Commit 4ac317b2 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [15151697, 15151718, 15151899, 15151900, 15151901,...

Merge cherrypicks of [15151697, 15151718, 15151899, 15151900, 15151901, 15151902, 15151904, 15151906, 15151930, 15151932, 15151933, 15151856, 15151858, 15151388, 15151971, 15151972, 15151973] into security-aosp-qt-release

Change-Id: Ifb9b2b1c20eb33419415a2434bc461cd083fe398
parents 11524c46 1e14a79f
Loading
Loading
Loading
Loading
+28 −4
Original line number Original line Diff line number Diff line
@@ -11316,15 +11316,39 @@
    <string name="work_policy_privacy_settings_summary">Settings managed by your IT admin</string>
    <string name="work_policy_privacy_settings_summary">Settings managed by your IT admin</string>
    <!-- Bluetooth message permission alert for notification content [CHAR LIMIT=none] -->
    <!-- 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>
    <string name="bluetooth_message_access_notification_content">A device wants to access your messages. Tap for details.</string>
    <!-- Bluetooth message permission alert for dialog title [CHAR LIMIT=none] -->
    <!-- Bluetooth message permission alert for dialog title [CHAR LIMIT=none] -->
    <string name="bluetooth_message_access_dialog_title">Allow access to messages?</string>
    <string name="bluetooth_message_access_dialog_title">Allow access to messages?</string>
    <!-- Bluetooth message permission alert for dialog content [CHAR LIMIT=none] -->
    <!-- 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>
    <string name="bluetooth_message_access_dialog_content">A 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] -->
    <!-- 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>
    <string name="bluetooth_phonebook_access_notification_content">A device wants to access your contacts and call log. Tap for details.</string>
    <!-- Bluetooth phonebook permission alert for dialog title [CHAR LIMIT=none] -->
    <!-- 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>
    <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] -->
    <!-- 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>
    <string name="bluetooth_phonebook_access_dialog_content">A 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>
    <!-- Label for button to not allow grant the permission for remote devices. [CHAR_LIMIT=50] -->
    <string name="request_manage_bluetooth_permission_dont_allow">Don\u2019t allow</string>
    <!-- Bluetooth sim card permission alert for notification title [CHAR LIMIT=none] -->
    <string name="bluetooth_sim_card_access_notification_title">SIM card access request</string>
    <!-- Bluetooth sim card permission alert for notification content [CHAR LIMIT=none] -->
    <string name="bluetooth_sim_card_access_notification_content">A device wants to access your SIM card. Tap for details.</string>
    <!-- Bluetooth sim card permission alert for dialog title [CHAR LIMIT=none] -->
    <string name="bluetooth_sim_card_access_dialog_title">Allow access to SIM card?</string>
    <!-- Bluetooth sim card permission alert for dialog content [CHAR LIMIT=none] -->
    <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>
    <!-- Bluetooth connect permission alert for notification title [CHAR LIMIT=none] -->
    <string name="bluetooth_connect_access_notification_title">Bluetooth device available</string>
    <!-- Bluetooth connect permission alert for notification content [CHAR LIMIT=none] -->
    <string name="bluetooth_connect_access_notification_content">A device wants to connect. Tap for details.</string>
    <!-- Bluetooth connect permission alert for dialog title [CHAR LIMIT=none] -->
    <string name="bluetooth_connect_access_dialog_title">Connect to Bluetooth device?</string>
    <!-- Bluetooth connect permission alert for dialog content [CHAR LIMIT=none] -->
    <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>
    <!-- Strings for Dialog don't connect button -->
    <string name="bluetooth_connect_access_dialog_negative">Don\u2019t connect</string>
    <!-- Strings for Dialog connect button -->
    <string name="bluetooth_connect_access_dialog_positive">Connect</string>
</resources>
</resources>
+15 −8
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.util.Log;
import android.view.View;
import android.view.View;
import android.widget.Button;
import android.widget.Button;
@@ -94,13 +95,13 @@ public class BluetoothPermissionActivity extends AlertActivity implements
        if(DEBUG) Log.i(TAG, "onCreate() Request type: " + mRequestType);
        if(DEBUG) Log.i(TAG, "onCreate() Request type: " + mRequestType);


        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_connect_access_dialog_title), mRequestType);
        } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) {
        } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) {
            showDialog(getString(R.string.bluetooth_phonebook_access_dialog_title), 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_message_access_dialog_title), 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_sim_card_access_dialog_title), mRequestType);
        }
        }
        else {
        else {
            Log.e(TAG, "Error: bad request type: " + mRequestType);
            Log.e(TAG, "Error: bad request type: " + mRequestType);
@@ -133,9 +134,14 @@ public class BluetoothPermissionActivity extends AlertActivity implements
            p.mView = createSapDialogView();
            p.mView = createSapDialogView();
            break;
            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.mPositiveButtonListener = this;
        p.mNegativeButtonText = getString(R.string.deny);
        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;
        p.mNegativeButtonListener = this;
        mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
        mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
        setupAlert();
        setupAlert();
@@ -156,8 +162,8 @@ 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_connection_dialog_text,
        messageView.setText(getString(R.string.bluetooth_connect_access_dialog_content,
                mRemoteName));
                mRemoteName, mRemoteName));
        return mView;
        return mView;
    }
    }


@@ -181,10 +187,11 @@ public class BluetoothPermissionActivity extends AlertActivity implements


    private View createSapDialogView() {
    private View createSapDialogView() {
        String mRemoteName = Utils.createRemoteName(this, mDevice);
        String mRemoteName = Utils.createRemoteName(this, mDevice);
        TelephonyManager tm = getSystemService(TelephonyManager.class);
        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_sap_acceptance_dialog_text,
        messageView.setText(getString(R.string.bluetooth_sim_card_access_dialog_content,
                mRemoteName, mRemoteName));
                mRemoteName, mRemoteName, tm.getLine1Number()));
        return mView;
        return mView;
    }
    }


+8 −4
Original line number Original line Diff line number Diff line
@@ -144,13 +144,17 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
                                R.string.bluetooth_message_access_notification_content);
                                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(
                        message = context.getString(R.string.bluetooth_sap_acceptance_dialog_text,
                                R.string.bluetooth_sim_card_access_notification_title);
                        message = context.getString(
                                R.string.bluetooth_sim_card_access_notification_content,
                                deviceAlias, deviceAlias);
                                deviceAlias, deviceAlias);
                        break;
                        break;
                    default:
                    default:
                        title = context.getString(R.string.bluetooth_connection_permission_request);
                        title = context.getString(
                        message = context.getString(R.string.bluetooth_connection_dialog_text,
                                R.string.bluetooth_connect_access_notification_title);
                        message = context.getString(
                                R.string.bluetooth_connect_access_notification_content,
                                deviceAlias, deviceAlias);
                                deviceAlias, deviceAlias);
                        break;
                        break;
                }
                }