Skip to content
Snippets Groups Projects
Commit b25b3b1d authored by Matt Walliser's avatar Matt Walliser
Browse files

Add isBatteryCharging to NetworkProviderInfo extras

Bug: 278155694
Test: none
Change-Id: I0d9d288e65ac2410ab3c2d96b5c8fa5143d5ba40
parent 9af3f455
No related branches found
No related tags found
No related merge requests found
......@@ -84,6 +84,12 @@ public final class NetworkProviderInfo implements Parcelable {
public @interface DeviceType {
}
/**
* Key in extras bundle indicating that the device battery is charging.
* @hide
*/
public static final String EXTRA_KEY_IS_BATTERY_CHARGING = "is_battery_charging";
@DeviceType
private final int mDeviceType;
private final String mDeviceName;
......@@ -163,11 +169,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 +211,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 +271,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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment