diff options
author | Amith Yamasani <yamasani@google.com> | 2009-10-08 18:28:01 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2009-10-19 15:16:26 -0700 |
commit | f37447bad3773b62176baa837908daf6edb44273 (patch) | |
tree | fb8f45b23288aeb84873c7e7735373505a98c977 /services | |
parent | b5d69242d10021f82632d62c30b1ce63785c9386 (diff) | |
download | frameworks_base-f37447bad3773b62176baa837908daf6edb44273.zip frameworks_base-f37447bad3773b62176baa837908daf6edb44273.tar.gz frameworks_base-f37447bad3773b62176baa837908daf6edb44273.tar.bz2 |
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.
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/TelephonyRegistry.java | 2 | ||||
-rw-r--r-- | services/java/com/android/server/am/BatteryStatsService.java | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/services/java/com/android/server/TelephonyRegistry.java b/services/java/com/android/server/TelephonyRegistry.java index 101b075..47cb6ad 100644 --- a/services/java/com/android/server/TelephonyRegistry.java +++ b/services/java/com/android/server/TelephonyRegistry.java @@ -477,7 +477,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { private void broadcastServiceStateChanged(ServiceState state) { long ident = Binder.clearCallingIdentity(); try { - mBatteryStats.noteAirplaneMode(state.getState() == ServiceState.STATE_POWER_OFF); + mBatteryStats.notePhoneState(state.getState()); } catch (RemoteException re) { // Can't do much } finally { diff --git a/services/java/com/android/server/am/BatteryStatsService.java b/services/java/com/android/server/am/BatteryStatsService.java index 61537f5..5a1619a 100644 --- a/services/java/com/android/server/am/BatteryStatsService.java +++ b/services/java/com/android/server/am/BatteryStatsService.java @@ -51,6 +51,9 @@ public final class BatteryStatsService extends IBatteryStats.Stub { mContext = context; ServiceManager.addService("batteryinfo", asBinder()); mStats.setNumSpeedSteps(new PowerProfile(mContext).getNumSpeedSteps()); + mStats.setRadioScanningTimeout(mContext.getResources().getInteger( + com.android.internal.R.integer.config_radioScanningTimeout) + * 1000L); } public void shutdown() { @@ -195,10 +198,10 @@ public final class BatteryStatsService extends IBatteryStats.Stub { } } - public void noteAirplaneMode(boolean airplaneMode) { + public void notePhoneState(int state) { enforceCallingPermission(); synchronized (mStats) { - mStats.noteAirplaneModeLocked(airplaneMode); + mStats.notePhoneStateLocked(state); } } |