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

Commit 403418b4 authored by Satoshi Niwa's avatar Satoshi Niwa Committed by Android (Google) Code Review
Browse files

Merge "Fix BackupManagerConstants observation for non-system users" into main

parents 019ae97f 0c524743
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -560,7 +560,10 @@ public class UserBackupManagerService {
        mJournalDir.mkdirs(); // creates mBaseStateDir along the way
        mJournal = null; // will be created on first use

        mConstants = new BackupManagerConstants(mBackupHandler, mContext.getContentResolver());
        // We need a context for the user in question to observe setting changes for that user.
        Context userContext = mContext.createContextAsUser(UserHandle.of(mUserId), /* flags */ 0);

        mConstants = new BackupManagerConstants(mBackupHandler, userContext.getContentResolver());
        // We are observing changes to the constants throughout the lifecycle of BMS. This is
        // because we reference the constants in multiple areas of BMS, which otherwise would
        // require frequent starting and stopping.