Tweaks to enhance testability
1) Add two entry points to SystemInterface:
- getFilesDir(): returns a directory where permanent data can be stored (by default Context.getFilesDir())
This allows components under test to store data without affecting the real version of the files
- getCurrentUptime(): returns the length of time that the system has been running (by default via SystemClock)
This is useful to enable testing of time-sensitive components
2) Add a TemporaryDirectory helper with the same semantics as TemporaryFile.
Move both TemporaryFile and TemporaryDirectory to their own package in order to share between carservice_test and carservice_unit_test
Bug: 32512551
Test: runtest -x packages/services/Car/tests/carservice_unit_test
runtest -x packages/services/Car/tests/carservice_unit_test/src/com/android/car/CarPowerManagementServiceTest.java
runtest -x packages/services/Car/tests/carservice_test/src/com/android/car/CarStorageMonitoringTest.java
Change-Id: I31480cbd6b66df83804cc331d8c25a1403f10fe7
12 files changed