/frameworks/base/services/tests/servicestests/src/com/android/server/usage/ |
D | AppStandbyControllerTests.java | 107 private static final String PACKAGE_1 = "com.example.foo"; field in AppStandbyControllerTests 308 pi.packageName = PACKAGE_1; in setupPm() 373 controller.getAppStandbyBucket(PACKAGE_1, USER_ID, in setupController() 448 mController.setAppStandbyBucket(PACKAGE_1, USER_ID, STANDBY_BUCKET_RARE, in testIsAppIdle_Charging() 450 assertEquals(STANDBY_BUCKET_RARE, getStandbyBucket(mController, PACKAGE_1)); in testIsAppIdle_Charging() 451 assertTrue(mController.isAppIdleFiltered(PACKAGE_1, UID_1, USER_ID, 0)); in testIsAppIdle_Charging() 452 assertTrue(mController.isAppIdleFiltered(PACKAGE_1, UID_1, USER_ID, false)); in testIsAppIdle_Charging() 459 assertEquals(STANDBY_BUCKET_RARE, getStandbyBucket(mController, PACKAGE_1)); in testIsAppIdle_Charging() 460 assertFalse(mController.isAppIdleFiltered(PACKAGE_1, UID_1, USER_ID, 0)); in testIsAppIdle_Charging() 461 assertFalse(mController.isAppIdleFiltered(PACKAGE_1, UID_1, USER_ID, false)); in testIsAppIdle_Charging() [all …]
|
D | AppIdleHistoryTests.java | 40 private static final String PACKAGE_1 = "com.android.testpackage1"; field in AppIdleHistoryTests 98 aih.setAppStandbyBucket(PACKAGE_1, USER_ID, 1000, STANDBY_BUCKET_ACTIVE, in testBuckets() 101 assertFalse(aih.isIdle(PACKAGE_1, USER_ID, 2000)); in testBuckets() 110 aih.setAppStandbyBucket(PACKAGE_1, USER_ID, 3000, STANDBY_BUCKET_RARE, in testBuckets() 113 assertEquals(aih.getAppStandbyBucket(PACKAGE_1, USER_ID, 3000), STANDBY_BUCKET_RARE); in testBuckets() 115 assertEquals(aih.getAppStandbyReason(PACKAGE_1, USER_ID, 3000), REASON_MAIN_TIMEOUT); in testBuckets() 124 assertTrue(aih.isIdle(PACKAGE_1, USER_ID, 3000)); in testBuckets() 133 assertEquals(aih.getAppStandbyBucket(PACKAGE_1, USER_ID, 5000), STANDBY_BUCKET_RARE); in testBuckets() 135 assertEquals(aih.getAppStandbyReason(PACKAGE_1, USER_ID, 5000), REASON_MAIN_TIMEOUT); in testBuckets() 143 assertTrue(aih.shouldInformListeners(PACKAGE_1, USER_ID, 5000, STANDBY_BUCKET_RARE)); in testBuckets() [all …]
|
/frameworks/base/services/robotests/backup/src/com/android/server/backup/keyvalue/ |
D | KeyValueBackupTaskTest.java | 173 private static final PackageData PACKAGE_1 = keyValuePackage(1); field in KeyValueBackupTaskTest 331 Files.write(getStateFile(mTransport, PACKAGE_1), "packageState".getBytes()); in testRunTask_whenQueueEmpty_doesNotChangeStateFiles() 337 assertThat(Files.readAllBytes(getStateFile(mTransport, PACKAGE_1))) in testRunTask_whenQueueEmpty_doesNotChangeStateFiles() 358 setUpAgentWithData(PACKAGE_1); in testRunTask_whenOnePackageAndTransportUnavailable() 359 KeyValueBackupTask task = createKeyValueBackupTask(transportMock, PACKAGE_1); in testRunTask_whenOnePackageAndTransportUnavailable() 365 assertBackupPendingFor(PACKAGE_1); in testRunTask_whenOnePackageAndTransportUnavailable() 371 setUpAgentWithData(PACKAGE_1); in testRunTask_whenOnePackage_logsBackupStartEvent() 372 KeyValueBackupTask task = createKeyValueBackupTask(transportMock, PACKAGE_1); in testRunTask_whenOnePackage_logsBackupStartEvent() 382 setUpAgentWithData(PACKAGE_1); in testRunTask_whenOnePackage_releasesWakeLock() 383 KeyValueBackupTask task = createKeyValueBackupTask(transportMock, PACKAGE_1); in testRunTask_whenOnePackage_releasesWakeLock() [all …]
|
/frameworks/base/packages/BackupEncryption/test/robolectric/src/com/android/server/backup/encryption/keys/ |
D | TertiaryKeyRotationTrackerTest.java | 33 private static final String PACKAGE_1 = "com.package.one"; field in TertiaryKeyRotationTrackerTest 49 boolean keyRotationDue = mTertiaryKeyRotationTracker.isKeyRotationDue(PACKAGE_1); in isKeyRotationDue_forNewPackage_isFalse() 60 simulateBackups(PACKAGE_1, NUMBER_OF_BACKUPS_BEFORE_ROTATION - 1); in isKeyRotationDue_afterLessThanRotationAmountBackups_isFalse() 62 boolean keyRotationDue = mTertiaryKeyRotationTracker.isKeyRotationDue(PACKAGE_1); in isKeyRotationDue_afterLessThanRotationAmountBackups_isFalse() 70 simulateBackups(PACKAGE_1, NUMBER_OF_BACKUPS_BEFORE_ROTATION); in isKeyRotationDue_afterRotationAmountBackups_isTrue() 72 boolean keyRotationDue = mTertiaryKeyRotationTracker.isKeyRotationDue(PACKAGE_1); in isKeyRotationDue_afterRotationAmountBackups_isTrue() 83 simulateBackups(PACKAGE_1, NUMBER_OF_BACKUPS_BEFORE_ROTATION); in resetCountdown_makesKeyRotationNotDue() 85 mTertiaryKeyRotationTracker.resetCountdown(PACKAGE_1); in resetCountdown_makesKeyRotationNotDue() 87 assertThat(mTertiaryKeyRotationTracker.isKeyRotationDue(PACKAGE_1)).isFalse(); in resetCountdown_makesKeyRotationNotDue() 96 simulateBackups(PACKAGE_1, NUMBER_OF_BACKUPS_BEFORE_ROTATION); in isKeyRotationDue_forNewInstance_readsStateFromDisk() [all …]
|
D | TertiaryKeyRotationSchedulerTest.java | 50 private static final String PACKAGE_1 = "com.android.example1"; field in TertiaryKeyRotationSchedulerTest 78 assertThat(mScheduler.isKeyRotationDue(PACKAGE_1)).isFalse(); in isKeyRotationDue_isFalseInitially() 85 assertThat(mScheduler.isKeyRotationDue(PACKAGE_1)).isFalse(); in isKeyRotationDue_isFalseAfterInsufficientBackups() 92 assertThat(mScheduler.isKeyRotationDue(PACKAGE_1)).isTrue(); in isKeyRotationDue_isTrueAfterEnoughBackups() 100 assertThat(mScheduler.isKeyRotationDue(PACKAGE_1)).isTrue(); in isKeyRotationDue_isTrueIfRotationQuotaRemainsInWindow() 109 assertThat(mScheduler.isKeyRotationDue(PACKAGE_1)).isFalse(); in isKeyRotationDue_isFalseIfEnoughRotationsHaveHappenedInWindow() 119 assertThat(mScheduler.isKeyRotationDue(PACKAGE_1)).isTrue(); in isKeyRotationDue_isTrueAfterAWholeWindowHasPassed() 126 mScheduler.recordKeyRotation(PACKAGE_1); in isKeyRotationDue_isFalseAfterRotation() 127 assertThat(mScheduler.isKeyRotationDue(PACKAGE_1)).isFalse(); in isKeyRotationDue_isFalseAfterRotation() 192 mScheduler.recordBackup(PACKAGE_1); in simulateBackups()
|
/frameworks/base/services/robotests/backup/src/com/android/server/backup/restore/ |
D | ActiveRestoreSessionTest.java | 90 private static final String PACKAGE_1 = "com.example.package1"; field in ActiveRestoreSessionTest 159 IRestoreSession restoreSession = createActiveRestoreSession(PACKAGE_1, mTransport); in testGetAvailableRestoreSets_withoutPermission() 170 IRestoreSession restoreSession = createActiveRestoreSession(PACKAGE_1, mTransport); in testGetAvailableRestoreSets_forNullObserver() 181 IRestoreSession restoreSession = createActiveRestoreSession(PACKAGE_1, mTransport); in testGetAvailableRestoreSets_whenTransportNotRegistered() 194 IRestoreSession restoreSession = createActiveRestoreSession(PACKAGE_1, mTransport); in testGetAvailableRestoreSets() 212 IRestoreSession restoreSession = createActiveRestoreSession(PACKAGE_1, mTransport); in testGetAvailableRestoreSets_forEmptyRestoreSets() 227 IRestoreSession restoreSession = createActiveRestoreSession(PACKAGE_1, mTransport); in testGetAvailableRestoreSets_forNullRestoreSets() 281 createActiveRestoreSessionWithRestoreSets(PACKAGE_1, mTransport, mRestoreSet1); in testRestoreAll_whenSinglePackageSession() 337 new String[] {PACKAGE_1, PACKAGE_2}, mMonitor); in testRestorePackages_for2Packages() 347 assertThat(shadowTask.getFilterSet()).asList().containsExactly(PACKAGE_1, PACKAGE_2); in testRestorePackages_for2Packages() [all …]
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/ |
D | ShadeListBuilderTest.java | 127 addNotif(0, PACKAGE_1).setRank(2); in testNotifsAreSortedByRankAndWhen() 133 addNotif(6, PACKAGE_1).setRank(0); in testNotifsAreSortedByRankAndWhen() 153 addGroupChild(0, PACKAGE_1, GROUP_1); in testNotifsAreGrouped() 154 addGroupChild(1, PACKAGE_1, GROUP_1); in testNotifsAreGrouped() 155 addGroupChild(2, PACKAGE_1, GROUP_1); in testNotifsAreGrouped() 156 addGroupSummary(3, PACKAGE_1, GROUP_1); in testNotifsAreGrouped() 175 addGroupChild(0, PACKAGE_1, GROUP_1); in testNotifsWithDifferentGroupKeysAreGrouped() 176 addGroupChild(1, PACKAGE_1, GROUP_2); in testNotifsWithDifferentGroupKeysAreGrouped() 177 addGroupSummary(2, PACKAGE_1, GROUP_2); in testNotifsWithDifferentGroupKeysAreGrouped() 178 addGroupChild(3, PACKAGE_1, GROUP_2); in testNotifsWithDifferentGroupKeysAreGrouped() [all …]
|
/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/ |
D | CarrierPrivilegesTrackerTest.java | 81 private static final String PACKAGE_1 = "android.test.package1"; field in CarrierPrivilegesTrackerTest 185 new PackageCertInfo(PACKAGE_1, CERT_1, USER_1, UID_1), in setupCarrierPrivilegesTrackerWithCarrierConfigUids() 193 new PackageCertInfo(PACKAGE_1, CERT_1, USER_1, UID_1), in setupCarrierPrivilegesTrackerWithSimLoadedUids() 271 new PackageCertInfo(PACKAGE_1, CERT_1, USER_1, UID_1), in testCarrierConfigUpdated() 325 new PackageCertInfo(PACKAGE_1, CERT_1, USER_1, UID_1), in testSimCardStateChanged() 343 new PackageCertInfo(PACKAGE_1, CERT_1, USER_1, UID_1), in testSimApplicationStateChanged() 400 setupInstalledPackages(new PackageCertInfo(PACKAGE_1, CERT_1, USER_1, UID_1)); in testPackageAdded() 402 sendPackageChangedIntent(Intent.ACTION_PACKAGE_ADDED, PACKAGE_1); in testPackageAdded() 415 new PackageCertInfo(PACKAGE_1, CERT_1, USER_1, UID_1), in testPackageAddedMultipleUsers() 416 new PackageCertInfo(PACKAGE_1, CERT_2, USER_2, UID_2)); in testPackageAddedMultipleUsers() [all …]
|
/frameworks/base/services/robotests/backup/src/com/android/server/backup/ |
D | UserBackupManagerServiceTest.java | 109 private static final String PACKAGE_1 = "some.package.1"; field in UserBackupManagerServiceTest 222 registerPackages(PACKAGE_1); in testIsAppEligibleForBackup_whenAppNotEligible() 225 boolean result = backupManagerService.isAppEligibleForBackup(PACKAGE_1); in testIsAppEligibleForBackup_whenAppNotEligible() 238 registerPackages(PACKAGE_1); in testIsAppEligibleForBackup_whenAppEligible() 239 ShadowAppBackupUtils.setAppRunningAndEligibleForBackupWithTransport(PACKAGE_1); in testIsAppEligibleForBackup_whenAppEligible() 242 boolean result = backupManagerService.isAppEligibleForBackup(PACKAGE_1); in testIsAppEligibleForBackup_whenAppEligible() 257 registerPackages(PACKAGE_1); in testIsAppEligibleForBackup_withoutPermission() 258 ShadowAppBackupUtils.setAppRunningAndEligibleForBackupWithTransport(PACKAGE_1); in testIsAppEligibleForBackup_withoutPermission() 263 () -> backupManagerService.isAppEligibleForBackup(PACKAGE_1)); in testIsAppEligibleForBackup_withoutPermission() 275 registerPackages(PACKAGE_1, PACKAGE_2); in testFilterAppsEligibleForBackup() [all …]
|
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/ |
D | AppStateTrackerTest.java | 153 private static final String PACKAGE_1 = "package1"; field in AppStateTrackerTest 334 areRestricted(instance, UID_1, PACKAGE_1, NONE); in testAll() 338 areRestrictedWithExemption(instance, UID_1, PACKAGE_1, NONE); in testAll() 347 areRestricted(instance, UID_1, PACKAGE_1, JOBS_AND_ALARMS); in testAll() 351 areRestrictedWithExemption(instance, UID_1, PACKAGE_1, NONE); in testAll() 365 areRestricted(instance, UID_1, PACKAGE_1, NONE); in testAll() 373 areRestricted(instance, UID_1, PACKAGE_1, JOBS_AND_ALARMS); in testAll() 381 areRestricted(instance, UID_1, PACKAGE_1, NONE); in testAll() 387 areRestricted(instance, UID_1, PACKAGE_1, JOBS_AND_ALARMS); in testAll() 397 assertTrue(instance.isRunAnyInBackgroundAppOpsAllowed(UID_1, PACKAGE_1)); in testAll() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/people/prediction/ |
D | ShareTargetPredictorTest.java | 69 private static final String PACKAGE_1 = "pkg1"; field in ShareTargetPredictorTest 103 when(mDataManager.getPackage(PACKAGE_1, USER_ID)).thenReturn(mPackageData1); in setUp() 120 mShareShortcuts.add(buildShareShortcut(PACKAGE_1, CLASS_1, "sc1", 0)); in testPredictTargets() 121 mShareShortcuts.add(buildShareShortcut(PACKAGE_1, CLASS_1, "sc2", 0)); in testPredictTargets() 155 assertEquals(PACKAGE_1, res.get(1).getPackageName()); in testPredictTargets() 159 assertEquals(PACKAGE_1, res.get(2).getPackageName()); in testPredictTargets() 168 mShareShortcuts.add(buildShareShortcut(PACKAGE_1, CLASS_1, "sc1", 0)); in testPredictTargets_reachTargetsLimit() 169 mShareShortcuts.add(buildShareShortcut(PACKAGE_1, CLASS_1, "sc2", 0)); in testPredictTargets_reachTargetsLimit() 172 mShareShortcuts.add(buildShareShortcut(PACKAGE_1, CLASS_1, "sc5", 0)); in testPredictTargets_reachTargetsLimit() 220 assertEquals(PACKAGE_1, res.get(1).getPackageName()); in testPredictTargets_reachTargetsLimit() [all …]
|
D | SharesheetModelScorerTest.java | 55 private static final String PACKAGE_1 = "pkg1"; field in SharesheetModelScorerTest 130 new AppTargetId("cls1#pkg1"), PACKAGE_1, UserHandle.of(USER_ID)) in setUp() 134 new AppTarget.Builder(new AppTargetId("cls2#pkg1"), PACKAGE_1, in setUp() 274 Map.of(PACKAGE_1, new AppUsageStatsData(1, 0), in testComputeScoreForAppShare_promoteFrequentlyChosenApps() 307 Map.of(PACKAGE_1, new AppUsageStatsData(0, 1), in testComputeScoreForAppShare_promoteFrequentlyUsedApps() 345 Map.of(PACKAGE_1, new AppUsageStatsData(0, 1), in testComputeScoreForAppShare_skipPromoteFrequentlyUsedAppsWhenReachesLimit()
|