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

Commit 128ebcdb authored by Jack He's avatar Jack He Committed by Gerrit Code Review
Browse files

Merge "SettingsLib: Add API to get identity address"

parents bb0d4256 fd7f71ca
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -499,6 +499,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