OSDN Git Service

Improve logging of first wake lock, history size.
authorDianne Hackborn <hackbod@google.com>
Wed, 5 Feb 2014 21:38:56 +0000 (13:38 -0800)
committerDianne Hackborn <hackbod@google.com>
Thu, 6 Feb 2014 00:40:51 +0000 (16:40 -0800)
commit3d658bf20e2d56e36941e7407deebeec1276fbcf
treee30aba466e8ec0739292ebd6396594c35bcb80e0
parente8d916c04c3fb40667fbacb9b6fd1c775ce00b42
Improve logging of first wake lock, history size.

We now try to have a better label for the first wake lock
that is acquired in the log.  This is done in two ways:

- The alarm manager now sorts the alarms it is going to
  execute so that wakeup alarms are first, which are more
  important w.r.t. which one should be logged.
- There is a new power manager facility to make a wake lock
  as "unimportant for logging," which just means in battery
  stats that a wake lock acquired after that can be considered
  the actual one to log.  This is only used by the alarm manager
  to mark its TIME_TICK alarms as unimportant for logging.

Also reworked the battery history code to be cleaner and a bit
smaller.  There is no longer a separate EVENT command, instead
the event code and tag are just another thing that can be included
in an UPDATE command.

The bits used in the first history int are also re-arrange, so
that only the ones that really change a fair amount in the state
bits are up at the top and there is no longer space used for
the command code (since now it is always just UPDATE).  This
allows us to have more room for the time delta at the bottom,
to better avoid situations where we need to write an int delta.

Change-Id: I1bb860ae5b558a248800b090b03a84fbf7acd68a
core/java/android/os/BatteryStats.java
core/java/android/os/PowerManager.java
core/java/com/android/internal/app/IBatteryStats.aidl
core/java/com/android/internal/os/BatteryStatsImpl.java
services/core/java/com/android/server/AlarmManagerService.java
services/core/java/com/android/server/am/BatteryStatsService.java
services/core/java/com/android/server/power/DisplayPowerController.java
services/core/java/com/android/server/power/Notifier.java