Loading framework/java/android/bluetooth/BluetoothDevice.java +13 −17 Original line number Diff line number Diff line Loading @@ -1122,7 +1122,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public int getBatteryLevel() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1213,7 +1213,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isBondingInitiatedLocally() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1251,13 +1251,12 @@ public final class BluetoothDevice implements Parcelable { /** * Cancel an in-progress bonding request started with {@link #createBond}. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @return true on success, false on error * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean cancelBondProcess() { final IBluetooth service = sService; if (service == null) { Loading @@ -1280,13 +1279,12 @@ public final class BluetoothDevice implements Parcelable { * <p>Delete the link key associated with the remote device, and * immediately terminate connections to that device that require * authentication and encryption. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @return true on success, false on error * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean removeBond() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1359,13 +1357,12 @@ public final class BluetoothDevice implements Parcelable { /** * Returns whether there is an open connection to this device. * <p>Requires {@link android.Manifest.permission#BLUETOOTH}. * * @return True if there is at least one open connection to this device. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH) public boolean isConnected() { final IBluetooth service = sService; if (service == null) { Loading @@ -1383,13 +1380,12 @@ public final class BluetoothDevice implements Parcelable { /** * Returns whether there is an open connection to this device * that has been encrypted. * <p>Requires {@link android.Manifest.permission#BLUETOOTH}. * * @return True if there is at least one encrypted connection to this device. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH) public boolean isEncrypted() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1542,7 +1538,7 @@ public final class BluetoothDevice implements Parcelable { */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) public boolean setPin(@Nullable String pin) { public boolean setPin(@NonNull String pin) { byte[] pinBytes = convertPinToBytes(pin); if (pinBytes == null) { return false; Loading Loading @@ -1578,6 +1574,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean cancelPairing() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1609,8 +1606,8 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) public int getPhonebookAccessPermission() { @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public @AccessPermission int getPhonebookAccessPermission() { final IBluetooth service = sService; if (service == null) { return ACCESS_UNKNOWN; Loading Loading @@ -1689,7 +1686,6 @@ public final class BluetoothDevice implements Parcelable { /** * Sets whether the phonebook access is allowed to this device. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}. * * @param value Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link * #ACCESS_REJECTED}. Loading @@ -1698,7 +1694,7 @@ public final class BluetoothDevice implements Parcelable { */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setPhonebookAccessPermission(int value) { public boolean setPhonebookAccessPermission(@AccessPermission int value) { final IBluetooth service = sService; if (service == null) { return false; Loading @@ -1718,7 +1714,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public @AccessPermission int getMessageAccessPermission() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1765,7 +1761,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public @AccessPermission int getSimAccessPermission() { final IBluetooth service = sService; if (service == null) { Loading Loading
framework/java/android/bluetooth/BluetoothDevice.java +13 −17 Original line number Diff line number Diff line Loading @@ -1122,7 +1122,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public int getBatteryLevel() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1213,7 +1213,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isBondingInitiatedLocally() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1251,13 +1251,12 @@ public final class BluetoothDevice implements Parcelable { /** * Cancel an in-progress bonding request started with {@link #createBond}. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @return true on success, false on error * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean cancelBondProcess() { final IBluetooth service = sService; if (service == null) { Loading @@ -1280,13 +1279,12 @@ public final class BluetoothDevice implements Parcelable { * <p>Delete the link key associated with the remote device, and * immediately terminate connections to that device that require * authentication and encryption. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @return true on success, false on error * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean removeBond() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1359,13 +1357,12 @@ public final class BluetoothDevice implements Parcelable { /** * Returns whether there is an open connection to this device. * <p>Requires {@link android.Manifest.permission#BLUETOOTH}. * * @return True if there is at least one open connection to this device. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH) public boolean isConnected() { final IBluetooth service = sService; if (service == null) { Loading @@ -1383,13 +1380,12 @@ public final class BluetoothDevice implements Parcelable { /** * Returns whether there is an open connection to this device * that has been encrypted. * <p>Requires {@link android.Manifest.permission#BLUETOOTH}. * * @return True if there is at least one encrypted connection to this device. * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH) public boolean isEncrypted() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1542,7 +1538,7 @@ public final class BluetoothDevice implements Parcelable { */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) public boolean setPin(@Nullable String pin) { public boolean setPin(@NonNull String pin) { byte[] pinBytes = convertPinToBytes(pin); if (pinBytes == null) { return false; Loading Loading @@ -1578,6 +1574,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean cancelPairing() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1609,8 +1606,8 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) public int getPhonebookAccessPermission() { @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public @AccessPermission int getPhonebookAccessPermission() { final IBluetooth service = sService; if (service == null) { return ACCESS_UNKNOWN; Loading Loading @@ -1689,7 +1686,6 @@ public final class BluetoothDevice implements Parcelable { /** * Sets whether the phonebook access is allowed to this device. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}. * * @param value Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link * #ACCESS_REJECTED}. Loading @@ -1698,7 +1694,7 @@ public final class BluetoothDevice implements Parcelable { */ @SystemApi @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setPhonebookAccessPermission(int value) { public boolean setPhonebookAccessPermission(@AccessPermission int value) { final IBluetooth service = sService; if (service == null) { return false; Loading @@ -1718,7 +1714,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public @AccessPermission int getMessageAccessPermission() { final IBluetooth service = sService; if (service == null) { Loading Loading @@ -1765,7 +1761,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi @RequiresPermission(Manifest.permission.BLUETOOTH) @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public @AccessPermission int getSimAccessPermission() { final IBluetooth service = sService; if (service == null) { Loading