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

Commit 5b7518fd authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Update to modern Bluetooth permissions." into sc-dev

parents 31428e9d 7025a83f
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -17,8 +17,7 @@
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
    <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
@@ -2226,7 +2225,7 @@

        <activity android:name=".bluetooth.RequestPermissionActivity"
                  android:excludeFromRecents="true"
                  android:permission="android.permission.BLUETOOTH"
                  android:permission="android.permission.BLUETOOTH_CONNECT"
                  android:exported="true"
                  android:theme="@style/Theme.BluetoothPermission">
            <intent-filter android:priority="1">
@@ -2269,7 +2268,7 @@
        <activity android:name=".bluetooth.RequestPermissionHelperActivity"
                  android:label="@string/bluetooth_pairing_request"
                  android:excludeFromRecents="true"
                  android:permission="android.permission.BLUETOOTH"
                  android:permission="android.permission.BLUETOOTH_CONNECT"
                  android:theme="@*android:style/Theme.DeviceDefault.Dialog.Alert.DayNight">
        </activity>

@@ -2284,7 +2283,7 @@

        <receiver android:name=".bluetooth.BluetoothPermissionRequest"
                  android:exported="true"
                  android:permission="android.permission.BLUETOOTH_ADMIN">
                  android:permission="android.permission.BLUETOOTH_CONNECT">
            <intent-filter>
                <action android:name="android.bluetooth.device.action.CONNECTION_ACCESS_REQUEST" />
                <action android:name="android.bluetooth.device.action.CONNECTION_ACCESS_CANCEL" />
@@ -2294,7 +2293,7 @@
        <activity android:name=".bluetooth.BluetoothPermissionActivity"
                  android:label="@string/bluetooth_connection_permission_request"
                  android:excludeFromRecents="true"
                  android:permission="android.permission.BLUETOOTH_ADMIN"
                  android:permission="android.permission.BLUETOOTH_CONNECT"
                  android:exported="true"
                  android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.Alert">
            <intent-filter android:priority="1">
@@ -3549,7 +3548,7 @@
        <activity android:name="Settings$BluetoothDeviceDetailActivity"
                  android:label="@string/device_details_title"
                  android:exported="true"
                  android:permission="android.permission.BLUETOOTH_ADMIN">
                  android:permission="android.permission.BLUETOOTH_CONNECT">
            <intent-filter android:priority="1">
                <action android:name="com.android.settings.BLUETOOTH_DEVICE_DETAIL_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
@@ -3754,7 +3753,7 @@
        <receiver
            android:name=".media.BluetoothPairingReceiver"
            android:exported="true"
            android:permission="android.permission.BLUETOOTH_ADMIN">
            android:permission="android.permission.BLUETOOTH_CONNECT">
            <intent-filter>
                <action android:name="com.android.settings.action.LAUNCH_BLUETOOTH_PAIRING"/>
            </intent-filter>/>
+1 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements
        intent.putExtra(BluetoothDevice.EXTRA_ALWAYS_ALLOWED, always);
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice);
        intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, mRequestType);
        sendBroadcast(intent, android.Manifest.permission.BLUETOOTH_ADMIN);
        sendBroadcast(intent, android.Manifest.permission.BLUETOOTH_CONNECT);
    }

    public void onClick(DialogInterface dialog, int which) {
+1 −1
Original line number Diff line number Diff line
@@ -293,6 +293,6 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
                        : BluetoothDevice.CONNECTION_ACCESS_NO);
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice);
        intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, mRequestType);
        mContext.sendBroadcast(intent, android.Manifest.permission.BLUETOOTH_ADMIN);
        mContext.sendBroadcast(intent, android.Manifest.permission.BLUETOOTH_CONNECT);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -212,6 +212,6 @@ public final class DevicePickerFragment extends DeviceListPreferenceFragment {
            }
        }

        mContext.sendBroadcast(intent, Manifest.permission.BLUETOOTH_ADMIN);
        mContext.sendBroadcast(intent, Manifest.permission.BLUETOOTH_CONNECT);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -53,6 +53,6 @@ public class BluetoothPermissionActivityTest {
        mActivity.sendReplyIntentToReceiver(true, true);

        verify(mContext).sendBroadcast(intentCaptor.capture(),
                eq("android.permission.BLUETOOTH_ADMIN"));
                eq("android.permission.BLUETOOTH_CONNECT"));
    }
}
Loading