summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SettingsLib/res/values/strings.xml3
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java5
2 files changed, 8 insertions, 0 deletions
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index 03cb1ffbdef1..1297aa3ff7d5 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -1510,6 +1510,9 @@
<!-- Warning message to tell user is have problem during profile connect, it need to turn off device and back on. [CHAR_LIMIT=NONE] -->
<string name="profile_connect_timeout_subtext">Problem connecting. Turn device off &amp; back on</string>
+ <!-- Warning message when the bluetooth key is missing. [CHAR_LIMIT=NONE] -->
+ <string name="bluetooth_key_missing_subtext">Can’t connect</string>
+
<!-- Name of the 3.5mm audio device. [CHAR LIMIT=40] -->
<string name="media_transfer_wired_device_name">Wired audio device</string>
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index 3646842d36ef..41e782e3f756 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -1495,6 +1495,11 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
int leftBattery = -1;
int rightBattery = -1;
+ Integer keyMissingCount = BluetoothUtils.getKeyMissingCount(mDevice);
+ if (keyMissingCount != null && keyMissingCount > 0) {
+ return mContext.getString(R.string.bluetooth_key_missing_subtext);
+ }
+
if (isProfileConnectedFail() && isConnected()) {
return mContext.getString(R.string.profile_connect_timeout_subtext);
}