summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-11-18 04:24:51 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-11-18 04:24:51 +0000
commite905264d3c8bcd2b98dd37325b18a808b9f95e4d (patch)
tree870511679711da96887a704a72f68ff5aba00971 /core/java
parent46397049fea72193fdbf214d8b6e168ee307767e (diff)
parentd14320d21cb79df40bcac98b727e0e056ece3a73 (diff)
Merge "Re-add getAliasName to fix build breakage"
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/bluetooth/BluetoothDevice.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index 0be3eca8239e..19f42b6a4c9e 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -1095,6 +1095,24 @@ public final class BluetoothDevice implements Parcelable {
}
/**
+ * Get the Bluetooth alias of the remote device.
+ * If Alias is null, get the Bluetooth name instead.
+ *
+ * @return the Bluetooth alias, or null if no alias or there was a problem
+ * @hide
+ * @see #getAlias()
+ * @see #getName()
+ */
+ @UnsupportedAppUsage(publicAlternatives = "Use {@link #getName()} instead.")
+ public String getAliasName() {
+ String name = getAlias();
+ if (name == null) {
+ name = getName();
+ }
+ return name;
+ }
+
+ /**
* Get the most recent identified battery level of this Bluetooth device
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*