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

Commit 85c7942a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Enable HID Device Profile Service (1/2)"

parents 163e42a3 5c3e6b95
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -331,6 +331,14 @@
                <action android:name="android.bluetooth.IBluetoothHidHost" />
            </intent-filter>
        </service>
        <service
            android:process="@string/process"
            android:name = ".hid.HidDeviceService"
            android:enabled="@bool/profile_supported_hid_device">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothHidDevice" />
            </intent-filter>
        </service>
        <service
            android:process="@string/process"
            android:name = ".hdp.HealthService"
@@ -386,12 +394,5 @@
                android:name="android.accounts.AccountAuthenticator"
                android:resource="@xml/authenticator" />
        </service>
        <service
            android:name = ".hid.HidDeviceService"
            android:enabled="@bool/profile_supported_hid_device">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothHidDevice" />
            </intent-filter>
        </service>
    </application>
</manifest>
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
    <bool name="profile_supported_sap">false</bool>
    <bool name="profile_supported_pbapclient">false</bool>
    <bool name="profile_supported_mapmce">false</bool>
    <bool name="profile_supported_hid_device">false</bool>
    <bool name="profile_supported_hid_device">true</bool>

    <!-- If true, we will require location to be enabled on the device to
         fire Bluetooth LE scan result callbacks in addition to having one
+8 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ import java.util.NoSuchElementException;
public class HidDeviceService extends ProfileService {
    private static final boolean DBG = false;

    private static final String TAG = "BluetoothHidDeviceService";
    private static final String TAG = HidDeviceService.class.getSimpleName();

    private static final int MESSAGE_APPLICATION_STATE_CHANGED = 1;
    private static final int MESSAGE_CONNECT_STATE_CHANGED = 2;
@@ -581,6 +581,13 @@ public class HidDeviceService extends ProfileService {
        return true;
    }

    @Override
    public boolean onUnbind(Intent intent) {
        Log.d(TAG, "Need to unregister app");
        unregisterApp(mAppConfig);
        return super.onUnbind(intent);
    }

    int getConnectionState(BluetoothDevice device) {
        if (mHidDevice != null && mHidDevice.equals(device)) {
            return mHidDeviceState;