/packages/modules/AdServices/adservices/tests/unittest/ui/src/com/android/adservices/service/ui/ |
D | UxEngineTest.java | 72 private UxStatesManager mUxStatesManager; field in UxEngineTest 123 doReturn(true).when(mUxStatesManager).getFlag(KEY_ADSERVICES_ENABLED); in setup() 124 doReturn(true).when(mUxStatesManager).getFlag(KEY_IS_U18_UX_DETENTION_CHANNEL_ENABLED); in setup() 132 mContext, mConsentManager, mUxStatesManager, UxEngineUtil.getInstance()); in setup() 146 doReturn(false).when(mUxStatesManager).getFlag(KEY_ADSERVICES_ENABLED); in startTest_uxDisabled() 158 verify(mUxStatesManager).persistAdServicesStates(adServicesStates); in startTest_uxDisabled() 161 verify(mUxStatesManager).getFlag(KEY_ADSERVICES_ENABLED); in startTest_uxDisabled() 194 verify(mUxStatesManager).persistAdServicesStates(adServicesStates); in startTest_entryPointDisabled() 197 verify(mUxStatesManager).getFlag(KEY_ADSERVICES_ENABLED); in startTest_entryPointDisabled() 201 verify(mUxStatesManager, never()).getFlag(KEY_U18_UX_ENABLED); in startTest_entryPointDisabled() [all …]
|
/packages/modules/AdServices/adservices/tests/unittest/ui/src/com/android/adservices/service/ui/util/ |
D | UxEngineUtilTest.java | 69 private UxStatesManager mUxStatesManager; field in UxEngineUtilTest 104 doReturn(true).when(mUxStatesManager).getFlag(KEY_ADSERVICES_ENABLED); in setup() 105 doReturn(true).when(mUxStatesManager).getFlag(KEY_IS_U18_UX_DETENTION_CHANNEL_ENABLED); in setup() 134 doReturn(false).when(mUxStatesManager).getFlag(KEY_ADSERVICES_ENABLED); in getEligibleUxCollectionTest_adServicesDisabled() 136 assertThat(mUxEngineUtil.getEligibleUxCollection(mConsentManager, mUxStatesManager)) in getEligibleUxCollectionTest_adServicesDisabled() 144 assertThat(mUxEngineUtil.getEligibleUxCollection(mConsentManager, mUxStatesManager)) in getEligibleUxCollectionTest_entryPointDisabled() 150 doReturn(true).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in getEligibleUxCollectionTest_adultUserGaFlagOn() 153 assertThat(mUxEngineUtil.getEligibleUxCollection(mConsentManager, mUxStatesManager)) in getEligibleUxCollectionTest_adultUserGaFlagOn() 159 doReturn(false).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in getEligibleUxCollectionTest_adultUserGaFlagOff() 162 assertThat(mUxEngineUtil.getEligibleUxCollection(mConsentManager, mUxStatesManager)) in getEligibleUxCollectionTest_adultUserGaFlagOff() [all …]
|
/packages/modules/AdServices/adservices/tests/unittest/ui/src/com/android/adservices/service/ui/data/ |
D | UxStatesManagerTest.java | 60 private UxStatesManager mUxStatesManager; field in UxStatesManagerTest 88 mUxStatesManager = new UxStatesManager(mContext, mMockFlags, mMockConsentManager); in setup() 107 mUxStatesManager.persistAdServicesStates(new AdServicesStates.Builder().build()); in persistAdServicesStatesTest() 117 assertThat(mUxStatesManager.getFlag("")).isFalse(); in getFlagTest_emptyFlagKey() 124 mUxStatesManager.persistAdServicesStates(new AdServicesStates.Builder().build()); in persistAdServicesStatesTest_u18User() 134 assertThat(mUxStatesManager.getFlag("INVALID_FLAG_KEY")).isFalse(); in getFlagTest_invalidFlagKey() 139 assertThat(mUxStatesManager.getFlag("TRUE_FLAG_KEY")).isTrue(); in getFlagTest_trueFlagKey() 144 assertThat(mUxStatesManager.getFlag("FALSE_FLAG_KEY")).isFalse(); in getFlagTest_falseFlagKey() 151 mUxStatesManager = new UxStatesManager(mContext, mMockFlags, mMockConsentManager); in isEeaDeviceTest_rowDevice() 153 assertThat(mUxStatesManager.isEeaDevice()).isFalse(); in isEeaDeviceTest_rowDevice() [all …]
|
/packages/modules/AdServices/adservices/tests/unittest/ui/src/com/android/adservices/service/ui/ux/ |
D | BetaUxTest.java | 43 @Mock private UxStatesManager mUxStatesManager; field in BetaUxTest 70 doReturn(true).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in isEligibleTest_adultUserWithGaFlagOn() 72 assertThat(mBetaUx.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_adultUserWithGaFlagOn() 78 doReturn(false).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in isEligibleTest_adultUserWithGaFlagOff() 80 assertThat(mBetaUx.isEligible(mConsentManager, mUxStatesManager)).isTrue(); in isEligibleTest_adultUserWithGaFlagOff() 86 doReturn(true).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in isEligibleTest_nonAdultUserWithGaFlagOn() 88 assertThat(mBetaUx.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_nonAdultUserWithGaFlagOn() 94 doReturn(false).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in isEligibleTest_nonAdultUserWithGaFlagOff() 96 assertThat(mBetaUx.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_nonAdultUserWithGaFlagOff()
|
D | GaUxTest.java | 43 @Mock private UxStatesManager mUxStatesManager; field in GaUxTest 70 doReturn(true).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in isEligibleTest_adultUserWithGaFlagOn() 72 assertThat(mGaUx.isEligible(mConsentManager, mUxStatesManager)).isTrue(); in isEligibleTest_adultUserWithGaFlagOn() 78 doReturn(false).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in isEligibleTest_adultUserWithGaFlagOff() 80 assertThat(mGaUx.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_adultUserWithGaFlagOff() 86 doReturn(true).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in isEligibleTest_nonAdultUserWithGaFlagOn() 88 assertThat(mGaUx.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_nonAdultUserWithGaFlagOn() 94 doReturn(false).when(mUxStatesManager).getFlag(KEY_GA_UX_FEATURE_ENABLED); in isEligibleTest_nonAdultUserWithGaFlagOff() 96 assertThat(mGaUx.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_nonAdultUserWithGaFlagOff()
|
D | U18UxTest.java | 43 @Mock private UxStatesManager mUxStatesManager; field in U18UxTest 70 doReturn(true).when(mUxStatesManager).getFlag(KEY_U18_UX_ENABLED); in isEligibleTest_u18UserWithU18FlagOn() 72 assertThat(mU18Ux.isEligible(mConsentManager, mUxStatesManager)).isTrue(); in isEligibleTest_u18UserWithU18FlagOn() 78 doReturn(false).when(mUxStatesManager).getFlag(KEY_U18_UX_ENABLED); in isEligibleTest_u18UserWithU18FlagOff() 80 assertThat(mU18Ux.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_u18UserWithU18FlagOff() 86 doReturn(true).when(mUxStatesManager).getFlag(KEY_U18_UX_ENABLED); in isEligibleTest_nonU18UserWithU18FlagOn() 88 assertThat(mU18Ux.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_nonU18UserWithU18FlagOn() 94 doReturn(false).when(mUxStatesManager).getFlag(KEY_U18_UX_ENABLED); in isEligibleTest_nonU18UserWithU18FlagOff() 96 assertThat(mU18Ux.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_nonU18UserWithU18FlagOff()
|
D | RvcUxTest.java | 43 @Mock private UxStatesManager mUxStatesManager; field in RvcUxTest 69 doReturn(true).when(mUxStatesManager).getFlag(KEY_RVC_UX_ENABLED); in isEligibleTest_rFlagOn() 71 assertThat(mRvcUx.isEligible(mConsentManager, mUxStatesManager)).isTrue(); in isEligibleTest_rFlagOn() 76 doReturn(false).when(mUxStatesManager).getFlag(KEY_RVC_UX_ENABLED); in isEligibleTest_rFlagOff() 78 assertThat(mRvcUx.isEligible(mConsentManager, mUxStatesManager)).isFalse(); in isEligibleTest_rFlagOff()
|
D | UnsupportedUxTest.java | 43 @Mock private UxStatesManager mUxStatesManager; field in UnsupportedUxTest 69 doReturn(false).when(mUxStatesManager).getFlag(KEY_ADSERVICES_ENABLED); in isEligibleTest_uiKillSwitchOn() 71 assertThat(mUnsupportedUx.isEligible(mConsentManager, mUxStatesManager)).isTrue(); in isEligibleTest_uiKillSwitchOn() 78 assertThat(mUnsupportedUx.isEligible(mConsentManager, mUxStatesManager)).isTrue(); in isEligibleTest_adultUserWithGaFlagOff()
|
/packages/modules/AdServices/adservices/tests/unittest/ui/src/com/android/adservices/service/ui/enrollment/ |
D | AlreadyEnrolledChannelTest.java | 47 @Mock private UxStatesManager mUxStatesManager; field in AlreadyEnrolledChannelTest 64 mUxStatesManager)) in isEligibleTest_gaUxGaNotificationAlreadyDisplayed() 75 mUxStatesManager)) in isEligibleTest_gaUxGaNotificationNotDisplayed() 87 mUxStatesManager)) in isEligibleTest_betaUxNotificationAlreadyDisplayed() 99 mUxStatesManager)) in isEligibleTest_betaUxNotificationNotDisplayed() 111 mUxStatesManager)) in isEligibleTest_u18UxNotificationAlreadyDisplayed() 125 mUxStatesManager)) in isEligibleTest_alreadyInteractedFlagOff() 131 doReturn(true).when(mUxStatesManager).getFlag(KEY_CONSENT_ALREADY_INTERACTED_FIX_ENABLE); in isEligibleTest_alreadyInteracted() 140 mUxStatesManager)) in isEligibleTest_alreadyInteracted() 151 mUxStatesManager)) in isEligibleTest_u18UxNotificationNotDisplayed()
|
D | PasReconsentNotificationChannelTest.java | 61 @Mock private UxStatesManager mUxStatesManager; field in PasReconsentNotificationChannelTest 86 doReturn(true).when(mUxStatesManager).getFlag(KEY_PAS_UX_ENABLED); in setup() 108 mUxStatesManager)) in isEligibleTest_pasNotificationAlreadyDisplayed() 127 mUxStatesManager)) in isEligibleTest_NoManualInteraction_consentRevoked_pas() 147 mUxStatesManager)) in isEligibleTest_hasManualInteraction_consentRevoked_pas() 165 mUxStatesManager)) in isEligibleTest_consentGiven_pas() 175 doReturn(true).when(mUxStatesManager).getFlag(KEY_RVC_POST_OTA_NOTIFICATION_ENABLED); in isEligibleTest_adultRvcUser_ConsentRevoked_pas() 185 mUxStatesManager)) in isEligibleTest_adultRvcUser_ConsentRevoked_pas() 195 doReturn(true).when(mUxStatesManager).getFlag(KEY_RVC_POST_OTA_NOTIFICATION_ENABLED); in isEligibleTest_adultRvcUser_ConsentGiven_pas() 205 mUxStatesManager)) in isEligibleTest_adultRvcUser_ConsentGiven_pas()
|
D | U18DetentionChannelTest.java | 54 @Mock private UxStatesManager mUxStatesManager; field in U18DetentionChannelTest 76 doReturn(true).when(mUxStatesManager).getFlag(KEY_IS_U18_UX_DETENTION_CHANNEL_ENABLED); in setup() 90 doReturn(false).when(mUxStatesManager).getFlag(KEY_IS_U18_UX_DETENTION_CHANNEL_ENABLED); in isEligibleTest_U18UxDetentionChannelDisabled() 96 mUxStatesManager)) in isEligibleTest_U18UxDetentionChannelDisabled() 108 mUxStatesManager)) in isEligibleTest_detainedGaUser() 120 mUxStatesManager)) in isEligibleTest_detainedBetaUser() 132 mUxStatesManager)) in isEligibleTest_nonU18User() 144 mUxStatesManager)) in isEligibleTest_nonBetUxCheck()
|
D | ConsentNotificationResetChannelTest.java | 54 private UxStatesManager mUxStatesManager; field in ConsentNotificationResetChannelTest 97 mUxStatesManager)) in isEligibleTest_emptyToken() 104 doReturn(mSharedPreferences).when(mUxStatesManager).getUxSharedPreferences(); in isEligibleTest_newTokenWriteSucceeded() 113 mUxStatesManager)) in isEligibleTest_newTokenWriteSucceeded() 120 doReturn(mSharedPreferences).when(mUxStatesManager).getUxSharedPreferences(); in isEligibleTest_newTokenWriteFailed() 129 mUxStatesManager)) in isEligibleTest_newTokenWriteFailed() 137 doReturn(mSharedPreferences).when(mUxStatesManager).getUxSharedPreferences(); in isEligibleTest_sameToken() 148 mUxStatesManager)) in isEligibleTest_sameToken()
|
D | ReconsentNotificationChannelTest.java | 59 @Mock private UxStatesManager mUxStatesManager; field in ReconsentNotificationChannelTest 100 mPrivacySandboxUxCollection, mConsentManager, mUxStatesManager)) in isEligibleTest_nonBetaUser() 115 mPrivacySandboxUxCollection, mConsentManager, mUxStatesManager)) in isEligibleTest_nonManualOptOutBetaUser() 130 mPrivacySandboxUxCollection, mConsentManager, mUxStatesManager)) in isEligibleTest_manualOptOutBetaUser() 143 mPrivacySandboxUxCollection, mConsentManager, mUxStatesManager)) in isEligibleTest_unknownOptOutBetaUser() 158 mPrivacySandboxUxCollection, mConsentManager, mUxStatesManager)) in isEligibleTest_nonManualOptInBetaUser() 173 mPrivacySandboxUxCollection, mConsentManager, mUxStatesManager)) in isEligibleTest_manualOptInBetaUser() 186 mPrivacySandboxUxCollection, mConsentManager, mUxStatesManager)) in isEligibleTest_unknownOptInBetaUser()
|
D | PasFirstConsentNotificationChannelTest.java | 53 @Mock private UxStatesManager mUxStatesManager; field in PasFirstConsentNotificationChannelTest 76 doReturn(true).when(mUxStatesManager).getFlag(KEY_PAS_UX_ENABLED); in setup() 96 mUxStatesManager)) in isEligibleTest_pasNotificationAlreadyDisplayed() 115 mUxStatesManager)) in isEligibleTest_NoManualInteraction_consentRevoked_pas() 134 mUxStatesManager)) in isEligibleTest_hasManualInteraction_consentRevoked_pas() 147 mUxStatesManager)) in isEligibleTest_consentGiven_pas()
|
D | FirstConsentNotificationChannelTest.java | 49 @Mock private UxStatesManager mUxStatesManager; field in FirstConsentNotificationChannelTest 70 mUxStatesManager)) in isEligibleTest_gaNotificationAlreadyDisplayed() 82 mUxStatesManager)) in isEligibleTest_betaNotificationAlreadyDisplayed() 94 mUxStatesManager)) in isEligibleTest_u18NotificationAlreadyDisplayed() 108 mUxStatesManager)) in isEligibleTest_noNotificationEverDisplayed()
|
D | ConsentNotificationDebugChannelTest.java | 56 @Mock private UxStatesManager mUxStatesManager; field in ConsentNotificationDebugChannelTest 90 doReturn(true).when(mUxStatesManager).getFlag(KEY_CONSENT_NOTIFICATION_DEBUG_MODE); in isEligibleTest_consentDebugModeOn() 94 mPrivacySandboxUxCollection, mConsentManager, mUxStatesManager)) in isEligibleTest_consentDebugModeOn() 100 doReturn(false).when(mUxStatesManager).getFlag(KEY_CONSENT_NOTIFICATION_DEBUG_MODE); in isEligibleTest_consentDebugModeOff() 104 mPrivacySandboxUxCollection, mConsentManager, mUxStatesManager)) in isEligibleTest_consentDebugModeOff()
|
D | RvcPostOTAChannelTest.java | 56 @Mock private UxStatesManager mUxStatesManager; field in RvcPostOTAChannelTest 90 doReturn(true).when(mUxStatesManager).getFlag(KEY_RVC_POST_OTA_NOTIFICATION_ENABLED); in isEligibleTest_isRvcAdultUser() 97 mUxStatesManager)) in isEligibleTest_isRvcAdultUser() 103 doReturn(true).when(mUxStatesManager).getFlag(KEY_RVC_POST_OTA_NOTIFICATION_ENABLED); in isEligibleTest_notRvcAdultUser() 110 mUxStatesManager)) in isEligibleTest_notRvcAdultUser()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/ui/ |
D | UxEngine.java | 40 private final UxStatesManager mUxStatesManager; field in UxEngine 52 mUxStatesManager = uxStatesManager; in UxEngine() 74 mUxStatesManager.persistAdServicesStates(adServicesStates); in start() 78 mUxEngineUtil.getEligibleUxCollection(mConsentManager, mUxStatesManager); in start() 82 eligibleUx, mConsentManager, mUxStatesManager); in start()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/common/ |
D | ConsentNotificationJobService.java | 74 private UxStatesManager mUxStatesManager; field in ConsentNotificationJobService 199 mUxStatesManager = uxStatesManager; in setUxStatesManager() 219 if (mUxStatesManager == null) { in onStartJob() 225 !mConsentManager.isAdIdEnabled() || mUxStatesManager.isEeaDevice(); in onStartJob() 229 mConsentManager.isAdIdEnabled(), mUxStatesManager.isEeaDevice(), isEeaNotification); in onStartJob()
|
D | AdServicesCommonServiceImpl.java | 114 private final UxStatesManager mUxStatesManager; field in AdServicesCommonServiceImpl 132 mUxStatesManager = uxStatesManager; in AdServicesCommonServiceImpl() 167 isAdServicesEnabled &= mUxStatesManager.isEnrolledUser(mContext); in isAdServicesEnabled()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/ |
D | ConsentNotificationJobServiceTest.java | 100 @Mock UxStatesManager mUxStatesManager; field in ConsentNotificationJobServiceTest 133 ExtendedMockito.doReturn(mUxStatesManager).when(() -> UxStatesManager.getInstance()); in setup() 137 mConsentNotificationJobService.setUxStatesManager(mUxStatesManager); in setup() 183 Mockito.doReturn(true).when(mUxStatesManager).isEeaDevice(); in testOnStartJobAsyncUtilExecute_Reconsent_GaUxDisabled() 218 Mockito.doReturn(true).when(mUxStatesManager).isEeaDevice(); in testOnStartJobAsyncUtilExecute_ReconsentFalse() 454 Mockito.doReturn(true).when(mUxStatesManager).isEeaDevice(); in testOnStartJobAsyncUtilExecute() 532 Mockito.doReturn(true).when(mUxStatesManager).isEeaDevice(); in mockEuDevice()
|
D | AdServicesCommonServiceImplTest.java | 113 @Mock private UxStatesManager mUxStatesManager; field in AdServicesCommonServiceImplTest 141 mUxStatesManager, in setup() 152 ExtendedMockito.doReturn(mUxStatesManager).when(() -> UxStatesManager.getInstance()); in setup() 177 doReturn(true).when(mUxStatesManager).isEnrolledUser(mContext); in setup() 183 doReturn(false).when(mUxStatesManager).isEnrolledUser(mContext); in isAdServiceEnabledTest_userNotEnrolledEntryPointLogicV1() 190 mUxStatesManager, in isAdServiceEnabledTest_userNotEnrolledEntryPointLogicV1() 204 doReturn(false).when(mUxStatesManager).isEnrolledUser(mContext); in isAdServiceEnabledTest_userNotEnrolledEntryPointLogicV2() 213 mUxStatesManager, in isAdServiceEnabledTest_userNotEnrolledEntryPointLogicV2() 230 mUxStatesManager, in getAdserviceStatusTest() 256 mUxStatesManager, in getAdserviceStatusWithCheckActivityTest()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/download/ |
D | MobileDataDownloadTest.java | 175 @Mock UxStatesManager mUxStatesManager; field in MobileDataDownloadTest 195 doReturn(mUxStatesManager).when(() -> UxStatesManager.getInstance()); in setUp() 581 doReturn(PrivacySandboxUxCollection.U18_UX).when(mUxStatesManager).getUx(); in topicsDownloadTest_U18UxEnabled()
|