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

Commit 349a80cc authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "HeadsetService: temporarily skip MODIFY_PHONE_STATE" into main am: da538fa2 am: 4533be11

parents 9451a11c 4533be11
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;
@@ -581,6 +582,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);
@@ -588,7 +590,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);
        }