From 9085541a1f65845d92e8e3be432c3c2e876ff81c Mon Sep 17 00:00:00 2001 From: Stanley Tng Date: Thu, 29 Nov 2018 13:47:45 -0800 Subject: [PATCH] Display Hearing Aids name on UI tile When the current device is a hearing aids, display the name under the tile. Bug: 117423826 Test: Manual testing on phone with hearing aids connected Change-Id: Iab52ff944d356f6c8cd7a0062fc67a0d55010fd1 Merged-In: I98cfda7905763a3da3dbc1fbed13fee881da7bb2 --- packages/SystemUI/res/values/strings.xml | 2 ++ .../src/com/android/systemui/qs/tiles/BluetoothTile.java | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 18f378e5919b1..d9da10f2b43dd 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -693,6 +693,8 @@ Headset Input + + Hearing Aids Turning on… diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java index cd0031173f8b2..22c42d4a6a572 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java @@ -207,7 +207,10 @@ public class BluetoothTile extends QSTileImpl { } else { final BluetoothClass bluetoothClass = lastDevice.getBtClass(); if (bluetoothClass != null) { - if (bluetoothClass.doesClassMatch(BluetoothClass.PROFILE_A2DP)) { + if (lastDevice.isHearingAidDevice()) { + return mContext.getString( + R.string.quick_settings_bluetooth_secondary_label_hearing_aids); + } else if (bluetoothClass.doesClassMatch(BluetoothClass.PROFILE_A2DP)) { return mContext.getString( R.string.quick_settings_bluetooth_secondary_label_audio); } else if (bluetoothClass.doesClassMatch(BluetoothClass.PROFILE_HEADSET)) {