From 822a1208013095234d69ef9f2d6c1e0d589c8f45 Mon Sep 17 00:00:00 2001 From: Rahul Sabnis Date: Tue, 19 Nov 2019 18:26:48 -0800 Subject: [PATCH] DO NOT MERGE Revert "Merge "Revert "Re-add getAliasName to fix build breakage"" am: 944fed6b66" This reverts commit 07c1280421dc715b4f20cf76328c7735d7872986, reversing changes made to d26ea8807f7337a7e540944921932db9277b46a7. Bug: 144619932 Test: Manual Change-Id: Ie9a46c9527004759a250dc71d2a1065ff3bb7328 --- .../android/bluetooth/BluetoothDevice.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 0be3eca8239e9..19f42b6a4c9e8 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -1094,6 +1094,24 @@ public final class BluetoothDevice implements Parcelable { return false; } + /** + * 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 *

Requires {@link android.Manifest.permission#BLUETOOTH}