Fix crash in CarPowerManagementService

ag/9718627 moved the logic for when we call getInitialUser().  This was
causing us to try to get the initial user before the first user was
created on initial boot.

This CL updates the logic to only try to get the initial user when
running the resume flow.

Bug: 144802294
Test: Flash and check logcat for crash.  100% repro before change, 0%
repro after change.
Change-Id: If500c1ccdb9655c46edb1745b007186757db0f2b
(cherry picked from commit 0e6e81fc86fdf340503d3e416ad274ae29817d37)
1 file changed
tree: d01bd1b82fd30d33751033a564ad88b96f849024
  1. car-bugreportd/
  2. car-default-input-service/
  3. car-lib/
  4. car-maps-placeholder/
  5. car-systemtest-lib/
  6. car-test-lib/
  7. car-usb-handler/
  8. car_product/
  9. EncryptionRunner/
  10. evs/
  11. FrameworkPackageStubs/
  12. obd2-lib/
  13. procfs-inspector/
  14. service/
  15. tests/
  16. tools/
  17. user/
  18. vehicle-hal-support-lib/
  19. .clang-format
  20. .gitignore
  21. Android.mk
  22. CleanSpec.mk
  23. OWNERS
  24. PREUPLOAD.cfg
  25. README.md
README.md

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.