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

Commit 6ed207e0 authored by Sal Savage's avatar Sal Savage Committed by Automerger Merge Worker
Browse files

Merge "Address API Council Feedback for NetworkServiceState APIs" into tm-dev am: ce9145a4

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/17083692

Change-Id: I9ebe0d712aa12a40facc7a4f2eb29a57465910e7
parents 6ddbf1de ce9145a4
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -328,8 +328,8 @@ package android.bluetooth {


  public static final class BluetoothHeadsetClient.NetworkServiceState implements android.os.Parcelable {
  public static final class BluetoothHeadsetClient.NetworkServiceState implements android.os.Parcelable {
    method @NonNull public android.bluetooth.BluetoothDevice getDevice();
    method @NonNull public android.bluetooth.BluetoothDevice getDevice();
    method @Nullable public String getOperatorName();
    method @Nullable public String getNetworkOperatorName();
    method public int getSignalStrength();
    method @IntRange(from=0, to=5) public int getSignalStrength();
    method public boolean isRoaming();
    method public boolean isRoaming();
    method public boolean isServiceAvailable();
    method public boolean isServiceAvailable();
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHeadsetClient.NetworkServiceState> CREATOR;
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHeadsetClient.NetworkServiceState> CREATOR;
+17 −6
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@ package android.bluetooth;


import static android.bluetooth.BluetoothUtils.getSyncTimeout;
import static android.bluetooth.BluetoothUtils.getSyncTimeout;


import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.RequiresPermission;
@@ -1742,8 +1743,19 @@ public final class BluetoothHeadsetClient implements BluetoothProfile, AutoClose
        private final String mOperatorName;
        private final String mOperatorName;


        /**
        /**
         * The general signal strength
         * The general signal strength, from 0 to 5.
         * (0 - Unknown, 1 - Poor, 2 - Fair, 3 - Good, 4 - Great, 5 - Excellent)
         *
         * Bluetooth HFP v1.8 specifies that the signal strength of a device can be [0, 5]. It does
         * place any requirements on how a device derives those values. While they're typically
         * derived from signal quality/RSSI buckets, there's way to be certain on the exact meaning.
         *
         * That said, you can "generally" interpret the values relative to each other as follows:
         *   - Level 0: None/Unknown
         *   - Level 1: Very Poor
         *   - Level 2: Poor
         *   - Level 3: Fair
         *   - Level 4: Good
         *   - Level 5: Great
         */
         */
        private final int mSignalStrength;
        private final int mSignalStrength;


@@ -1804,20 +1816,19 @@ public final class BluetoothHeadsetClient implements BluetoothProfile, AutoClose
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
        public @Nullable String getOperatorName() {
        public @Nullable String getNetworkOperatorName() {
            return mOperatorName;
            return mOperatorName;
        }
        }


        /**
        /**
         * Get the network's general signal strength
         * Get the network's general signal strength
         *
         *
         * @return The general signal strength (0 - None, 1 - Poor, 2 - Fair, 3 - Good,
         * @return The general signal strength, range [0, 5]
         *         4 - Great, 5 - Excellent)
         *
         *
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
        public int getSignalStrength() {
        public @IntRange(from = 0, to = 5) int getSignalStrength() {
            return mSignalStrength;
            return mSignalStrength;
        }
        }