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

Commit c76738fb authored by Zach Johnson's avatar Zach Johnson
Browse files

Remove IBluetooth.sendConnectionStateChanged

API broadcasts should not be triggered by arbitrary
apps in the system. This call was also not guarded
by a permission.

Cleaning up AIDL to make it stable.

Bug: 145171640
Test: compile
Change-Id: I01e85de4e25d9e16e0cfd526b7d3a7f974aad676
parent c5725410
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -1771,16 +1771,6 @@ public class AdapterService extends Service {
            return service.setSimAccessPermission(device, value);
        }

        @Override
        public void sendConnectionStateChange(BluetoothDevice device, int profile, int state,
                int prevState) {
            AdapterService service = getService();
            if (service == null) {
                return;
            }
            service.sendConnectionStateChange(device, profile, state, prevState);
        }

        @Override
        public IBluetoothSocketManager getSocketManager() {
            AdapterService service = getService();
@@ -2847,17 +2837,6 @@ public class AdapterService extends Service {
        return true;
    }

    void sendConnectionStateChange(BluetoothDevice device, int profile, int state, int prevState) {
        // TODO(BT) permission check?
        // Since this is a binder call check if Bluetooth is on still
        if (getState() == BluetoothAdapter.STATE_OFF) {
            return;
        }

        mAdapterProperties.sendConnectionStateChange(device, profile, state, prevState);

    }

    IBluetoothSocketManager getSocketManager() {
        return IBluetoothSocketManager.Stub.asInterface(mBluetoothSocketManagerBinder);
    }