Battery stats: wake locks, radio active, cleanup.
- Improve wake lock work source updates to also update the current history tag, in case the new work source gets recorded in the history. - Fix bug in recording radio active time that was not distributing any time to apps. - No longer hold a wake lock while dispatching data conn active call, since it comes with its own timestamp. - Fix issue where the top app was not being cleared while the screen was off. - Remove obsolete STATS_LAST stats type. - Fix bug that was not clearing the total run time when resetting the stats. Change-Id: Iabe17a9edf34f762374ae09fcffb8a819cf72e30
This commit is contained in:
@@ -110,7 +110,7 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo
|
||||
} catch (Exception e) {
|
||||
loge("Error handling '" + event + "': " + e);
|
||||
} finally {
|
||||
if (mCallbacks.onCheckHoldWakeLock(msg.what)) {
|
||||
if (mCallbacks.onCheckHoldWakeLock(msg.what) && mWakeLock != null) {
|
||||
mWakeLock.release();
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,8 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo
|
||||
rawEvent);
|
||||
if (event.isClassUnsolicited()) {
|
||||
// TODO: migrate to sending NativeDaemonEvent instances
|
||||
if (mCallbacks.onCheckHoldWakeLock(event.getCode())) {
|
||||
if (mCallbacks.onCheckHoldWakeLock(event.getCode())
|
||||
&& mWakeLock != null) {
|
||||
mWakeLock.acquire();
|
||||
releaseWl = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user