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

Commit b3189ad7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Require BLUETOOTH_PRIVILEGED permission for BluetoothPbapService and...

Merge "Require BLUETOOTH_PRIVILEGED permission for BluetoothPbapService and for the implementation of BluetoothPbap SystemApis"
parents 23e2e35a c5300414
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -229,6 +229,7 @@
        </activity>
        </activity>
        <service
        <service
            android:process="@string/process"
            android:process="@string/process"
            android:permission="android.permission.BLUETOOTH_PRIVILEGED"
            android:name=".pbap.BluetoothPbapService"
            android:name=".pbap.BluetoothPbapService"
            android:enabled="@bool/profile_supported_pbap" >
            android:enabled="@bool/profile_supported_pbap" >
            <intent-filter>
            <intent-filter>
+4 −2
Original line number Original line Diff line number Diff line
@@ -425,7 +425,8 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect
     * {@link BluetoothProfile#STATE_DISCONNECTING}
     * {@link BluetoothProfile#STATE_DISCONNECTING}
     */
     */
    public int getConnectionState(BluetoothDevice device) {
    public int getConnectionState(BluetoothDevice device) {
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
        enforceCallingOrSelfPermission(
                BLUETOOTH_PRIVILEGED, "Need BLUETOOTH_PRIVILEGED permission");
        if (mPbapStateMachineMap == null) {
        if (mPbapStateMachineMap == null) {
            return BluetoothProfile.STATE_DISCONNECTED;
            return BluetoothProfile.STATE_DISCONNECTED;
        }
        }
@@ -481,7 +482,8 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect
     * @return true if pbap is disconnected, false otherwise
     * @return true if pbap is disconnected, false otherwise
     */
     */
    public boolean setConnectionPolicy(BluetoothDevice device, int connectionPolicy) {
    public boolean setConnectionPolicy(BluetoothDevice device, int connectionPolicy) {
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission");
        enforceCallingOrSelfPermission(
                BLUETOOTH_PRIVILEGED, "Need BLUETOOTH_PRIVILEGED permission");
        if (DEBUG) {
        if (DEBUG) {
            Log.d(TAG, "setConnectionPolicy: device " + device
            Log.d(TAG, "setConnectionPolicy: device " + device
                    + " and connectionPolicy " + connectionPolicy);
                    + " and connectionPolicy " + connectionPolicy);