commit | 1445a31e36d0d7677c5ea4d48b87341ae01dddc9 | [log] [tgz] |
---|---|---|
author | Jim Kaye <jameskaye@google.com> | Thu Dec 19 11:40:28 2019 -0800 |
committer | Jim Kaye <jameskaye@google.com> | Mon Jan 13 14:37:49 2020 -0800 |
tree | d0a0f666eef2a98643c1d65b9109a6b815809602 | |
parent | bb00155f9b1f34d33fc64ab5b7434cd6c6b2932b [diff] |
Delay suspending if we aren't quite ready to do it. We need a helper to suspend the system. If we are asked to suspend before we have that helper, delay the request, to allow us to receive the helper. At start up, SystemStateInterface.java receives a helper that it uses when someone calls enterDeepSleep(), which tells SystemStateInterface to suspend. If enterDeepSleep() is called before the helper has been received, we cannot suspend immediately. In this case, delay the 'suspend' request to allow time to get the helper. If the helper is not received in 10 seconds, this code gives up on suspending and shuts down the system. Fixes: 142699725 Test: Created SystemStateInterfaceTest.java Change-Id: Idbc18dcafde4657a5494e82f6b0900f3637c2fad (cherry picked from commit f520fbf1c2354317937ac65eea757a1f173f73ff)
Native (C++) code format is required to be compatible with .clang-format file. Run
git clang-format --style=file --extension='h,cpp,cc' HEAD~
Note that clang-format is not desirable for Android java files. Therefore the command line above is limited to specific extensions.