diff --git a/res/drawable-hdpi/ic_bt_misc_hid.png b/res/drawable-hdpi/ic_bt_misc_hid.png new file mode 100755 index 00000000000..ea8234a2443 Binary files /dev/null and b/res/drawable-hdpi/ic_bt_misc_hid.png differ diff --git a/res/drawable-hdpi/ic_bt_pointing_hid.png b/res/drawable-hdpi/ic_bt_pointing_hid.png new file mode 100755 index 00000000000..ea8234a2443 Binary files /dev/null and b/res/drawable-hdpi/ic_bt_pointing_hid.png differ diff --git a/res/drawable-mdpi/ic_bt_misc_hid.png b/res/drawable-mdpi/ic_bt_misc_hid.png new file mode 100755 index 00000000000..b84d9447738 Binary files /dev/null and b/res/drawable-mdpi/ic_bt_misc_hid.png differ diff --git a/res/drawable-mdpi/ic_bt_pointing_hid.png b/res/drawable-mdpi/ic_bt_pointing_hid.png new file mode 100755 index 00000000000..b84d9447738 Binary files /dev/null and b/res/drawable-mdpi/ic_bt_pointing_hid.png differ diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java index 88964e094d5..8ddeef5a108 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java @@ -531,6 +531,9 @@ class CachedBluetoothDevice implements Comparable { case BluetoothClass.Device.Major.PHONE: return R.drawable.ic_bt_cellphone; + + case BluetoothClass.Device.Major.PERIPHERAL: + return getHidClassDrawable(); } } else { Log.w(TAG, "mBtClass is null"); @@ -554,6 +557,20 @@ class CachedBluetoothDevice implements Comparable { return 0; } + private int getHidClassDrawable() { + switch (mBtClass.getDeviceClass()) { + case BluetoothClass.Device.PERIPHERAL_KEYBOARD: + case BluetoothClass.Device.PERIPHERAL_KEYBOARD_POINTING: + return R.drawable.ic_bt_keyboard_hid; + + case BluetoothClass.Device.PERIPHERAL_POINTING: + return R.drawable.ic_bt_pointing_hid; + + default: + return R.drawable.ic_bt_misc_hid; + } + } + /** * Fetches a new value for the cached BT class. */ @@ -661,9 +678,14 @@ class CachedBluetoothDevice implements Comparable { Map drawables = new HashMap(); for (Profile profile : mProfiles) { - LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager - .getProfileManager(mLocalManager, profile); - int iconResource = profileManager.getDrawableResource(); + int iconResource; + if (profile == Profile.HID && mBtClass != null) { + iconResource = getHidClassDrawable(); + } else { + LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager + .getProfileManager(mLocalManager, profile); + iconResource = profileManager.getDrawableResource(); + } if (iconResource != 0) { drawables.put(profile, mContext.getResources().getDrawable(iconResource)); }