Skip to content
Commit 4188d8f8 authored by Ruslan Tkhakokhov's avatar Ruslan Tkhakokhov
Browse files

Do not write backup enabled status to file on init

 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
parent 0145f7e5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment