Home
last modified time | relevance | path

Searched refs:sDeviceState (Results 1 – 25 of 53) sorted by relevance

123

/cts/tests/devicepolicy/src/android/devicepolicy/cts/
DPermissionGrantTest.java70 public static final DeviceState sDeviceState = new DeviceState(); field in PermissionGrantTest
134 int existingGrantState = sDeviceState.dpc().devicePolicyManager() in getPermissionGrantState_smsPermission_notAbleToSetState_alsoCantReadState()
135 .getPermissionGrantState(sDeviceState.dpc().componentName(), in getPermissionGrantState_smsPermission_notAbleToSetState_alsoCantReadState()
138 sDeviceState.dpc().devicePolicyManager().setPermissionGrantState( in getPermissionGrantState_smsPermission_notAbleToSetState_alsoCantReadState()
139 sDeviceState.dpc().componentName(), sTestApp.packageName(), in getPermissionGrantState_smsPermission_notAbleToSetState_alsoCantReadState()
147 .that(sDeviceState.dpc().devicePolicyManager().getPermissionGrantState( in getPermissionGrantState_smsPermission_notAbleToSetState_alsoCantReadState()
148 sDeviceState.dpc().componentName(), sTestApp.packageName(), in getPermissionGrantState_smsPermission_notAbleToSetState_alsoCantReadState()
152 sDeviceState.dpc().devicePolicyManager().setPermissionGrantState( in getPermissionGrantState_smsPermission_notAbleToSetState_alsoCantReadState()
153 sDeviceState.dpc().componentName(), sTestApp.packageName(), in getPermissionGrantState_smsPermission_notAbleToSetState_alsoCantReadState()
164 int existingGrantState = sDeviceState.dpc().devicePolicyManager() in getPermissionGrantState_sensorPermission_notAbleToSetState_alsoCantReadState()
[all …]
DDelegationScopesTest.java77 public static final DeviceState sDeviceState = new DeviceState(); field in DelegationScopesTest
92 sDeviceState.dpc().devicePolicyManager().setDelegatedScopes( in getDelegatedScopes_returnsFromSetDelegatedScopes()
93 sDeviceState.dpc().componentName(), in getDelegatedScopes_returnsFromSetDelegatedScopes()
96 assertThat(sDeviceState.dpc().devicePolicyManager() in getDelegatedScopes_returnsFromSetDelegatedScopes()
98 sDeviceState.dpc().componentName(), in getDelegatedScopes_returnsFromSetDelegatedScopes()
112 sDeviceState.dpc().devicePolicyManager().setDelegatedScopes( in setDelegatedScopes_invalidAdmin_throwsSecurityException()
113 sDeviceState.dpc().componentName(), in setDelegatedScopes_invalidAdmin_throwsSecurityException()
124 sDeviceState.dpc().devicePolicyManager().getDelegatedScopes( in getDelegatedScopes_invalidAdmin_throwsSecurityException()
125 sDeviceState.dpc().componentName(), testApp.testApp().packageName())); in getDelegatedScopes_invalidAdmin_throwsSecurityException()
135 sDeviceState.dpc().devicePolicyManager().setDelegatedScopes( in getDelegatedScopes_returnsLatestFromSetDelegatedScopes()
[all …]
DApplicationRestrictionsTest.java61 public static final DeviceState sDeviceState = new DeviceState(); field in ApplicationRestrictionsTest
110 sDeviceState.dpc().devicePolicyManager() in setApplicationRestrictions_applicationRestrictionsAreSet()
112 sDeviceState.dpc().componentName(), sTestApp.packageName()); in setApplicationRestrictions_applicationRestrictionsAreSet()
116 sDeviceState.dpc().devicePolicyManager() in setApplicationRestrictions_applicationRestrictionsAreSet()
118 sDeviceState.dpc().componentName(), sTestApp.packageName(), in setApplicationRestrictions_applicationRestrictionsAreSet()
124 sDeviceState.dpc().devicePolicyManager().setApplicationRestrictions( in setApplicationRestrictions_applicationRestrictionsAreSet()
125 sDeviceState.dpc().componentName(), in setApplicationRestrictions_applicationRestrictionsAreSet()
135 sDeviceState.dpc().devicePolicyManager() in setApplicationRestrictions_applicationRestrictionsAlreadySet_setsNewRestrictions()
137 sDeviceState.dpc().componentName(), sTestApp.packageName()); in setApplicationRestrictions_applicationRestrictionsAlreadySet_setsNewRestrictions()
141 sDeviceState.dpc().devicePolicyManager() in setApplicationRestrictions_applicationRestrictionsAlreadySet_setsNewRestrictions()
[all …]
DStartProfilesTest.java67 public static final DeviceState sDeviceState = new DeviceState(); field in StartProfilesTest
79 sDeviceState.workProfile().stop(); in startProfile_returnsTrue()
81 assertThat(sActivityManager.startProfile(sDeviceState.workProfile().userHandle())).isTrue(); in startProfile_returnsTrue()
91 sDeviceState.workProfile().stop(); in startProfile_broadcastIsReceived_profileIsStarted()
92 BlockingBroadcastReceiver broadcastReceiver = sDeviceState.registerBroadcastReceiver( in startProfile_broadcastIsReceived_profileIsStarted()
94 userIsEqual(sDeviceState.workProfile())); in startProfile_broadcastIsReceived_profileIsStarted()
95 sActivityManager.startProfile(sDeviceState.workProfile().userHandle()); in startProfile_broadcastIsReceived_profileIsStarted()
99 assertThat(sUserManager.isUserRunning(sDeviceState.workProfile().userHandle())).isTrue(); in startProfile_broadcastIsReceived_profileIsStarted()
109 assertThat(sActivityManager.stopProfile(sDeviceState.workProfile().userHandle())).isTrue(); in stopProfile_returnsTrue()
119 BlockingBroadcastReceiver broadcastReceiver = sDeviceState.registerBroadcastReceiver( in stopProfile_profileIsStopped()
[all …]
DKeyManagementTest.java77 public static final DeviceState sDeviceState = new DeviceState(); field in KeyManagementTest
143 assertThat(sDeviceState.dpc().devicePolicyManager() in installKeyPair_validRsaKeyPair_success()
148 sDeviceState.dpc().devicePolicyManager().removeKeyPair(DPC_COMPONENT_NAME, RSA_ALIAS); in installKeyPair_validRsaKeyPair_success()
157 () -> sDeviceState.dpc().devicePolicyManager().installKeyPair( in installKeyPair_nullPrivateKey_throwException()
166 () -> sDeviceState.dpc().devicePolicyManager().installKeyPair( in installKeyPair_nullCertificate_throwException()
175 () -> sDeviceState.dpc().devicePolicyManager().installKeyPair( in installKeyPair_nullAdminComponent_throwException()
186 sDeviceState.dpc().devicePolicyManager().installKeyPair(DPC_COMPONENT_NAME, PRIVATE_KEY, in installKeyPair_withAutomatedAccess_aliasIsGranted()
190 assertThat(sDeviceState.dpc().keyChain().getPrivateKey(/* context= */ null, RSA_ALIAS)) in installKeyPair_withAutomatedAccess_aliasIsGranted()
194 sDeviceState.dpc().devicePolicyManager().removeKeyPair(DPC_COMPONENT_NAME, RSA_ALIAS); in installKeyPair_withAutomatedAccess_aliasIsGranted()
204 sDeviceState.dpc().devicePolicyManager().installKeyPair(DPC_COMPONENT_NAME, PRIVATE_KEY, in installKeyPair_withoutAutomatedAccess_aliasIsNotGranted()
[all …]
DCrossProfileAppsTest.java78 public static final DeviceState sDeviceState = new DeviceState(); field in CrossProfileAppsTest
91 assertThat(targetProfiles).doesNotContain(sDeviceState.primaryUser().userHandle()); in getTargetUserProfiles_callingFromPrimaryUser_doesNotContainPrimaryUser()
99 assertThat(targetProfiles).doesNotContain(sDeviceState.secondaryUser().userHandle()); in getTargetUserProfiles_callingFromPrimaryUser_doesNotContainSecondaryUser()
107 assertThat(targetProfiles).contains(sDeviceState.primaryUser().userHandle()); in getTargetUserProfiles_callingFromWorkProfile_containsPrimaryUser()
116 assertThat(targetProfiles).contains(sDeviceState.workProfile().userHandle()); in getTargetUserProfiles_callingFromPrimaryUser_containsWorkProfile()
125 assertThat(targetProfiles).doesNotContain(sDeviceState.workProfile().userHandle()); in getTargetUserProfiles_callingFromPrimaryUser_appNotInstalledInWorkProfile_doesNotContainWorkProfile()
135 sDeviceState.workProfile(/* forUser= */ PRIMARY_USER).userHandle()); in getTargetUserProfiles_callingFromSecondaryUser_doesNotContainWorkProfile()
144 sDeviceState.workProfile().userHandle()); in startMainActivity_callingFromWorkProfile_targetIsPrimaryUser_launches()
146 assertMainActivityLaunchedForUser(sDeviceState.primaryUser().userHandle()); in startMainActivity_callingFromWorkProfile_targetIsPrimaryUser_launches()
156 sDeviceState.workProfile().userHandle()); in startMainActivity_callingFromPrimaryUser_targetIsWorkProfile_launches()
[all …]
DLockTaskTest.java86 public static final DeviceState sDeviceState = new DeviceState(); field in LockTaskTest
127 sDeviceState.dpc().devicePolicyManager() in setLockTaskPackages_lockTaskPackagesIsSet()
130 sDeviceState.dpc().devicePolicyManager() in setLockTaskPackages_lockTaskPackagesIsSet()
134 assertThat(sDeviceState.dpc().devicePolicyManager() in setLockTaskPackages_lockTaskPackagesIsSet()
138 sDeviceState.dpc().devicePolicyManager() in setLockTaskPackages_lockTaskPackagesIsSet()
148 sDeviceState.dpc().devicePolicyManager() in startLockTask_recordsMetric()
153 sDeviceState.dpc().devicePolicyManager() in startLockTask_recordsMetric()
171 sDeviceState.dpc().devicePolicyManager() in startLockTask_recordsMetric()
180 () -> sDeviceState.dpc().devicePolicyManager() in getLockTaskPackages_policyIsNotAllowedToBeFetched_throwsException()
189 sDeviceState.dpc().devicePolicyManager() in setLockTaskPackages_empty_lockTaskPackagesIsSet()
[all …]
DResetPasswordWithTokenTest.java91 public static final DeviceState sDeviceState = new DeviceState(); field in ResetPasswordWithTokenTest
100 assertThat(sDeviceState.dpc().devicePolicyManager().isResetPasswordTokenActive( in setResetPasswordToken_validToken_passwordTokenSet()
104 sDeviceState.dpc().devicePolicyManager().clearResetPasswordToken(DPC_COMPONENT_NAME); in setResetPasswordToken_validToken_passwordTokenSet()
114 assertThat(sDeviceState.dpc().devicePolicyManager().resetPasswordWithToken( in resetPasswordWithToken_validPasswordAndToken_success()
126 assertThat(sDeviceState.dpc().devicePolicyManager().resetPasswordWithToken( in resetPasswordWithToken_badToken_failure()
135 sDeviceState.dpc().devicePolicyManager().resetPasswordWithToken( in resetPasswordWithToken_noPassword_deviceIsNotSecure()
148 sDeviceState.dpc().devicePolicyManager().resetPasswordWithToken( in resetPasswordWithToken_password_deviceIsSecure()
167 sDeviceState.dpc().devicePolicyManager().setPasswordQuality( in resetPasswordWithToken_passwordDoesNotSatisfyRestriction_failure()
178 assertThat(sDeviceState.dpc().devicePolicyManager().resetPasswordWithToken( in resetPasswordWithToken_passwordDoesNotSatisfyRestriction_failure()
195 sDeviceState.dpc().devicePolicyManager().setPasswordQuality( in resetPasswordWithToken_passwordSatisfiesRestriction_success()
[all …]
DUserControlDisabledPackagesTest.java78 public static final DeviceState sDeviceState = new DeviceState(); field in UserControlDisabledPackagesTest
85 sDeviceState.dpc().devicePolicyManager().getUserControlDisabledPackages( in setUserControlDisabledPackages_verifyMetricIsLogged()
89 sDeviceState.dpc().devicePolicyManager().setUserControlDisabledPackages( in setUserControlDisabledPackages_verifyMetricIsLogged()
96 sDeviceState.dpc().componentName().getPackageName()) in setUserControlDisabledPackages_verifyMetricIsLogged()
100 sDeviceState.dpc().devicePolicyManager().setUserControlDisabledPackages( in setUserControlDisabledPackages_verifyMetricIsLogged()
111 sDeviceState.dpc().devicePolicyManager().getUserControlDisabledPackages( in setUserControlDisabledPackages_toOneProtectedPackage()
114 sDeviceState.dpc().devicePolicyManager().setUserControlDisabledPackages(DPC_COMPONENT_NAME, in setUserControlDisabledPackages_toOneProtectedPackage()
117 assertThat(sDeviceState.dpc().devicePolicyManager().getUserControlDisabledPackages( in setUserControlDisabledPackages_toOneProtectedPackage()
121 sDeviceState.dpc().devicePolicyManager().setUserControlDisabledPackages( in setUserControlDisabledPackages_toOneProtectedPackage()
132 sDeviceState.dpc().devicePolicyManager().getUserControlDisabledPackages( in setUserControlDisabledPackages_toEmptyProtectedPackages()
[all …]
DCameraPolicyTest.java61 public static final DeviceState sDeviceState = new DeviceState(); field in CameraPolicyTest
77 sDeviceState.dpc().devicePolicyManager() in setCameraDisabledTrue_policyDoesNotApply_cameraNotDisabled()
78 .setCameraDisabled(sDeviceState.dpc().componentName(), true); in setCameraDisabledTrue_policyDoesNotApply_cameraNotDisabled()
88 sDeviceState.dpc().devicePolicyManager() in setCameraDisabledTrue_cameraDisabledLocally()
89 .setCameraDisabled(sDeviceState.dpc().componentName(), true); in setCameraDisabledTrue_cameraDisabledLocally()
99 sDeviceState.dpc().devicePolicyManager() in setCameraDisabledFalse_cameraEnabledLocally()
100 .setCameraDisabled(sDeviceState.dpc().componentName(), false); in setCameraDisabledFalse_cameraEnabledLocally()
110 sDeviceState.dpc().devicePolicyManager() in setCameraDisabledTrue_cameraDisabledAtDPC()
111 .setCameraDisabled(sDeviceState.dpc().componentName(), true); in setCameraDisabledTrue_cameraDisabledAtDPC()
113 assertThat(sDeviceState.dpc().devicePolicyManager() in setCameraDisabledTrue_cameraDisabledAtDPC()
[all …]
DCaCertManagementTest.java63 public static final DeviceState sDeviceState = new DeviceState(); field in CaCertManagementTest
71 assertThat(sDeviceState.dpc().devicePolicyManager().getInstalledCaCerts( in getInstalledCaCerts_doesNotReturnNull()
78 RemoteDevicePolicyManager remoteDpm = sDeviceState.dpc().devicePolicyManager(); in installCaCert_caCertIsInstalled()
95 RemoteDevicePolicyManager remoteDpm = sDeviceState.dpc().devicePolicyManager(); in installCaCert_logsEvent()
116 RemoteDevicePolicyManager remoteDpm = sDeviceState.dpc().devicePolicyManager(); in uninstallCaCert_caCertIsNotInstalled()
132 RemoteDevicePolicyManager remoteDpm = sDeviceState.dpc().devicePolicyManager(); in uninstallCaCert_otherCaCertsAreNotUninstalled()
149 RemoteDevicePolicyManager remoteDpm = sDeviceState.dpc().devicePolicyManager(); in uninstallCaCert_logsEvent()
174 RemoteDevicePolicyManager remoteDpm = sDeviceState.dpc().devicePolicyManager(); in uninstallAllUserCaCerts_uninstallsAllCaCerts()
215 RemoteDevicePolicyManager remoteDpm = sDeviceState.dpc().devicePolicyManager(); in assertCaCertInstalledAndTrusted()
243 RemoteDevicePolicyManager remoteDpm = sDeviceState.dpc().devicePolicyManager(); in isCaCertListed()
DNetworkResetTest.java54 public static final DeviceState sDeviceState = new DeviceState(); field in NetworkResetTest
87sDeviceState.dpc().devicePolicyManager().addUserRestriction(DPC_COMPONENT_NAME, DISALLOW_NETWORK_R… in factoryReset_disallowedByNetworkResetPolicy_doesNotFactoryReset()
109 sDeviceState.dpc().devicePolicyManager() in factoryReset_disallowedByConfigPrivateDnsPolicy_doesPartialFactoryReset()
137 sDeviceState.dpc().devicePolicyManager() in factoryReset_noPolicyRestrictions_resetsToDefault()
139 sDeviceState.dpc().devicePolicyManager() in factoryReset_noPolicyRestrictions_resetsToDefault()
175 sDeviceState.dpc().devicePolicyManager().addUserRestriction(DPC_COMPONENT_NAME, policy); in restoreUserRestriction()
177sDeviceState.dpc().devicePolicyManager().clearUserRestriction(DPC_COMPONENT_NAME, policy); in restoreUserRestriction()
DEnrollmentSpecificIdTest.java60 public static final DeviceState sDeviceState = new DeviceState(); field in EnrollmentSpecificIdTest
69 () -> sDeviceState.dpc().devicePolicyManager().setOrganizationId("")); in emptyOrganizationId_throws()
77 sDeviceState.dpc().devicePolicyManager().setOrganizationId(ORGANIZATION_ID); in reSetOrganizationId_throws()
80 () -> sDeviceState.dpc().devicePolicyManager() in reSetOrganizationId_throws()
83 TestApis.devicePolicy().clearOrganizationId(sDeviceState.dpc().user()); in reSetOrganizationId_throws()
97 sDeviceState.dpc().devicePolicyManager().setOrganizationId(ORGANIZATION_ID); in enrollmentSpecificId_CorrectlyCalculated()
98 final String esidFromDpm = sDeviceState.dpc().devicePolicyManager() in enrollmentSpecificId_CorrectlyCalculated()
101 sDeviceState.dpc().componentName().getPackageName(), in enrollmentSpecificId_CorrectlyCalculated()
106 TestApis.devicePolicy().clearOrganizationId(sDeviceState.dpc().user()); in enrollmentSpecificId_CorrectlyCalculated()
DCrossProfileSharingTest.java64 public static final DeviceState sDeviceState = new DeviceState(); field in CrossProfileSharingTest
111 sTestApp.install(sDeviceState.primaryUser())) { in openingPersonalFromProfile_disallowShareIntoProfile_restrictionApplied()
137 sTestApp.install(sDeviceState.primaryUser())) { in openingPersonalFromProfile_disallowShareIntoProfile_restrictionRemoved()
179 return getResolveInfo(sDeviceState.workProfile(), FLAG_MANAGED_CAN_ACCESS_PARENT); in getPersonalToWorkForwarder()
183 return getResolveInfo(sDeviceState.primaryUser(), FLAG_PARENT_CAN_ACCESS_MANAGED); in getWorkToPersonalForwarder()
196 sDeviceState.profileOwner(WORK_PROFILE).devicePolicyManager() in getResolveInfo()
202 sDeviceState.profileOwner(WORK_PROFILE).devicePolicyManager() in getResolveInfo()
221 RemoteDpc remoteDpc = sDeviceState.profileOwner(WORK_PROFILE); in setSharingIntoProfileEnabled()
DPreferentialNetworkServiceTest.java60 public static final DeviceState sDeviceState = new DeviceState(); field in PreferentialNetworkServiceTest
118 sDeviceState.dpc().devicePolicyManager().setPreferentialNetworkServiceEnabled(true); in setPreferentialNetworkServiceEnabled_enableService_issueRequest()
123 sDeviceState.dpc().devicePolicyManager().setPreferentialNetworkServiceEnabled(false); in setPreferentialNetworkServiceEnabled_enableService_issueRequest()
155 sDeviceState.dpc().devicePolicyManager().setPreferentialNetworkServiceEnabled(false); in setPreferentialNetworkServiceEnabled_disableService_noIssueRequest()
160 sDeviceState.dpc().devicePolicyManager().setPreferentialNetworkServiceEnabled(false); in setPreferentialNetworkServiceEnabled_disableService_noIssueRequest()
DCreateAndManageUserTest.java52 public static final DeviceState sDeviceState = new DeviceState(); field in CreateAndManageUserTest
92 final UserHandle userHandle = sDeviceState.dpc().devicePolicyManager().createAndManageUser( in createAndManageUser()
DScreenCaptureDisabledTest.java63 public static final DeviceState sDeviceState = new DeviceState(); field in ScreenCaptureDisabledTest
75 mAdmin = sDeviceState.dpc().componentName(); in setUp()
76 mDevicePolicyManager = sDeviceState.dpc().devicePolicyManager(); in setUp()
/cts/common/device-side/bedstead/nene/src/test/java/com/android/bedstead/nene/users/
DUserReferenceTest.java62 public static final DeviceState sDeviceState = new DeviceState(); field in UserReferenceTest
82 assertThat(sDeviceState.secondaryUser().exists()).isTrue(); in exists_doesExist_returnsTrue()
121 sDeviceState.secondaryUser().start(); in start_userAlreadyStarted_doesNothing()
123 sDeviceState.secondaryUser().start(); in start_userAlreadyStarted_doesNothing()
125 assertThat(sDeviceState.secondaryUser().isUnlocked()).isTrue(); in start_userAlreadyStarted_doesNothing()
137 sDeviceState.secondaryUser().stop(); in stop_userStarted_userIsStopped()
139 assertThat(sDeviceState.secondaryUser().isRunning()).isFalse(); in stop_userStarted_userIsStopped()
146 sDeviceState.secondaryUser().stop(); in stop_userNotStarted_doesNothing()
148 sDeviceState.secondaryUser().stop(); in stop_userNotStarted_doesNothing()
150 assertThat(sDeviceState.secondaryUser().isRunning()).isFalse(); in stop_userNotStarted_doesNothing()
[all …]
DUsersTest.java79 public static final DeviceState sDeviceState = new DeviceState(); field in UsersTest
366 .containsExactly(sDeviceState.secondaryUser(), additionalUser); in findUsersOfType_returnsUsers()
480 assertThat(TestApis.users().current()).isEqualTo(sDeviceState.secondaryUser()); in currentUser_secondaryUser_returnsCurrentUser()
486 assertThat(TestApis.users().current()).isEqualTo(sDeviceState.primaryUser()); in currentUser_primaryUser_returnsCurrentUser()
499 () -> sDeviceState.secondaryUser().isRunning()) in switch_hasSetStopBgUsersOnSwitch_stopsUser()
504 assertThat(sDeviceState.secondaryUser().isRunning()).isFalse(); in switch_hasSetStopBgUsersOnSwitch_stopsUser()
506 sDeviceState.secondaryUser().start(); in switch_hasSetStopBgUsersOnSwitch_stopsUser()
518 assertThat(sDeviceState.secondaryUser().isRunning()).isTrue(); in switch_hasSetStopBgUsersOnSwitchFalse_doesNotStopUser()
521 sDeviceState.secondaryUser().start(); in switch_hasSetStopBgUsersOnSwitchFalse_doesNotStopUser()
522 sDeviceState.secondaryUser().switchTo(); in switch_hasSetStopBgUsersOnSwitchFalse_doesNotStopUser()
/cts/common/device-side/bedstead/nene/src/test/java/com/android/bedstead/nene/packages/
DPackageTest.java58 public static final DeviceState sDeviceState = new DeviceState(); field in PackageTest
124 sInstrumentedPackage.installExisting(sDeviceState.secondaryUser()); in installExisting_alreadyInstalled_installsInUser()
127 assertThat(sInstrumentedPackage.installedOnUser(sDeviceState.secondaryUser())).isTrue(); in installExisting_alreadyInstalled_installsInUser()
129 sInstrumentedPackage.uninstall(sDeviceState.secondaryUser()); in installExisting_alreadyInstalled_installsInUser()
138 pkg.installExisting(sDeviceState.secondaryUser()); in uninstallForAllUsers_isUninstalledForAllUsers()
153 pkg.installExisting(sDeviceState.secondaryUser()); in uninstall_packageIsInstalledForDifferentUser_isUninstalledForUser()
158 sDeviceState.secondaryUser()); in uninstall_packageIsInstalledForDifferentUser_isUninstalledForUser()
161 pkg.uninstall(sDeviceState.secondaryUser()); in uninstall_packageIsInstalledForDifferentUser_isUninstalledForUser()
181 sTestApp.pkg().uninstall(sDeviceState.secondaryUser()); in uninstall_packageNotInstalledForUser_doesNotThrowException()
223 TestAppInstance instance2 = sTestApp.install(sDeviceState.secondaryUser())) { in grantPermission_permissionIsUserSpecific_permissionIsGrantedOnlyForThatUser()
[all …]
DPackagesTest.java55 public static final DeviceState sDeviceState = new DeviceState(); field in PackagesTest
197 TestApis.packages().install(sDeviceState.workProfile(), TEST_APP_APK_FILE); in install_inWorkProfile_isInstalled()
201 assertThat(pkg.installedOnUser(sDeviceState.workProfile())).isTrue(); in install_inWorkProfile_isInstalled()
203 pkg.uninstall(sDeviceState.workProfile()); in install_inWorkProfile_isInstalled()
211 TestApis.packages().install(sDeviceState.secondaryUser(), TEST_APP_APK_FILE); in install_differentUser_isInstalled()
215 assertThat(pkg.installedOnUser(sDeviceState.secondaryUser())).isTrue(); in install_differentUser_isInstalled()
217 pkg.uninstall(sDeviceState.secondaryUser()); in install_differentUser_isInstalled()
/cts/common/device-side/bedstead/nene/src/test/java/com/android/bedstead/nene/settings/
DGlobalSettingsTest.java49 public static final DeviceState sDeviceState = new DeviceState(); field in GlobalSettingsTest
99 TestApis.settings().global().putInt(sDeviceState.secondaryUser(), KEY, INT_VALUE); in putIntWithUser_differentUser_putsIntIntoGlobalSettings()
104 TestApis.context().androidContextAsUser(sDeviceState.secondaryUser()) in putIntWithUser_differentUser_putsIntIntoGlobalSettings()
114 TestApis.settings().global().putInt(sDeviceState.secondaryUser(), KEY, INT_VALUE)); in putIntWithUser_differentUser_preS_throwsException()
189 TestApis.settings().global().putInt(sDeviceState.secondaryUser(), KEY, INT_VALUE); in getIntWithUser_differentUser_getsIntFromGlobalSettings()
192 sDeviceState.secondaryUser(), KEY)).isEqualTo(INT_VALUE); in getIntWithUser_differentUser_getsIntFromGlobalSettings()
200 TestApis.settings().global().putInt(sDeviceState.secondaryUser(), KEY, INT_VALUE); in getIntWithUser_differentUser_preS_throwsException()
243 TestApis.settings().global().putString(sDeviceState.secondaryUser(), KEY, STRING_VALUE); in putStringWithUser_differentUser_putsStringIntoGlobalSettings()
248 TestApis.context().androidContextAsUser(sDeviceState.secondaryUser()) in putStringWithUser_differentUser_putsStringIntoGlobalSettings()
258 () -> TestApis.settings().global().putString(sDeviceState.secondaryUser(), KEY, in putStringWithUser_differentUser_preS_throwsException()
[all …]
DSecureSettingsTest.java49 public static final DeviceState sDeviceState = new DeviceState(); field in SecureSettingsTest
97 TestApis.settings().secure().putInt(sDeviceState.secondaryUser(), KEY, INT_VALUE); in putIntWithUser_differentUser_putsIntIntoSecureSettings()
102 TestApis.context().androidContextAsUser(sDeviceState.secondaryUser()) in putIntWithUser_differentUser_putsIntIntoSecureSettings()
112 TestApis.settings().secure().putInt(sDeviceState.secondaryUser(), KEY, INT_VALUE)); in putIntWithUser_differentUser_preS_throwsException()
194 TestApis.settings().secure().putInt(sDeviceState.secondaryUser(), KEY, INT_VALUE); in getIntWithUser_differentUser_getsIntFromSecureSettings()
197 sDeviceState.secondaryUser(), KEY)).isEqualTo(INT_VALUE); in getIntWithUser_differentUser_getsIntFromSecureSettings()
205 TestApis.settings().secure().putInt(sDeviceState.secondaryUser(), KEY, INT_VALUE); in getIntWithUser_differentUser_preS_throwsException()
268 TestApis.settings().secure().putInt(sDeviceState.secondaryUser(), KEY, INT_VALUE); in resetWithUser_differentUser_resetsSecureSettings()
270 TestApis.settings().secure().reset(sDeviceState.secondaryUser()); in resetWithUser_differentUser_resetsSecureSettings()
274 sDeviceState.secondaryUser(), in resetWithUser_differentUser_resetsSecureSettings()
[all …]
/cts/common/device-side/bedstead/nene/src/test/java/com/android/bedstead/nene/devicepolicy/
DProfileOwnerTest.java46 public static final DeviceState sDeviceState = new DeviceState(); field in ProfileOwnerTest
51 sTestApp = sDeviceState.dpc().testApp(); in setUp()
52 sProfileOwner = sDeviceState.profileOwner().devicePolicyController(); in setUp()
/cts/common/device-side/bedstead/eventlib/src/test/java/com/android/eventlib/
DEventLogsTest.java55 public static final DeviceState sDeviceState = new DeviceState(); field in EventLogsTest
536 TestApis.packages().find(TEST_APP_PACKAGE_NAME).installExisting(sDeviceState.workProfile()); in differentUser_queryWorks()
538 sDeviceState.workProfile(), /* tag= */ TEST_TAG1, /* data= */ null); in differentUser_queryWorks()
541 .onUser(sDeviceState.workProfile()); in differentUser_queryWorks()
549 TestApis.packages().find(TEST_APP_PACKAGE_NAME).installExisting(sDeviceState.workProfile()); in differentUserSpecifiedByUserHandle_queryWorks()
551 sDeviceState.workProfile(), /* tag= */ TEST_TAG1, /* data= */ null); in differentUserSpecifiedByUserHandle_queryWorks()
554 .onUser(sDeviceState.workProfile().userHandle()); in differentUserSpecifiedByUserHandle_queryWorks()
562 TestApis.packages().find(TEST_APP_PACKAGE_NAME).installExisting(sDeviceState.workProfile()); in differentUser_doesntGetEventsFromWrongUser()
565 sDeviceState.workProfile(), /* tag= */ TEST_TAG2, /* data= */ null); in differentUser_doesntGetEventsFromWrongUser()
568 .onUser(sDeviceState.workProfile()); in differentUser_doesntGetEventsFromWrongUser()

123