OSDN Git Service

Make shutdown logging thread-safe
authorFyodor Kupolov <fkupolov@google.com>
Tue, 29 Aug 2017 19:12:03 +0000 (12:12 -0700)
committerFyodor Kupolov <fkupolov@google.com>
Tue, 29 Aug 2017 19:12:03 +0000 (12:12 -0700)
commit58815ea939f3830e82e7afd2f0dd10173ab04f65
tree56ab5b66809d7b9d17b764b3875ad5361b4fe134
parent25e5a3446ef6273fe52eebc344bacb5128337f9d
Make shutdown logging thread-safe

Previously TRON_METRICS/SHUTDOWN_TIMINGS_LOG were accessed from
different threads. Now all access is properly synchronized.

Important: Moved saveMetrics from rebootOrShutdown. rebootOrShutdown
can be called directly from SystemServer class after reboot when
no metrics were collected.

Test: manual reboot/shutdown and verify that metrics are logged
Bug: 64815357
Change-Id: I7b02c9c6b10b920ce3532a0808ab71a0d6e07d2b
services/core/java/com/android/server/power/ShutdownThread.java