From b25b3b1ddfdf408da7c7bb7cab9842cc75aaa772 Mon Sep 17 00:00:00 2001 From: Matt Walliser Date: Fri, 14 Apr 2023 02:51:59 +0000 Subject: Add isBatteryCharging to NetworkProviderInfo extras Bug: 278155694 Test: none Change-Id: I0d9d288e65ac2410ab3c2d96b5c8fa5143d5ba40 --- .../sharedconnectivity/app/NetworkProviderInfo.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'wifi/java/src') diff --git a/wifi/java/src/android/net/wifi/sharedconnectivity/app/NetworkProviderInfo.java b/wifi/java/src/android/net/wifi/sharedconnectivity/app/NetworkProviderInfo.java index 25fbabce71ae..c6e675ade262 100644 --- a/wifi/java/src/android/net/wifi/sharedconnectivity/app/NetworkProviderInfo.java +++ b/wifi/java/src/android/net/wifi/sharedconnectivity/app/NetworkProviderInfo.java @@ -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; } -- cgit v1.2.3-59-g8ed1b