Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a96aab98 authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

Merge "SettingsLib: Add API to get identity address" am: 128ebcdb am: f2650c7f am: 32435083

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952111

Change-Id: Ie31f44740b8ceac6eb751264ff74191dc4cd7307
parents be749b6f 32435083
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -501,6 +501,17 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
        return mDevice.getAddress();
    }

    /**
     * Get identity address from remote device
     * @return {@link BluetoothDevice#getIdentityAddress()} if
     * {@link BluetoothDevice#getIdentityAddress()} is not null otherwise return
     * {@link BluetoothDevice#getAddress()}
     */
    public String getIdentityAddress() {
        final String identityAddress = mDevice.getIdentityAddress();
        return TextUtils.isEmpty(identityAddress) ? getAddress() : identityAddress;
    }

    /**
     * Get name from remote device
     * @return {@link BluetoothDevice#getAlias()} if