services/tests/servicestests/src/com/android/server/backup/UserBackupManagerServiceTest.java
0 → 100644
+80
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
When backup service is brought up, we read the enabled status from a file and store it in a class variable in UserBackupManagerService. However, we also write the value we just read back into the file. This is an unncessary operation and it makes the code more fragile: if we read the wrong value due to some I/O error, we'll then write it back making the error permanent. More details here: https://docs.google.com/document/d/1GtR2HYMiSJuy0wuxBg8n_zkEJGl3C5apcvpvKheNa_A/edit Bug: 149084461 Test: 1. "bmgr enable true"; verify "bmgr enabled" returns true; reboot; verify "bmgr enabled" returns true 2. "bmgr enable false"; verify "bmgr enabled" returns false; reboot; verify "bmgr enabled" returns false 3. atest RunBackupFrameworksServicesRoboTests 4. atest FrameworksServicesTests:UserBackupManagerServiceTest Change-Id: If213a6b1de0de51c9337138be347c304b44689d1