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

Commit b841430f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reset permissions for not bonded device" into tm-dev

parents 6d40b982 038b1e86
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -439,6 +439,13 @@ final class BondStateMachine extends StateMachine {
            }
        }

        if (newState == BluetoothDevice.BOND_NONE) {
            // Remove the permissions for unbonded devices
            mAdapterService.setMessageAccessPermission(device, BluetoothDevice.ACCESS_UNKNOWN);
            mAdapterService.setPhonebookAccessPermission(device, BluetoothDevice.ACCESS_UNKNOWN);
            mAdapterService.setSimAccessPermission(device, BluetoothDevice.ACCESS_UNKNOWN);
        }

        Intent intent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
        intent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, newState);