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

Commit 51cb65f6 authored by Hansong Zhang's avatar Hansong Zhang Committed by android-build-merger
Browse files

Merge "HID Device: add unit test cases" am: 7b672f72

am: 3fa8dc95

Change-Id: I672ab43959c28120995c8413cc70dc14a7a238ce
parents 3cb3e9b3 3fa8dc95
Loading
Loading
Loading
Loading
+9 −12
Original line number Diff line number Diff line
@@ -68,10 +68,6 @@ public class HidDeviceService extends ProfileService {

    private HidDeviceServiceHandler mHandler;

    public HidDeviceService() {
        mHidDeviceNativeInterface = HidDeviceNativeInterface.getInstance();
    }

    private class HidDeviceServiceHandler extends Handler {
        @Override
        public void handleMessage(Message msg) {
@@ -553,6 +549,7 @@ public class HidDeviceService extends ProfileService {

        mHandler = new HidDeviceServiceHandler();
        setHidDeviceService(this);
        mHidDeviceNativeInterface = HidDeviceNativeInterface.getInstance();
        mHidDeviceNativeInterface.init();
        mNativeAvailable = true;
        return true;
@@ -741,21 +738,21 @@ public class HidDeviceService extends ProfileService {

    private static int convertHalState(int halState) {
        switch (halState) {
            case CONN_STATE_CONNECTED:
            case HAL_CONN_STATE_CONNECTED:
                return BluetoothProfile.STATE_CONNECTED;
            case CONN_STATE_CONNECTING:
            case HAL_CONN_STATE_CONNECTING:
                return BluetoothProfile.STATE_CONNECTING;
            case CONN_STATE_DISCONNECTED:
            case HAL_CONN_STATE_DISCONNECTED:
                return BluetoothProfile.STATE_DISCONNECTED;
            case CONN_STATE_DISCONNECTING:
            case HAL_CONN_STATE_DISCONNECTING:
                return BluetoothProfile.STATE_DISCONNECTING;
            default:
                return BluetoothProfile.STATE_DISCONNECTED;
        }
    }

    private static final int CONN_STATE_CONNECTED = 0;
    private static final int CONN_STATE_CONNECTING = 1;
    private static final int CONN_STATE_DISCONNECTED = 2;
    private static final int CONN_STATE_DISCONNECTING = 3;
    static final int HAL_CONN_STATE_CONNECTED = 0;
    static final int HAL_CONN_STATE_CONNECTING = 1;
    static final int HAL_CONN_STATE_DISCONNECTED = 2;
    static final int HAL_CONN_STATE_DISCONNECTING = 3;
}
+369 −14

File changed.

Preview size limit exceeded, changes collapsed.