Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb7b3208 authored by Varun Shah's avatar Varun Shah
Browse files

Persist UsageStats before backup.

This fixes a bug where in-memory usage stats were not being backed up,
potentially causing a loss of up to 20 minutes of data when restoring.

Fixes: 155930164
Test: atest UsageStatsDatabaseTest
Test: atest android.app.usage.cts.UsageStatsTest
Change-Id: I454f64e7de3f7a6046c408859998a3e51d5d338d
parent 40f632b7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1166,6 +1166,7 @@ class UserUsageStatsService {

    byte[] getBackupPayload(String key){
        checkAndGetTimeLocked();
        persistActiveStats();
        return mDatabase.getBackupPayload(key);
    }