Fix connection strength to include 0-4 in range
Bug: 277395764 Test: none Change-Id: I2cc20b3bc80f7b2808154e6deb407732330354b6
This commit is contained in:
@@ -10117,7 +10117,7 @@ package android.net.wifi.sharedconnectivity.app {
|
||||
public final class NetworkProviderInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method @IntRange(from=0, to=100) public int getBatteryPercentage();
|
||||
method @IntRange(from=0, to=3) public int getConnectionStrength();
|
||||
method @IntRange(from=0, to=4) public int getConnectionStrength();
|
||||
method @NonNull public String getDeviceName();
|
||||
method public int getDeviceType();
|
||||
method @NonNull public android.os.Bundle getExtras();
|
||||
@@ -10136,7 +10136,7 @@ package android.net.wifi.sharedconnectivity.app {
|
||||
ctor public NetworkProviderInfo.Builder(@NonNull String, @NonNull String);
|
||||
method @NonNull public android.net.wifi.sharedconnectivity.app.NetworkProviderInfo build();
|
||||
method @NonNull public android.net.wifi.sharedconnectivity.app.NetworkProviderInfo.Builder setBatteryPercentage(@IntRange(from=0, to=100) int);
|
||||
method @NonNull public android.net.wifi.sharedconnectivity.app.NetworkProviderInfo.Builder setConnectionStrength(@IntRange(from=0, to=3) int);
|
||||
method @NonNull public android.net.wifi.sharedconnectivity.app.NetworkProviderInfo.Builder setConnectionStrength(@IntRange(from=0, to=4) int);
|
||||
method @NonNull public android.net.wifi.sharedconnectivity.app.NetworkProviderInfo.Builder setDeviceName(@NonNull String);
|
||||
method @NonNull public android.net.wifi.sharedconnectivity.app.NetworkProviderInfo.Builder setDeviceType(int);
|
||||
method @NonNull public android.net.wifi.sharedconnectivity.app.NetworkProviderInfo.Builder setExtras(@NonNull android.os.Bundle);
|
||||
|
||||
@@ -163,11 +163,11 @@ public final class NetworkProviderInfo implements Parcelable {
|
||||
/**
|
||||
* Sets the displayed connection strength of the remote device to the internet.
|
||||
*
|
||||
* @param connectionStrength Connection strength in range 0 to 3.
|
||||
* @param connectionStrength Connection strength in range 0 to 4.
|
||||
* @return Returns the Builder object.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setConnectionStrength(@IntRange(from = 0, to = 3) int connectionStrength) {
|
||||
public Builder setConnectionStrength(@IntRange(from = 0, to = 4) int connectionStrength) {
|
||||
mConnectionStrength = connectionStrength;
|
||||
return this;
|
||||
}
|
||||
@@ -205,8 +205,8 @@ public final class NetworkProviderInfo implements Parcelable {
|
||||
if (batteryPercentage < 0 || batteryPercentage > 100) {
|
||||
throw new IllegalArgumentException("BatteryPercentage must be in range 0-100");
|
||||
}
|
||||
if (connectionStrength < 0 || connectionStrength > 3) {
|
||||
throw new IllegalArgumentException("ConnectionStrength must be in range 0-3");
|
||||
if (connectionStrength < 0 || connectionStrength > 4) {
|
||||
throw new IllegalArgumentException("ConnectionStrength must be in range 0-4");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,9 +265,9 @@ public final class NetworkProviderInfo implements Parcelable {
|
||||
/**
|
||||
* Gets the displayed connection strength of the remote device to the internet.
|
||||
*
|
||||
* @return Returns the connection strength in range 0 to 3.
|
||||
* @return Returns the connection strength in range 0 to 4.
|
||||
*/
|
||||
@IntRange(from = 0, to = 3)
|
||||
@IntRange(from = 0, to = 4)
|
||||
public int getConnectionStrength() {
|
||||
return mConnectionStrength;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user