summaryrefslogtreecommitdiff
path: root/core/java/android/os/BatteryStats.java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-04-04 03:30:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-04 03:30:58 +0000
commitb5bbfa742e103532a81577999549d94bea3abc0f (patch)
tree230388acd5a338c7686860a88b19106d13eb9c34 /core/java/android/os/BatteryStats.java
parentcb6111929a6718cfcaafa6bf1b7cba9c18d7a4f9 (diff)
parent6bf8ef562619b01a918c41e8843684a5fb6a57b1 (diff)
Merge "Batterystats: "none" Data connection state should reflect only out of service"
Diffstat (limited to 'core/java/android/os/BatteryStats.java')
-rw-r--r--core/java/android/os/BatteryStats.java26
1 files changed, 18 insertions, 8 deletions
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index 00d522bae27f..ecd16dd1f612 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -266,8 +266,11 @@ public abstract class BatteryStats implements Parcelable {
* - Fixed bug in min learned capacity updating process.
* New in version 34:
* - Deprecated STATS_SINCE_UNPLUGGED and STATS_CURRENT.
+ * New in version 35:
+ * - Fixed bug that was not reporting high cellular tx power correctly
+ * - Added out of service and emergency service modes to data connection types
*/
- static final int CHECKIN_VERSION = 34;
+ static final int CHECKIN_VERSION = 35;
/**
* Old version, we hit 9 and ran out of room, need to remove.
@@ -2371,18 +2374,21 @@ public abstract class BatteryStats implements Parcelable {
*/
public abstract int getMobileRadioActiveUnknownCount(int which);
- public static final int DATA_CONNECTION_NONE = 0;
- public static final int DATA_CONNECTION_OTHER = TelephonyManager.MAX_NETWORK_TYPE + 1;
+ public static final int DATA_CONNECTION_OUT_OF_SERVICE = 0;
+ public static final int DATA_CONNECTION_EMERGENCY_SERVICE =
+ TelephonyManager.MAX_NETWORK_TYPE + 1;
+ public static final int DATA_CONNECTION_OTHER = DATA_CONNECTION_EMERGENCY_SERVICE + 1;
+
static final String[] DATA_CONNECTION_NAMES = {
- "none", "gprs", "edge", "umts", "cdma", "evdo_0", "evdo_A",
+ "oos", "gprs", "edge", "umts", "cdma", "evdo_0", "evdo_A",
"1xrtt", "hsdpa", "hsupa", "hspa", "iden", "evdo_b", "lte",
"ehrpd", "hspap", "gsm", "td_scdma", "iwlan", "lte_ca", "nr",
- "other"
+ "emngcy", "other"
};
@UnsupportedAppUsage
- public static final int NUM_DATA_CONNECTION_TYPES = DATA_CONNECTION_OTHER+1;
+ public static final int NUM_DATA_CONNECTION_TYPES = DATA_CONNECTION_OTHER + 1;
/**
* Returns the time in microseconds that the phone has been running with
@@ -6564,6 +6570,10 @@ public abstract class BatteryStats implements Parcelable {
}
oldState = rec.states;
oldState2 = rec.states2;
+ // Clear High Tx Power Flag for volta positioning
+ if ((rec.states2 & HistoryItem.STATE2_CELLULAR_HIGH_TX_POWER_FLAG) != 0) {
+ rec.states2 &= ~HistoryItem.STATE2_CELLULAR_HIGH_TX_POWER_FLAG;
+ }
}
return item.toString();
@@ -7865,9 +7875,9 @@ public abstract class BatteryStats implements Parcelable {
// Phone data connection (DATA_CONNECTION_TIME_DATA and DATA_CONNECTION_COUNT_DATA)
for (int i = 0; i < NUM_DATA_CONNECTION_TYPES; ++i) {
// Map OTHER to TelephonyManager.NETWORK_TYPE_UNKNOWN and mark NONE as a boolean.
- boolean isNone = (i == DATA_CONNECTION_NONE);
+ boolean isNone = (i == DATA_CONNECTION_OUT_OF_SERVICE);
int telephonyNetworkType = i;
- if (i == DATA_CONNECTION_OTHER) {
+ if (i == DATA_CONNECTION_OTHER || i == DATA_CONNECTION_EMERGENCY_SERVICE) {
telephonyNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
}
final long pdcToken = proto.start(SystemProto.DATA_CONNECTION);