/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/ |
D | BatteryUtilsTest.java | 92 private static final int UID = 12345; field in BatteryUtilsTest 305 AppOpsManager.OP_RUN_IN_BACKGROUND, UID, PACKAGE_NAME); in testBackgroundRestrictionOn_restrictionOn_returnTrue() 307 assertThat(mBatteryUtils.isBackgroundRestrictionEnabled(SDK_VERSION, UID, in testBackgroundRestrictionOn_restrictionOn_returnTrue() 314 AppOpsManager.OP_RUN_IN_BACKGROUND, UID, PACKAGE_NAME); in testBackgroundRestrictionOn_restrictionOff_returnFalse() 316 assertThat(mBatteryUtils.isBackgroundRestrictionEnabled(SDK_VERSION, UID, PACKAGE_NAME)) in testBackgroundRestrictionOn_restrictionOff_returnFalse() 344 mBatteryUtils.setForceAppStandby(UID, LOW_SDK_PACKAGE, AppOpsManager.MODE_IGNORED); in testSetForceAppStandby_forcePreOApp_forceTwoRestrictions() 347 verify(mAppOpsManager).setMode(AppOpsManager.OP_RUN_IN_BACKGROUND, UID, LOW_SDK_PACKAGE, in testSetForceAppStandby_forcePreOApp_forceTwoRestrictions() 349 verify(mAppOpsManager).setMode(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID, LOW_SDK_PACKAGE, in testSetForceAppStandby_forcePreOApp_forceTwoRestrictions() 356 mBatteryUtils.setForceAppStandby(UID, HIGH_SDK_PACKAGE, AppOpsManager.MODE_IGNORED); in testSetForceAppStandby_forceOApp_forceOneRestriction() 359 verify(mAppOpsManager, never()).setMode(AppOpsManager.OP_RUN_IN_BACKGROUND, UID, in testSetForceAppStandby_forceOApp_forceOneRestriction() [all …]
|
D | BatteryOptimizeUtilsTest.java | 67 private static final int UID = 12345; field in BatteryOptimizeUtilsTest 83 mBatteryOptimizeUtils = spy(new BatteryOptimizeUtils(mContext, UID, PACKAGE_NAME)); in setUp() 139 new BatteryOptimizeUtils(mContext, UID, null); in testIsValidPackageName_InvalidPackageName_returnFalse() 298 applicationInfo.uid = UID; in runTestForResetWithMode() 326 verify(mMockBatteryUtils).setForceAppStandby(UID, PACKAGE_NAME, appStandbyMode); in verifySetAppOptimizationMode()
|
D | RestrictedAppDetailsTest.java | 72 private static final int UID = UserHandle.getUid(USER_ID, 234); field in RestrictedAppDetailsTest 101 .setUid(UID) in setUp() 128 doReturn(true).when(mRestrictedAppDetails.mBatteryUtils).isForceAppStandbyEnabled(UID, in refreshUi_displayPreference() 131 timestampArray.put(UID, System.currentTimeMillis() - TimeUnit.HOURS.toMillis(5)); in refreshUi_displayPreference()
|
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/notifications/ |
D | NotificationsAppListPreferenceControllerTest.java | 59 private static final int UID = 1001010; field in NotificationsAppListPreferenceControllerTest 98 applicationInfo.uid = UID; in setUp() 111 when(mMockManager.areNotificationsEnabledForPackage(PKG_NAME, UID)).thenReturn(true); in onCreate_createsPreference() 127 when(mMockManager.areNotificationsEnabledForPackage(PKG_NAME, UID)).thenReturn(true); in onCreate_notificationEnabled_isChecked() 140 when(mMockManager.areNotificationsEnabledForPackage(PKG_NAME, UID)).thenReturn(false); in onCreate_notificationDisabled_isNotChecked() 153 when(mMockManager.areNotificationsEnabledForPackage(PKG_NAME, UID)).thenReturn(false); in toggle_setEnable_enablingNotification() 154 when(mMockManager.onlyHasDefaultChannel(PKG_NAME, UID)).thenReturn(false); in toggle_setEnable_enablingNotification() 164 verify(mMockManager).setNotificationsEnabledForPackage(PKG_NAME, UID, true); in toggle_setEnable_enablingNotification() 169 when(mMockManager.areNotificationsEnabledForPackage(PKG_NAME, UID)).thenReturn(true); in toggle_setDisable_disablingNotification() 170 when(mMockManager.onlyHasDefaultChannel(PKG_NAME, UID)).thenReturn(false); in toggle_setDisable_disablingNotification() [all …]
|
/packages/modules/Connectivity/nearby/tests/unit/src/com/android/server/nearby/util/ |
D | DiscoveryPermissionsTest.java | 48 private static final int UID = 1234; field in DiscoveryPermissionsTest 60 .forTest(UID, PID, PACKAGE_NAME, /* attributionTag= */ null); in setup() 65 when(mMockContext.checkPermission(BLUETOOTH_SCAN, PID, UID)).thenReturn(PERMISSION_DENIED); in test_enforceCallerDiscoveryPermission_exception() 74 when(mMockContext.checkPermission(BLUETOOTH_SCAN, PID, UID)).thenReturn(PERMISSION_GRANTED); in test_checkCallerDiscoveryPermission_granted() 83 when(mMockContext.checkPermission(BLUETOOTH_SCAN, PID, UID)).thenReturn(PERMISSION_DENIED); in test_checkCallerDiscoveryPermission_denied() 92 when(mMockAppOps.noteOp(DiscoveryPermissions.OPSTR_BLUETOOTH_SCAN, UID, PACKAGE_NAME, in test_checkNoteOpPermission_granted() 102 when(mMockAppOps.noteOp(DiscoveryPermissions.OPSTR_BLUETOOTH_SCAN, UID, PACKAGE_NAME, in test_checkNoteOpPermission_denied() 112 when(mMockContext.checkPermission(BLUETOOTH_SCAN, PID, UID)).thenReturn(PERMISSION_DENIED); in test_getPermissionLevel_none() 115 .getPermissionLevel(mMockContext, UID, PID)) in test_getPermissionLevel_none() 121 when(mMockContext.checkPermission(BLUETOOTH_SCAN, PID, UID)) in test_getPermissionLevel_scan() [all …]
|
D | BroadcastPermissionsTest.java | 46 private static final int UID = 1234; field in BroadcastPermissionsTest 56 .forTest(UID, PID, PACKAGE_NAME, /* attributionTag= */ null); in setup() 61 when(mMockContext.checkPermission(BLUETOOTH_ADVERTISE, PID, UID)) in test_checkCallerBroadcastPermission_granted() 71 when(mMockContext.checkPermission(BLUETOOTH_ADVERTISE, PID, UID)) in test_checkCallerBroadcastPermission_deniedPermission() 81 when(mMockContext.checkPermission(BLUETOOTH_ADVERTISE, PID, UID)) in test_getPermissionLevel_none() 84 assertThat(BroadcastPermissions.getPermissionLevel(mMockContext, UID, PID)) in test_getPermissionLevel_none() 90 when(mMockContext.checkPermission(BLUETOOTH_ADVERTISE, PID, UID)) in test_getPermissionLevel_advertising() 93 assertThat(BroadcastPermissions.getPermissionLevel(mMockContext, UID, PID)) in test_getPermissionLevel_advertising()
|
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/applications/ |
D | NotificationsPreferenceControllerTest.java | 50 private static final int UID = 1001010; field in NotificationsPreferenceControllerTest 86 packageInfo.applicationInfo.uid = UID; in setUp() 92 when(mMockManager.areNotificationsEnabledForPackage(PKG_NAME, UID)).thenReturn(true); in onCreate_notificationEnabled_isChecked() 101 when(mMockManager.areNotificationsEnabledForPackage(PKG_NAME, UID)).thenReturn(false); in onCreate_notificationDisabled_isNotChecked() 110 when(mMockManager.onlyHasDefaultChannel(PKG_NAME, UID)).thenReturn(false); in callChangeListener_setEnable_enablingNotification() 114 verify(mMockManager).setNotificationsEnabledForPackage(PKG_NAME, UID, true); in callChangeListener_setEnable_enablingNotification() 119 when(mMockManager.onlyHasDefaultChannel(PKG_NAME, UID)).thenReturn(false); in callChangeListener_setDisable_disablingNotification() 123 verify(mMockManager).setNotificationsEnabledForPackage(PKG_NAME, UID, false); in callChangeListener_setDisable_disablingNotification() 128 when(mMockManager.onlyHasDefaultChannel(PKG_NAME, UID)).thenReturn(true); in callChangeListener_onlyHasDefaultChannel_updateChannel() 131 PKG_NAME, UID, NotificationChannel.DEFAULT_CHANNEL_ID, null, true)) in callChangeListener_onlyHasDefaultChannel_updateChannel() [all …]
|
D | ApplicationsSettingsPreferenceControllerTest.java | 55 private static final int UID = 12; field in ApplicationsSettingsPreferenceControllerTest 96 appInfo.uid = UID; in onDataLoaded_addPreference_hasOnePreference() 118 appInfo.uid = UID; in preferenceClick_launchesDetailFragment()
|
/packages/apps/Car/Notification/tests/unit/src/com/android/car/notification/ |
D | CarNotificationDiffTest.java | 53 private static final int UID = 2; field in CarNotificationDiffTest 99 ID, TAG, UID, INITIAL_PID, mNotificationBuilder1.build(), USER_HANDLE, in setupBaseActivityAndLayout() 102 ID, TAG, UID, INITIAL_PID, mNotificationBuilder1.build(), USER_HANDLE, in setupBaseActivityAndLayout() 105 ID, TAG, UID, INITIAL_PID, mNotificationBuilder2.build(), USER_HANDLE, in setupBaseActivityAndLayout() 202 ID, TAG, UID, INITIAL_PID, mNotificationBuilder1.build(), USER_HANDLE, in sameGroupUniqueIdentifiers_diffNotificationKey_shouldReturnFalse() 219 ID, TAG, UID, INITIAL_PID, mNotificationBuilder1.build(), USER_HANDLE, in sameGroupUniqueIdentifiers_sameChildrenNotification_shouldReturnTrue() 315 ID, TAG, UID, INITIAL_PID, oldNotification.build(), USER_HANDLE, in areBundleEqual_sameSize_shouldReturnTrue() 319 ID, TAG, UID, INITIAL_PID, newNotification.build(), USER_HANDLE, in areBundleEqual_sameSize_shouldReturnTrue() 360 UID, INITIAL_PID, oldNotification.build(), USER_HANDLE, OVERRIDE_GROUP_KEY, in areBundleEqual_diffSize_shouldReturnFalse() 363 UID, INITIAL_PID, newNotification.build(), USER_HANDLE, OVERRIDE_GROUP_KEY, in areBundleEqual_diffSize_shouldReturnFalse() [all …]
|
D | CarHeadsUpNotificationManagerTest.java | 67 private static final int UID = 2; field in CarHeadsUpNotificationManagerTest 185 new StatusBarNotification(PKG_1, OP_PKG, ID, TAG, UID, INITIAL_PID, in setup() 188 new StatusBarNotification(PKG_2, OP_PKG, ID, TAG, UID, INITIAL_PID, in setup() 192 new StatusBarNotification(PKG_1, OP_PKG, ID, TAG, UID, INITIAL_PID, in setup() 195 new StatusBarNotification(PKG_1, OP_PKG, ID, TAG, UID, INITIAL_PID, in setup() 199 new StatusBarNotification(PKG_1, OP_PKG, ID, TAG, UID, INITIAL_PID, in setup() 202 new StatusBarNotification(PKG_1, OP_PKG, ID, TAG, UID, INITIAL_PID, in setup() 206 new StatusBarNotification(PKG_1, OP_PKG, ID, TAG, UID, INITIAL_PID, in setup()
|
D | NotificationGroupTest.java | 50 private static final int UID = 2; field in NotificationGroupTest 75 ID, TAG, UID, INITIAL_PID, mNotificationBuilder.build(), USER_HANDLE, in setup() 78 ID, TAG, UID, INITIAL_PID, mNotificationBuilder.build(), USER_HANDLE, in setup()
|
/packages/apps/Car/SystemUI/tests/src/com/android/systemui/car/toast/ |
D | CarToastUITest.java | 59 private static final int UID = 0; field in CarToastUITest 113 mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION, in showToast_notSystemNotPrivilegedNotPlatformKey_createToastNotCalled() 126 mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION, in showToast_notSystemNotPrivilegedIsPlatformKey_createToastCalled() 138 mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION, in showToast_notSystemIsPrivilegedNotPlatformKey_createToastNotCalled() 151 mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION, in showToast_notSystemIsPrivilegedIsPlatformKey_createToastCalled() 163 mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION, in showToast_isSystemNotPrivilegedNotPlatformKey_createToastNotCalled() 182 carToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION, in showToast_isSystemNotPrivilegedNotPlatformKeyAllowListed_createToastCalled() 194 mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION, in showToast_isSystemNotPrivilegedIsPlatformKey_createToastCalled() 206 mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION, in showToast_isSystemIsPrivilegedNotPlatformKey_createToastCalled() 218 mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION, in showToast_isSystemIsPrivilegedIsPlatformKey_createToastCalled()
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/ |
D | AnomalyDatabaseHelper.java | 67 String UID = "uid"; field 87 AnomalyColumns.UID + 97 " PRIMARY KEY (" + AnomalyColumns.UID + "," + AnomalyColumns.ANOMALY_TYPE + "," 110 String UID = "uid"; field 125 ActionColumns.UID + 133 " PRIMARY KEY (" + ActionColumns.ACTION_TYPE + "," + ActionColumns.UID + ","
|
D | BatteryDatabaseManager.java | 26 import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns.UID; 89 values.put(UID, uid); in insertAnomaly() 104 final String[] projection = {PACKAGE_NAME, ANOMALY_TYPE, UID}; in queryAllAnomalies() 114 final int uid = cursor.getInt(cursor.getColumnIndex(UID)); in queryAllAnomalies() 172 final String[] projection = {ActionColumns.UID, ActionColumns.TIME_STAMP_MS}; in queryActionTime() 178 final int uidIndex = cursor.getColumnIndex(ActionColumns.UID); in queryActionTime() 198 values.put(ActionColumns.UID, uid); in insertAction() 213 ActionColumns.ACTION_TYPE + " = ? AND " + ActionColumns.UID + " = ? AND " in deleteAction()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/specialaccess/turnscreenon/ |
D | TurnScreenOnDetailsTest.java | 40 private static final int UID = 0; field in TurnScreenOnDetailsTest 55 when(mAppOpsManager.checkOpNoThrow(eq(OP_TURN_SCREEN_ON), eq(UID), in isTurnScreenOnAllowed_appOpErrored_shouldReturnFalse() 58 boolean isAllowed = TurnScreenOnDetails.isTurnScreenOnAllowed(mAppOpsManager, UID, in isTurnScreenOnAllowed_appOpErrored_shouldReturnFalse() 66 when(mAppOpsManager.checkOpNoThrow(eq(OP_TURN_SCREEN_ON), eq(UID), in isTurnScreenOnAllowed_appOpAllowed_shouldReturnTrue() 69 boolean isAllowed = TurnScreenOnDetails.isTurnScreenOnAllowed(mAppOpsManager, UID, in isTurnScreenOnAllowed_appOpAllowed_shouldReturnTrue()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/specialaccess/deviceadmin/ |
D | DeviceAdminAddTest.java | 48 private static final int UID = 12345; field in DeviceAdminAddTest 66 doReturn(UID).when(mBatteryUtils).getPackageUid(PACKAGE_NAME); in setUp() 92 doReturn(true).when(mBatteryUtils).isForceAppStandbyEnabled(UID, PACKAGE_NAME); in unrestrictAppIfPossible_appRestricted_unrestrictApp() 96 verify(mBatteryUtils).setForceAppStandby(UID, PACKAGE_NAME, AppOpsManager.MODE_ALLOWED); in unrestrictAppIfPossible_appRestricted_unrestrictApp() 101 doReturn(false).when(mBatteryUtils).isForceAppStandbyEnabled(UID, PACKAGE_NAME); in unrestrictAppIfPossible_appUnrestricted_doNothing() 105 verify(mBatteryUtils, never()).setForceAppStandby(UID, PACKAGE_NAME, in unrestrictAppIfPossible_appUnrestricted_doNothing()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/password/ |
D | PasswordUtilsTest.java | 58 private static final int UID = 1234; field in PasswordUtilsTest 138 when(mActivityService.getLaunchedFromUid(mActivityToken)).thenReturn(UID); in isCallingAppPermitted_permissionGranted_returnsTrue() 139 when(mContext.checkPermission(PERMISSION, -1, UID)).thenReturn(PERMISSION_GRANTED); in isCallingAppPermitted_permissionGranted_returnsTrue() 146 when(mActivityService.getLaunchedFromUid(mActivityToken)).thenReturn(UID); in isCallingAppPermitted_permissionDenied_returnsFalse() 147 when(mContext.checkPermission(PERMISSION, -1, UID)).thenReturn(PERMISSION_DENIED); in isCallingAppPermitted_permissionDenied_returnsFalse()
|
/packages/apps/Settings/tests/unit/src/com/android/settings/fuelgauge/batterytip/ |
D | AppInfoTest.java | 43 private static final int UID = 3452; field in AppInfoTest 54 .setUid(UID) in setUp() 69 assertThat(appInfo.uid).isEqualTo(UID); in testParcel() 93 assertThat(mAppInfo.uid).isEqualTo(UID); in testBuilder()
|
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/applications/ |
D | ApplicationListItemManagerTest.java | 50 private static final int UID = 12; field in ApplicationListItemManagerTest 89 appInfo.uid = UID; in onRebuildComplete_shouldNotifyRegisteredListener() 111 appInfo.uid = UID; in onRebuildComplete_unRegisterOneListener_shouldNotifyRegisteredListener() 134 appInfo.uid = UID; in onRebuildComplete_calledAgainImmediately_shouldNotRunSecondCallImmediately() 156 appInfo.uid = UID; in onRebuildComplete_calledAgainImmediately_shouldRunSecondCallAfterUpdateInterval()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batterytip/ |
D | AnomalyCleanupJobServiceTest.java | 57 private static final int UID = 1234; field in AnomalyCleanupJobServiceTest 115 databaseManager.insertAnomaly(UID, PACKAGE_NAME, ANOMALY_TYPE, in onStartJob_cleanUpDataBefore30days() 117 databaseManager.insertAnomaly(UID, PACKAGE_NAME_OLD, ANOMALY_TYPE, in onStartJob_cleanUpDataBefore30days() 126 .setUid(UID) in onStartJob_cleanUpDataBefore30days()
|
/packages/services/Car/tests/CarSecurityPermissionTest/src/com/android/car/media/ |
D | CarAudioManagerPermissionTest.java | 50 private static final int UID = 10; field in CarAudioManagerPermissionTest 205 () -> mCarAudioManager.getZoneIdForUid(UID)); in getZoneIdForUidPermission() 212 () -> mCarAudioManager.setZoneIdForUid(PRIMARY_AUDIO_ZONE, UID)); in setZoneIdForUidPermission() 219 () -> mCarAudioManager.clearZoneIdForUid(UID)); in clearZoneIdForUidPermission()
|
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/system/ |
D | ResetAppPrefFragmentTest.java | 70 private static final int UID = 1001010; field in ResetAppPrefFragmentTest 141 .setNotificationsEnabledForPackage(ENABLED_PKG_NAME, UID, true); in resetClicked_resetsNotificationsForApps() 143 .setNotificationsEnabledForPackage(DISABLED_PKG_NAME, UID, true); in resetClicked_resetsNotificationsForApps() 223 applicationInfo.uid = UID; in createApplicationInfo()
|
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/storage/ |
D | StorageApplicationListPreferenceControllerTest.java | 51 private static final int UID = 12; field in StorageApplicationListPreferenceControllerTest 95 appInfo.uid = UID; in onDataLoaded_addPreference_hasOnePreference() 117 appInfo.uid = UID; in onDataLoaded_updatePreference_hasOnePreferenceWithUpdatedValues()
|
/packages/modules/Connectivity/nearby/tests/cts/fastpair/src/android/nearby/cts/ |
D | ScanRequestTest.java | 46 private static final int UID = 1001; field in ScanRequestTest 104 + "enableBle=true, workSource=WorkSource{" + UID + " " + APP_NAME in testToString() 195 return new WorkSource(UID, APP_NAME); in getWorkSource()
|
/packages/apps/Car/Notification/tests/unit/src/com/android/car/notification/template/ |
D | GroupNotificationViewHolderTest.java | 59 private static final int UID = 2; field in GroupNotificationViewHolderTest 194 new StatusBarNotification(PKG, OP_PKG, ID, TAG, UID, INITIAL_PID, in getNotificationGroup() 205 new StatusBarNotification(PKG, OP_PKG, ID, TAG, UID, INITIAL_PID, in getNotificationGroup()
|