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

Commit 8dc4d086 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6318458 from 51c178ae4341bee56b645b06c98c072ab4c0ad77 to rvc-release

Change-Id: Id9bb9ec4b1ef22d3caf80c3b82cf6635159e6989
parents 02626c68 d7b3b69e
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -230,6 +230,13 @@ public final class BluetoothDevice implements Parcelable {
     */
    public static final int BATTERY_LEVEL_UNKNOWN = -1;

    /**
     * Used as an error value for {@link #getBatteryLevel()} to represent bluetooth is off
     *
     * @hide
     */
    public static final int BATTERY_LEVEL_BLUETOOTH_OFF = -100;

    /**
     * Used as a Parcelable {@link BluetoothDevice} extra field in every intent
     * broadcast by this class. It contains the {@link BluetoothDevice} that
@@ -1112,9 +1119,9 @@ public final class BluetoothDevice implements Parcelable {
    /**
     * Get the most recent identified battery level of this Bluetooth device
     *
     * @return Battery level in percents from 0 to 100, or {@link #BATTERY_LEVEL_UNKNOWN} if
     * Bluetooth is disabled, or device is disconnected, or does not have any battery reporting
     * service, or return value is invalid
     * @return Battery level in percents from 0 to 100, {@link #BATTERY_LEVEL_BLUETOOTH_OFF} if
     * Bluetooth is disabled or {@link #BATTERY_LEVEL_UNKNOWN} if device is disconnected, or does
     * not have any battery reporting service, or return value is invalid
     * @hide
     */
    @SystemApi
@@ -1123,7 +1130,7 @@ public final class BluetoothDevice implements Parcelable {
        final IBluetooth service = sService;
        if (service == null) {
            Log.e(TAG, "Bluetooth disabled. Cannot get remote device battery level");
            return BATTERY_LEVEL_UNKNOWN;
            return BATTERY_LEVEL_BLUETOOTH_OFF;
        }
        try {
            return service.getBatteryLevel(this);
@@ -1727,7 +1734,9 @@ public final class BluetoothDevice implements Parcelable {
    /**
     * Sets whether the message access is allowed to this device.
     *
     * @param value is the value we are setting the message access permission to
     * @param value Can be {@link #ACCESS_UNKNOWN} if the device is unbonded,
     * {@link #ACCESS_ALLOWED} if the permission is being granted, or {@link #ACCESS_REJECTED} if
     * the permission is not being granted.
     * @return Whether the value has been successfully set.
     * @hide
     */
@@ -1774,8 +1783,9 @@ public final class BluetoothDevice implements Parcelable {
    /**
     * Sets whether the Sim access is allowed to this device.
     *
     * @param value Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link
     * #ACCESS_REJECTED}.
     * @param value Can be {@link #ACCESS_UNKNOWN} if the device is unbonded,
     * {@link #ACCESS_ALLOWED} if the permission is being granted, or {@link #ACCESS_REJECTED} if
     * the permission is not being granted.
     * @return Whether the value has been successfully set.
     * @hide
     */
+16 −6
Original line number Diff line number Diff line
@@ -174,8 +174,9 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {

    /**
     * Closes the connection to the service and unregisters callbacks
     *
     * @hide
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH)
    public void close() {
        if (VDBG) log("close()");
        mProfileConnector.disconnect();
@@ -185,7 +186,7 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
        return mProfileConnector.getService();
    }

    @RequiresPermission(Manifest.permission.BLUETOOTH)
    /** @hide */
    protected void finalize() {
        if (mCloseGuard != null) {
            mCloseGuard.warnIfOpen();
@@ -280,7 +281,7 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
     * @hide
     */
    @SystemApi
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public boolean setConnectionPolicy(@NonNull BluetoothDevice device,
            @ConnectionPolicy int connectionPolicy) {
        if (DBG) log("setConnectionPolicy(" + device + ", " + connectionPolicy + ")");
@@ -304,8 +305,11 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {

    /**
     * {@inheritDoc}
     * @hide
     */
    @SystemApi
    @Override
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public @NonNull List<BluetoothDevice> getConnectedDevices() {
        if (VDBG) log("getConnectedDevices()");
        final IBluetoothPan service = getService();
@@ -344,9 +348,11 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {

    /**
     * {@inheritDoc}
     * @hide
     */
    @SystemApi
    @Override
    @RequiresPermission(Manifest.permission.BLUETOOTH)
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public int getConnectionState(@Nullable BluetoothDevice device) {
        if (VDBG) log("getState(" + device + ")");
        final IBluetoothPan service = getService();
@@ -366,8 +372,10 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
     * Turns on/off bluetooth tethering
     *
     * @param value is whether to enable or disable bluetooth tethering
     * @hide
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    @SystemApi
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public void setBluetoothTethering(boolean value) {
        String pkgName = mContext.getOpPackageName();
        if (DBG) log("setBluetoothTethering(" + value + "), calling package:" + pkgName);
@@ -385,8 +393,10 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
     * Determines whether tethering is enabled
     *
     * @return true if tethering is on, false if not or some error occurred
     * @hide
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH)
    @SystemApi
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public boolean isTetheringOn() {
        if (VDBG) log("isTetheringOn()");
        final IBluetoothPan service = getService();