History log of /frameworks/base/core/java/com/android/internal/os/KernelWakelockReader.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ea357e5e3888598eea88e0d47ac3b4b53c9ecbf4 23-Feb-2018 Mike Ma <yanmin@google.com> Fix strict mode violation

Change-Id: I3c6391c52f06e4bb94162f8def1ab9b5f4c747fc
Fixes: 73549195
Test: KernelWakelockReaderTest
/frameworks/base/core/java/com/android/internal/os/KernelWakelockReader.java
3d5d9aefc13c95b94cfe42fe41f57c40c5f13483 05-Jul-2017 Amith Yamasani <yamasani@google.com> Add logging for unusually long read times

Tracking occasional lock contention in ActivityManagerService
that might be due to battery stats locking while reading proc files.

Bug: 63287747
Test: manual
Change-Id: Idfde8c960507930df4dc7e1337a89535d2ca932e
/frameworks/base/core/java/com/android/internal/os/KernelWakelockReader.java
d84ad30ee62ee9610ed4a59a8ce4dcbb8eddf7d8 18-May-2016 Adam Lesinski <adamlesinski@google.com> Fix parsing of kernel wakelocks

We handled stale wakelocks (wakelocks that disappear from /d/wakeup_sources)
differently in previous version of Android. They would be set stale, but still be
updated with their previous counts (they would never disappear).

The method setStale has been replaced with endSample(), which is semantically different.
Once a SamplingTimer has endSample() called, it expects any future calls to update() to
be a new sample, meaning the entire amount passed to update() is included in the kernel
wakelock's total. Since stale wakelocks were never removed from the list, this would
increase by large amounts when nothing had actually changed.

This was exacerbated by the fact that there was a bug where the last wakelock in
/d/wakeup_sources was never parsed, so if the order ever changed, this "stale" wakelock
would suddenly re-appear and the entire amount reported would be charged to the wakelock,
instead of just the difference since the last update.

All this was exposed when we added support to handle wakelocks that would disappear and
reappear with smaller values, meaning the kernel had pruned them from its accounting and
reset them.

Bug:28601080
Change-Id: Ic96027f7d580dac5e20aa73d67e5cedac4ccabeb
/frameworks/base/core/java/com/android/internal/os/KernelWakelockReader.java
fbabe7dd6a25f1ed1228ea65a2305f298427a99b 03-Aug-2015 Adam Lesinski <adamlesinski@google.com> BatteryStats: Add debug logging to find source of b/22716723

Bug:22716723
Change-Id: I97b940b702666b393555622d034e1c694b1e346a
/frameworks/base/core/java/com/android/internal/os/KernelWakelockReader.java
6856964444d0bb0fee6d7f62ae3f443f67244514 21-Jul-2015 Adam Lesinski <adamlesinski@google.com> BatteryStats: Read /proc/wakelocks first before trying /d/wakeup_sources

Previously we tried to read /d/wakeup_sources to gather kernel wakelock data. If that
fails we used the older sys file /proc/wakelocks.
N7 has both /proc/wakelocks and /d/wakeup_sources, but /proc/wakelocks
has the actual data we need. All other devices are using /d/wakeup_sources, so
only N7 experienced a loss of kernel wakelock data.

The original regression was introduced here: ag/659258

Bug:22556242
Change-Id: I51ec68e957f587bc1466e24f0a1dbc8cd7753ac6
/frameworks/base/core/java/com/android/internal/os/KernelWakelockReader.java
4b6bd8d36b093d36d9ae80b43e95049c259d7319 19-Mar-2015 Adam Lesinski <adamlesinski@google.com> Retrieve WiFi info outside of BatteryStatsImpl

In order to not deadlock the system, we need to retrieve
WiFi energy info outside of the BatteryStats lock. We do this,
then pass that data down to BatteryStatsImpl to process.

b/19729960

Change-Id: Ib8beba1d5ac81d89144d502c4b688d0a88c5b102
/frameworks/base/core/java/com/android/internal/os/KernelWakelockReader.java