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

Commit 6d6a93fa authored by William Escande's avatar William Escande
Browse files

HeadsetService: temporarily skip MODIFY_PHONE_STATE

This have to be reverted in a short frame and is only intended to
prevent a lot of early user breakage
Note that this permission is still enforce for any method starting of
stopping sco.

Test: None
Flag: Exempt, need immediat usage for Android Automotive
Bug: 356478621
Change-Id: Ia984c44c8719d310766955d7fc41d7765c03d26b
parent f2f794be
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import static java.util.Objects.requireNonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
@@ -582,6 +583,7 @@ public class HeadsetService extends ProfileService {
        }

        @Override
        @SuppressLint("AndroidFrameworkRequiresPermission") // TODO: b/356478621 - remove
        public boolean setConnectionPolicy(
                BluetoothDevice device, int connectionPolicy, AttributionSource source) {
            HeadsetService service = getService(source);
@@ -589,7 +591,8 @@ public class HeadsetService extends ProfileService {
                return false;
            }

            service.enforceCallingOrSelfPermission(MODIFY_PHONE_STATE, null);
            // TODO: b/356478621 - put back the permission check
            // service.enforceCallingOrSelfPermission(MODIFY_PHONE_STATE, null);
            service.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, null);
            return service.setConnectionPolicy(device, connectionPolicy);
        }