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

Commit 9cf71c26 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "BluetoothManagerService: enforce BLUETOOTH_PRIVILEGED for...

Merge "BluetoothManagerService: enforce BLUETOOTH_PRIVILEGED for onFactoryReset" into rvc-qpr-dev am: d53798ab am: 4b187f04

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12227685

Change-Id: Iea2b97b436cd9c11cb2e799626bc2d41605d7ace
parents bc32d3e0 4b187f04
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -96,6 +96,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {

    private static final String BLUETOOTH_ADMIN_PERM = android.Manifest.permission.BLUETOOTH_ADMIN;
    private static final String BLUETOOTH_PERM = android.Manifest.permission.BLUETOOTH;
    private static final String BLUETOOTH_PRIVILEGED =
            android.Manifest.permission.BLUETOOTH_PRIVILEGED;

    private static final String SECURE_SETTINGS_BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid";
    private static final String SECURE_SETTINGS_BLUETOOTH_ADDRESS = "bluetooth_address";
@@ -306,6 +308,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            };

    public boolean onFactoryReset() {
        mContext.enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED,
                "Need BLUETOOTH_PRIVILEGED permission");

        // Wait for stable state if bluetooth is temporary state.
        int state = getState();
        if (state == BluetoothAdapter.STATE_BLE_TURNING_ON