From f37447bad3773b62176baa837908daf6edb44273 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Thu, 8 Oct 2009 18:28:01 -0700 Subject: Proper fix for zero signal strength and no_service. Fixes #2176141 Track phone service state changes and use a separate timer for out-of-service since the hunting can timeout on some devices. Store the timeout value in the config.xml, as it is device/network specific. Settings App will also change to use the hunting duration to compute the cost of zero signal. --- core/java/android/os/BatteryStats.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'core/java/android/os') diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index a49a27a0..b706c5c 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -130,6 +130,7 @@ public abstract class BatteryStats implements Parcelable { private static final String MISC_DATA = "m"; private static final String SCREEN_BRIGHTNESS_DATA = "br"; private static final String SIGNAL_STRENGTH_TIME_DATA = "sgt"; + private static final String SIGNAL_SCANNING_TIME_DATA = "sst"; private static final String SIGNAL_STRENGTH_COUNT_DATA = "sgc"; private static final String DATA_CONNECTION_TIME_DATA = "dct"; private static final String DATA_CONNECTION_COUNT_DATA = "dcc"; @@ -440,6 +441,15 @@ public abstract class BatteryStats implements Parcelable { long batteryRealtime, int which); /** + * Returns the time in microseconds that the phone has been trying to + * acquire a signal. + * + * {@hide} + */ + public abstract long getPhoneSignalScanningTime( + long batteryRealtime, int which); + + /** * Returns the number of times the phone has entered the given signal strength. * * {@hide} @@ -823,6 +833,8 @@ public abstract class BatteryStats implements Parcelable { args[i] = getPhoneSignalStrengthTime(i, batteryRealtime, which) / 1000; } dumpLine(pw, 0 /* uid */, category, SIGNAL_STRENGTH_TIME_DATA, args); + dumpLine(pw, 0 /* uid */, category, SIGNAL_SCANNING_TIME_DATA, + getPhoneSignalScanningTime(batteryRealtime, which) / 1000); for (int i=0; i