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

Commit 38457f6b authored by Raphael Kim's avatar Raphael Kim
Browse files

[CDM] Initialize backup restore processor before loading associations from disk.

Bug: 314992577
Test: atest CtsCompanionDeviceManagerCoreTestCases:BackupAndRestoreTest
Change-Id: I4f41c940045ed89fe3af6ffe20966390ec21bd25
parent 0200a771
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -247,6 +247,11 @@ public class CompanionDeviceManagerService extends SystemService {
        final Context context = getContext();

        mPersistentStore = new PersistentDataStore();
        mAssociationRequestsProcessor = new AssociationRequestsProcessor(
                /* cdmService */ this, mAssociationStore);
        mBackupRestoreProcessor = new BackupRestoreProcessor(
                /* cdmService */ this, mAssociationStore, mPersistentStore,
                mSystemDataTransferRequestStore, mAssociationRequestsProcessor);

        loadAssociationsFromDisk();
        mAssociationStore.registerListener(mAssociationStoreChangeListener);
@@ -254,17 +259,12 @@ public class CompanionDeviceManagerService extends SystemService {
        mDevicePresenceMonitor = new CompanionDevicePresenceMonitor(mUserManager,
                mAssociationStore, mDevicePresenceCallback);

        mAssociationRequestsProcessor = new AssociationRequestsProcessor(
                /* cdmService */this, mAssociationStore);
        mCompanionAppController = new CompanionApplicationController(
                context, mAssociationStore, mDevicePresenceMonitor);
        mTransportManager = new CompanionTransportManager(context, mAssociationStore);
        mSystemDataTransferProcessor = new SystemDataTransferProcessor(this,
                mPackageManagerInternal, mAssociationStore,
                mSystemDataTransferRequestStore, mTransportManager);
        mBackupRestoreProcessor = new BackupRestoreProcessor(
                /* cdmService */ this, mAssociationStore, mPersistentStore,
                mSystemDataTransferRequestStore, mAssociationRequestsProcessor);
        // TODO(b/279663946): move context sync to a dedicated system service
        mCrossDeviceSyncController = new CrossDeviceSyncController(getContext(), mTransportManager);