commit | c76bb78758f57b064b3e442f8e8e12af84eddbf2 | [log] [tgz] |
---|---|---|
author | jackqdyulei <jackqdyulei@google.com> | Wed Feb 14 12:43:09 2018 -0800 |
committer | jackqdyulei <jackqdyulei@google.com> | Wed Feb 14 14:24:02 2018 -0800 |
tree | afa75e8780b04137de1de8b2ab452cb1df3f9b9d | |
parent | 1bbe424e6e17e6037c0d0d97889aa12d6134f693 [diff] |
Make BatteryDatabaseManager singleton In BatteryTipLoader, two threads may access BatteryDatabaseManager simultaneously. In this case thread A may close the database thread B holds, then settings will crash. In this cl, we make the BatteryDatabaseManager as singleton and synchronize all the database related method. Then it shouldn't have the crash anymore. Bug: 73346734 Test: RunSettingsRoboTests Change-Id: Ib53b2894b25155cca0c6ec60d1a816663d27a578