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

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

Merge "HID Device: add unit test cases" am: 9510cb2f

am: f17a09a2

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


    private HidDeviceServiceHandler mHandler;
    private HidDeviceServiceHandler mHandler;


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

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


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


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


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

File changed.

Preview size limit exceeded, changes collapsed.