summaryrefslogtreecommitdiff
path: root/wifi
diff options
context:
space:
mode:
authorMatt Walliser <mattwalliser@google.com>2023-04-14 02:51:59 +0000
committerMatt Walliser <mattwalliser@google.com>2023-04-14 02:51:59 +0000
commitb25b3b1ddfdf408da7c7bb7cab9842cc75aaa772 (patch)
tree27225ecde8aaa69b816f57e0da52ad42047cf6f7 /wifi
parent9af3f4558ecba0ded525acbf11ef3c72d219d1ee (diff)
downloadbase-b25b3b1ddfdf408da7c7bb7cab9842cc75aaa772.tar.gz
Add isBatteryCharging to NetworkProviderInfo extras
Bug: 278155694 Test: none Change-Id: I0d9d288e65ac2410ab3c2d96b5c8fa5143d5ba40
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/src/android/net/wifi/sharedconnectivity/app/NetworkProviderInfo.java18
1 files changed, 12 insertions, 6 deletions
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;
}