/packages/modules/HealthFitness/tests/unittests/src/com/android/server/healthconnect/migration/ |
D | MigrationUiStateManagerTest.java | 61 @Mock private MigrationStateManager mMigrationStateManager; field in MigrationUiStateManagerTest 79 mMigrationStateManager, in setUp() 81 mMigrationUiStateManager.attachTo(mMigrationStateManager); in setUp() 91 verify(mMigrationStateManager).addStateChangedListener(any()); in testUiManagerInitialisation_addsListenerToMigrationStateManager() 96 when(mMigrationStateManager.getMigrationState()) in testStateChanged_idle_noNotificationSent() 101 verify(mMigrationStateManager).addStateChangedListener(captor.capture()); in testStateChanged_idle_noNotificationSent() 109 when(mMigrationStateManager.getMigrationState()) in testStateChanged_appUpdateNeeded_noMigrationUiAppUpdateNeededNotificationSent() 114 verify(mMigrationStateManager).addStateChangedListener(captor.capture()); in testStateChanged_appUpdateNeeded_noMigrationUiAppUpdateNeededNotificationSent() 125 when(mMigrationStateManager.getMigrationState()) in testStateChanged_moduleUpdateNeeded_migrationUiModuleUpdateNeededNotificationSent() 130 verify(mMigrationStateManager).addStateChangedListener(captor.capture()); in testStateChanged_moduleUpdateNeeded_migrationUiModuleUpdateNeededNotificationSent() [all …]
|
D | MigrationStateManagerTest.java | 120 private MigrationStateManager mMigrationStateManager; field in MigrationStateManagerTest 150 mMigrationStateManager = in setUp() 152 mMigrationStateManager.addStateChangedListener(mMockListener::onMigrationStateChanged); in setUp() 171 mMigrationStateManager.onPackageInstalledOrChanged(mContext, MOCK_CONFIGURED_PACKAGE); in testOnPackageInstalledOrChanged_fromIdleState_migrationAwarePackage() 187 mMigrationStateManager.onPackageInstalledOrChanged(mContext, MOCK_CONFIGURED_PACKAGE); in testOnPackageInstalledOrChanged_fromIdleState_migrationUnawarePackage() 201 mMigrationStateManager.onPackageInstalledOrChanged(mContext, MOCK_CONFIGURED_PACKAGE); in testOnPackageInstalledOrChanged_fromIdleState_migrationUnawareStubPackage() 212 mMigrationStateManager.onPackageInstalledOrChanged(mContext, MOCK_CONFIGURED_PACKAGE); in testOnPackageInstalledOrChanged_fromAppUpgradeRequiredState_migrationAwarePackage() 229 mMigrationStateManager.onPackageInstalledOrChanged(mContext, MOCK_CONFIGURED_PACKAGE); in testOnPackageInstalledOrChanged_fromAppUpgradeRequiredState_migrationUnAwarePackage() 243 mMigrationStateManager.onPackageInstalledOrChanged(mContext, MOCK_CONFIGURED_PACKAGE); in testOnPackageInstalledOrChanged_fromAllowedState() 257 mMigrationStateManager.onPackageInstalledOrChanged(mContext, MOCK_CONFIGURED_PACKAGE); in testOnPackageInstalledOrChanged_fromInProgressState() [all …]
|
D | MigrationBroadcastSchedulingTest.java | 77 @Mock private MigrationStateManager mMigrationStateManager; field in MigrationBroadcastSchedulingTest 139 when(MigrationStateManager.getInitialisedInstance()).thenReturn(mMigrationStateManager); in testScheduling_migrationInProgressIntervalGreaterThanMinimum_periodicJobScheduled() 140 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_IN_PROGRESS); in testScheduling_migrationInProgressIntervalGreaterThanMinimum_periodicJobScheduled() 151 when(MigrationStateManager.getInitialisedInstance()).thenReturn(mMigrationStateManager); in testScheduling_migrationInProgressIntervalEqualToMinimum_periodicJobScheduled() 152 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_IN_PROGRESS); in testScheduling_migrationInProgressIntervalEqualToMinimum_periodicJobScheduled() 163 when(MigrationStateManager.getInitialisedInstance()).thenReturn(mMigrationStateManager); in testScheduling_migrationInProgressIntervalLessThanMinimum_periodicJobScheduled() 164 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_IN_PROGRESS); in testScheduling_migrationInProgressIntervalLessThanMinimum_periodicJobScheduled() 176 when(MigrationStateManager.getInitialisedInstance()).thenReturn(mMigrationStateManager); in testScheduling_migrationAllowedIntervalGreaterThanMinimum_periodicJobScheduled() 177 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_ALLOWED); in testScheduling_migrationAllowedIntervalGreaterThanMinimum_periodicJobScheduled() 188 when(MigrationStateManager.getInitialisedInstance()).thenReturn(mMigrationStateManager); in testScheduling_requiredCountEqualToZero_noJobScheduled() [all …]
|
D | MigrationStateChangeJobTest.java | 88 @Mock MigrationStateManager mMigrationStateManager; field in MigrationStateChangeJobTest 125 when(MigrationStateManager.getInitialisedInstance()).thenReturn(mMigrationStateManager); in setUp() 154 clearInvocations(mMigrationStateManager); in tearDown() 163 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_IN_PROGRESS); in testExecutePauseJob_timeNotExpired() 177 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_IN_PROGRESS); in testExecutePauseJob_timeExpired_shouldChangeState() 187 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_ALLOWED); in testExecutePauseJob_inAllowedState() 196 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_COMPLETE); in testExecutePauseJob_inCompleteState() 206 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_IDLE); in testExecuteCompleteJob_fromIdleState_timeNotExpired() 218 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_IDLE); in testExecuteCompleteJob_fromIdleState() 229 when(mMigrationStateManager.getMigrationState()).thenReturn(MIGRATION_STATE_ALLOWED); in testExecuteCompleteJob_fromAllowedState_timeNotExpired() [all …]
|
D | MigratorPackageChangesReceiverTest.java | 64 @Mock MigrationStateManager mMigrationStateManager; field in MigratorPackageChangesReceiverTest 76 when(MigrationStateManager.getInitialisedInstance()).thenReturn(mMigrationStateManager); in setUp() 79 new MigratorPackageChangesReceiver(mMigrationStateManager); in setUp() 88 clearInvocations(mMigrationStateManager); in tearDown() 96 verify(mMigrationStateManager) in testPackageAdded_callsOnPackageInstalledOrChanged() 105 verify(mMigrationStateManager) in testPackageChanged_callsOnPackageInstalledOrChanged() 114 verify(mMigrationStateManager).onPackageRemoved(eq(mContext), eq(MOCK_CONFIGURED_PACKAGE)); in testPackageRemoved_callsOnPackageRemoved() 122 verify(mMigrationStateManager, never()).onPackageInstalledOrChanged(any(), any()); in testOnReceive_nullPackage_noMigrationStateManagerCall() 123 verify(mMigrationStateManager, never()).onPackageRemoved(any(), any()); in testOnReceive_nullPackage_noMigrationStateManagerCall() 131 verify(mMigrationStateManager, never()).onPackageInstalledOrChanged(any(), any()); in testOnReceive_nullUserHandle_noMigrationStateManagerCall() [all …]
|
D | MigrationCleanerTest.java | 43 @Mock private MigrationStateManager mMigrationStateManager; field in MigrationCleanerTest 55 mCleaner.attachTo(mMigrationStateManager); in testAttachTo_addsListenerToMigrationStateManager() 57 verify(mMigrationStateManager).addStateChangedListener(any()); in testAttachTo_addsListenerToMigrationStateManager() 62 mCleaner.attachTo(mMigrationStateManager); in testStateChanged_complete_tablesCleared() 65 verify(mMigrationStateManager).addStateChangedListener(captor.capture()); in testStateChanged_complete_tablesCleared() 74 mCleaner.attachTo(mMigrationStateManager); in testStateChanged_notComplete_noTablesCleared() 77 verify(mMigrationStateManager).addStateChangedListener(captor.capture()); in testStateChanged_notComplete_noTablesCleared()
|
/packages/modules/HealthFitness/service/java/com/android/server/healthconnect/migration/ |
D | MigrationUiStateManager.java | 49 private final MigrationStateManager mMigrationStateManager; field in MigrationUiStateManager 60 this.mMigrationStateManager = migrationStateManager; in MigrationUiStateManager() 78 int migrationState = mMigrationStateManager.getMigrationState(); in getHealthConnectMigrationUiState() 143 return mMigrationStateManager.hasIdleStateTimedOut(); in isUiStateCompleteFromIdle() 148 int migrationStartsCount = mMigrationStateManager.getMigrationStartsCount(); in isUiStateAllowedPaused() 150 mMigrationStateManager.existsMigrationAwarePackage(mContext) in isUiStateAllowedPaused() 151 && mMigrationStateManager.existsMigratorPackage(mContext); in isUiStateAllowedPaused() 153 mMigrationStateManager.doesMigratorHandleInfoIntent(mContext); in isUiStateAllowedPaused() 159 int migrationStartsCount = mMigrationStateManager.getMigrationStartsCount(); in isMigratorDisabled() 161 mMigrationStateManager.doesMigratorHandleInfoIntent(mContext); in isMigratorDisabled() [all …]
|
D | MigratorPackageChangesReceiver.java | 44 private final MigrationStateManager mMigrationStateManager; field in MigratorPackageChangesReceiver 47 mMigrationStateManager = migrationStateManager; in MigratorPackageChangesReceiver() 72 mMigrationStateManager.onPackageRemoved(context, packageName); in onReceive() 78 mMigrationStateManager.onPackageInstalledOrChanged(context, packageName); in onReceive()
|
/packages/modules/HealthFitness/tests/unittests/src/com/android/server/healthconnect/ |
D | HealthConnectServiceImplTest.java | 192 @Mock private MigrationStateManager mMigrationStateManager; field in HealthConnectServiceImplTest 237 mMigrationStateManager, in setUp() 251 verify(mMigrationCleaner).attachTo(mMigrationStateManager); in testInstantiated_attachesMigrationCleanerToMigrationStateManager() 385 verifyZeroInteractions(mMigrationStateManager); in testStartMigration_noShowMigrationInfoIntentAvailable_returnsError() 398 verify(mMigrationStateManager).startMigration(mServiceContext); in testStartMigration_showMigrationInfoIntentAvailable() 408 verifyZeroInteractions(mMigrationStateManager); in testFinishMigration_noShowMigrationInfoIntentAvailable_returnsError() 422 verify(mMigrationStateManager).finishMigration(mServiceContext); in testFinishMigration_showMigrationInfoIntentAvailable() 434 verifyZeroInteractions(mMigrationStateManager); in testWriteMigration_noShowMigrationInfoIntentAvailable_returnsError() 450 verify(mMigrationStateManager).validateWriteMigrationData(); in testWriteMigration_showMigrationInfoIntentAvailable() 461 verifyZeroInteractions(mMigrationStateManager); in testInsertMinSdkExtVersion_noShowMigrationInfoIntentAvailable_returnsError() [all …]
|
/packages/modules/HealthFitness/tests/unittests/src/com/android/server/healthconnect/backuprestore/ |
D | BackupRestoreTest.java | 131 @Mock private MigrationStateManager mMigrationStateManager; field in BackupRestoreTest 159 new BackupRestore(mFirstGrantTimeManager, mMigrationStateManager, mServiceContext); in setUp() 570 when(mMigrationStateManager.isMigrationInProgress()).thenReturn(true); in testScheduleAllTimeoutJobs_stagingDoneAndMigration_schedulesRetryMergingJob() 591 when(mMigrationStateManager.isMigrationInProgress()).thenReturn(true); in testScheduleAllTimeoutJobs_mergingWithBugAndMigration_schedulesRetryMergingJob() 611 when(mMigrationStateManager.isMigrationInProgress()).thenReturn(true); in testRetryMergingTimeoutJob_retryLatencyElapsed_usesRetryLatency() 640 when(mMigrationStateManager.isMigrationInProgress()).thenReturn(true); in testRetryMergingTimeoutJob_retryLatencyElapsed_usesMinimumLatency() 847 when(mMigrationStateManager.isMigrationInProgress()).thenReturn(true); in testMerge_whenMigrationInProgress_schedulesRetryMergingJob()
|
/packages/modules/HealthFitness/service/java/com/android/server/healthconnect/ |
D | HealthConnectServiceImpl.java | 205 private final MigrationStateManager mMigrationStateManager; field in HealthConnectServiceImpl 238 mMigrationStateManager = migrationStateManager; in HealthConnectServiceImpl() 243 new BackupRestore(mFirstGrantTimeManager, mMigrationStateManager, mContext); in HealthConnectServiceImpl() 1654 mMigrationStateManager.startMigration(mContext); in startMigration() 1691 mMigrationStateManager.finishMigration(mContext); in finishMigration() 1731 mMigrationStateManager.validateWriteMigrationData(); in writeMigrationData() 1776 mMigrationStateManager.validateSetMinSdkVersion(); in insertMinDataMigrationSdkExtensionVersion() 1777 mMigrationStateManager.setMinDataMigrationSdkExtensionVersion( in insertMinDataMigrationSdkExtensionVersion() 1888 mMigrationStateManager.clearCaches(mContext); in deleteAllStagedRemoteData() 1945 mMigrationStateManager.getMigrationState())); in getHealthConnectDataState() [all …]
|
/packages/modules/HealthFitness/service/java/com/android/server/healthconnect/backuprestore/ |
D | BackupRestore.java | 181 private final MigrationStateManager mMigrationStateManager; field in BackupRestore 198 mMigrationStateManager = migrationStateManager; in BackupRestore() 576 if (mMigrationStateManager.isMigrationInProgress()) { in merge()
|