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

Commit 37679bb8 authored by Etienne Ruffieux's avatar Etienne Ruffieux Committed by Android (Google) Code Review
Browse files

Merge "fixing CTS tests for BluetoothAdapter restrictions"

parents 52506832 b3ac949d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1240,7 +1240,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
        final int callingUid = Binder.getCallingUid();
        final int callingPid = Binder.getCallingPid();
        if (!isPrivileged(callingPid, callingUid) && !isDeviceOwner(callingUid, packageName)
                && !CompatChanges.isChangeEnabled(RESTRICT_ENABLE_DISABLE, callingUid)
                && CompatChanges.isChangeEnabled(RESTRICT_ENABLE_DISABLE, callingUid)
                && !isSystem(packageName, callingUid)) {
            return false;
        }
@@ -3061,6 +3061,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {

    private boolean isPrivileged(int pid, int uid) {
        return (mContext.checkPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED, pid, uid)
                == PackageManager.PERMISSION_GRANTED)
                || (mContext.checkPermission(android.Manifest.permission.NETWORK_SETTINGS, pid, uid)
                == PackageManager.PERMISSION_GRANTED)
                || (mContext.getPackageManager().checkSignatures(uid, Process.SYSTEM_UID)
                == PackageManager.SIGNATURE_MATCH);