Home
last modified time | relevance | path

Searched refs:mDatastore (Results 1 – 17 of 17) sorted by relevance

/packages/modules/AdServices/shared/tests/device-side/java/com/android/adservices/shared/storage/
DBooleanFileDatastoreTest.java61 private final BooleanFileDatastore mDatastore = field in BooleanFileDatastoreTest
66 mDatastore.initialize(); in initializeDatastore()
71 mDatastore.tearDownForTesting(); in cleanupDatastore()
154 expect.withMessage("keys").that(mDatastore.keySet()).isEmpty(); in testInitializeEmptyBooleanFileDatastore()
159 assertThrows(NullPointerException.class, () -> mDatastore.put(null, true)); in testNullOrEmptyKeyFails()
161 assertThrows(IllegalArgumentException.class, () -> mDatastore.put("", true)); in testNullOrEmptyKeyFails()
163 assertThrows(NullPointerException.class, () -> mDatastore.putIfNew(null, true)); in testNullOrEmptyKeyFails()
165 assertThrows(IllegalArgumentException.class, () -> mDatastore.putIfNew("", true)); in testNullOrEmptyKeyFails()
167 assertThrows(NullPointerException.class, () -> mDatastore.get(null)); in testNullOrEmptyKeyFails()
169 assertThrows(IllegalArgumentException.class, () -> mDatastore.get("")); in testNullOrEmptyKeyFails()
[all …]
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/consent/
DAppConsentStorageManager.java48 private final BooleanFileDatastore mDatastore; field in AppConsentStorageManager
61 this.mDatastore = datastore; in AppConsentStorageManager()
136 Objects.requireNonNullElse(mDatastore.get(apiType.toPpApiDatastoreKey()), false)); in getConsent()
151 if (Boolean.TRUE.equals(mDatastore.get(featureType.name()))) { in getCurrentPrivacySandboxFeature()
163 mDatastore.put(currentFeatureType.name(), currentFeatureType == featureType); in setCurrentPrivacySandboxFeature()
193 mDatastore.get(ConsentConstants.MANUAL_INTERACTION_WITH_CONSENT_RECORDED); in getUserManualInteractionWithConsent()
218 return Objects.requireNonNullElse(mDatastore.get(ConsentConstants.IS_AD_ID_ENABLED), false); in isAdIdEnabled()
224 mDatastore.put(ConsentConstants.IS_AD_ID_ENABLED, isAdIdEnabled); in setAdIdEnabled()
230 return Objects.requireNonNullElse(mDatastore.get(ConsentConstants.IS_ADULT_ACCOUNT), false); in isAdultAccount()
236 mDatastore.put(ConsentConstants.IS_ADULT_ACCOUNT, isAdultAccount); in setAdultAccount()
[all …]
DConsentManager.java132 private final BooleanFileDatastore mDatastore; field in ConsentManager
194 mDatastore = booleanFileDatastore; in ConsentManager()
487 () -> AdServicesApiConsent.getConsent(mDatastore.get(ConsentConstants.CONSENT_KEY)), in getConsent()
523 mDatastore.get(apiType.toPpApiDatastoreKey())), in getConsent()
1089 mDatastore.put(
1117 () -> mDatastore.get(ConsentConstants.NOTIFICATION_DISPLAYED_ONCE),
1139 mDatastore.put(
1165 () -> mDatastore.get(ConsentConstants.GA_UX_NOTIFICATION_DISPLAYED_ONCE),
1183 mDatastore.put(
1213 () -> mDatastore.get(ConsentConstants.PAS_NOTIFICATION_DISPLAYED_ONCE),
[all …]
DConsentManagerV2.java121 private final BooleanFileDatastore mDatastore; field in ConsentManagerV2
184 mDatastore = booleanFileDatastore; in ConsentManagerV2()
1369 mDatastore.put(ConsentConstants.CONSENT_KEY, isGiven); in setConsentToPpApi()
/packages/modules/AdServices/adservices/service/java/com/android/server/adservices/consent/
DConsentManager.java67 private final BooleanFileDatastore mDatastore; field in ConsentManager
89 mDatastore = datastore; in ConsentManager()
145 .setIsGiven(mDatastore.get(getConsentApiTypeKey(consentApiType))) in getConsent()
159 mDatastore.put( in setConsent()
164 mDatastore.put( in setConsent()
166 mDatastore.put( in setConsent()
168 mDatastore.put( in setConsent()
172 if (mDatastore.get( in setConsent()
175 && mDatastore.get( in setConsent()
178 && mDatastore.get( in setConsent()
[all …]
DAppConsentManager.java57 private final BooleanFileDatastore mDatastore; field in AppConsentManager
64 mDatastore = datastore; in AppConsentManager()
93 Set<String> appWithConsentInDatastore = mDatastore.keySetFalse(); in getKnownAppsWithConsent()
114 Set<String> appWithoutConsentInDatastore = mDatastore.keySetTrue(); in getAppsWithRevokedConsent()
135 mDatastore.put(toDatastoreKey(packageName, packageUid), isConsentRevoked); in setConsentForApp()
152 return mDatastore.putIfNew(toDatastoreKey(packageName, packageUid), isConsentRevoked); in setConsentForAppIfNew()
168 return Boolean.TRUE.equals(mDatastore.get(toDatastoreKey(packageName, packageUid))); in isConsentRevokedForApp()
177 mDatastore.clear(); in clearAllAppConsentData()
187 mDatastore.clearAllFalse(); in clearKnownAppsWithConsent()
200 mDatastore.remove(toDatastoreKey(packageName, packageUid)); in clearConsentForUninstalledApp()
[all …]
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/consent/
DAppConsentDao.java66 private final BooleanFileDatastore mDatastore; field in AppConsentDao
77 mDatastore = datastore; in AppConsentDao()
111 mDatastore.initialize(); in initializeDatastoreIfNeeded()
125 Set<String> datastoreKeys = mDatastore.keySetFalse(); in getKnownAppsWithConsent()
144 Set<String> datastoreKeys = mDatastore.keySetTrue(); in getAppsWithRevokedConsent()
166 mDatastore.put(toDatastoreKey(packageName), isConsentRevoked); in setConsentForApp()
183 return mDatastore.putIfNew(toDatastoreKey(packageName), isConsentRevoked); in setConsentForAppIfNew()
200 return Boolean.TRUE.equals(mDatastore.get(toDatastoreKey(packageName))); in isConsentRevokedForApp()
210 mDatastore.clear(); in clearAllConsentData()
221 mDatastore.clearAllFalse(); in clearKnownAppsWithConsent()
[all …]
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/ui/data/
DUxStatesDao.java51 private final BooleanFileDatastore mDatastore; field in UxStatesDao
57 mDatastore = datastore; in UxStatesDao()
79 if (Boolean.TRUE.equals(mDatastore.get(uxCollection.toString()))) { in getUx()
90 mDatastore.put(uxCollection.toString(), ux.equals(uxCollection)); in setUx()
102 if (Boolean.TRUE.equals(mDatastore.get(enrollmentChannelCollection.toString()))) { in getEnrollmentChannel()
119 mDatastore.put( in setEnrollmentChannel()
/packages/modules/HealthFitness/tests/unittests/src/com/android/server/healthconnect/permission/
DFirstGrantTimeUnitTest.java85 @Mock private FirstGrantTimeDatastore mDatastore; field in FirstGrantTimeUnitTest
97 when(mDatastore.readForUser(CURRENT_USER, DATA_TYPE_CURRENT)) in setUp()
99 when(mDatastore.readForUser(CURRENT_USER, DATA_TYPE_STAGED)) in setUp()
111 mGrantTimeManager = new FirstGrantTimeManager(mContext, mTracker, mDatastore); in setUp()
147 mGrantTimeManager = new FirstGrantTimeManager(mContext, mTracker, mDatastore); in testSetFirstGrantTimeForAnApp_expectOtherAppsGrantTimesRemained()
151 when(mDatastore.readForUser(CURRENT_USER, DATA_TYPE_CURRENT)) in testSetFirstGrantTimeForAnApp_expectOtherAppsGrantTimesRemained()
165 verify(mDatastore).writeForUser(captor.capture(), eq(CURRENT_USER), anyInt()); in testSetFirstGrantTimeForAnApp_expectOtherAppsGrantTimesRemained()
192 when(mDatastore.readForUser(CURRENT_USER, DATA_TYPE_CURRENT)).thenReturn(null); in testOnPermissionsChangedCalledWhileDeviceIsLocked_getGrantTimeNotNullAfterUnlock()
193 when(mDatastore.readForUser(CURRENT_USER, DATA_TYPE_STAGED)).thenReturn(null); in testOnPermissionsChangedCalledWhileDeviceIsLocked_getGrantTimeNotNullAfterUnlock()
206 when(mDatastore.readForUser(CURRENT_USER, DATA_TYPE_CURRENT)) in testOnPermissionsChangedCalledWhileDeviceIsLocked_getGrantTimeNotNullAfterUnlock()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/appsearch/src/com/android/adservices/service/appsearch/
DAppSearchConsentManagerTest.java85 @Mock private BooleanFileDatastore mDatastore; field in AppSearchConsentManagerTest
344 mSharedPrefs, mDatastore, mAdServicesManager, false); in testShouldInitConsentDataFromAppSearch_notT()
355 mSharedPrefs, mDatastore, mAdServicesManager, false); in testShouldInitConsentDataFromAppSearch_flagDisabled()
367 mSharedPrefs, mDatastore, mAdServicesManager, false); in testShouldInitConsentDataFromAppSearch_hasMigrated()
380 mSharedPrefs, mDatastore, mAdServicesManager, false); in testShouldInitConsentDataFromAppSearch_notificationWasDisplayedInSystemServer()
391 when(mDatastore.get(any())).thenReturn(true); in testShouldInitConsentDataFromAppSearch_notificationWasDisplayedInPPAPI()
395 mSharedPrefs, mDatastore, mAdServicesManager, false); in testShouldInitConsentDataFromAppSearch_notificationWasDisplayedInPPAPI()
406 when(mDatastore.get(any())).thenReturn(false); in testShouldInitConsentDataFromAppSearch_notificationNotDisplayed()
412 mSharedPrefs, mDatastore, mAdServicesManager, false); in testShouldInitConsentDataFromAppSearch_notificationNotDisplayed()
421 mSharedPrefs, mDatastore, mAdServicesManager, false); in testShouldInitConsentDataFromAppSearch()
[all …]
DAppSearchConsentStorageManagerTest.java76 @Mock private BooleanFileDatastore mDatastore; field in AppSearchConsentStorageManagerTest
337 mSharedPrefs, mDatastore, mAdServicesStorageManager, false); in testShouldInitConsentDataFromAppSearch_notT()
348 mSharedPrefs, mDatastore, mAdServicesStorageManager, false); in testShouldInitConsentDataFromAppSearch_flagDisabled()
360 mSharedPrefs, mDatastore, mAdServicesStorageManager, false); in testShouldInitConsentDataFromAppSearch_hasMigrated()
373 mSharedPrefs, mDatastore, mAdServicesStorageManager, false); in testShouldInitConsentDataFromAppSearch_notificationWasDisplayedInSystemServer()
384 when(mDatastore.get(any())).thenReturn(true); in testShouldInitConsentDataFromAppSearch_notificationWasDisplayedInPPAPI()
388 mSharedPrefs, mDatastore, mAdServicesStorageManager, false); in testShouldInitConsentDataFromAppSearch_notificationWasDisplayedInPPAPI()
399 when(mDatastore.get(any())).thenReturn(false); in testShouldInitConsentDataFromAppSearch_notificationNotDisplayed()
405 mSharedPrefs, mDatastore, mAdServicesStorageManager, false); in testShouldInitConsentDataFromAppSearch_notificationNotDisplayed()
414 mSharedPrefs, mDatastore, mAdServicesStorageManager, false); in testShouldInitConsentDataFromAppSearch()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/data/common/
DBooleanFileDatastoreTest.java38 private final BooleanFileDatastore mDatastore = field in BooleanFileDatastoreTest
43 mDatastore.initialize(); in initializeDatastore()
48 mDatastore.tearDownForTesting(); in cleanupDatastore()
54 .that(mDatastore.getVersionKey()) in testGetVersionKey()
/packages/modules/HealthFitness/service/java/com/android/server/healthconnect/permission/
DFirstGrantTimeManager.java65 private final FirstGrantTimeDatastore mDatastore; field in FirstGrantTimeManager
81 mDatastore = datastore; in FirstGrantTimeManager()
142 mDatastore.writeForUser( in setFirstGrantTime()
240 mDatastore.writeForUser(updatedState, user, DATA_TYPE_CURRENT); in updateFirstGrantTimesFromPermissionState()
278 mDatastore.writeForUser(state, userId, DATA_TYPE_STAGED); in applyAndStageGrantTimeStateForUser()
287 return mDatastore.getFile(userHandle, DATA_TYPE_CURRENT); in getFile()
310 mDatastore.writeForUser(updatedState, userHandle, DATA_TYPE_CURRENT); in onPackageRemoved()
339 mDatastore.writeForUser( in updateGrantTimesWithStagedDataLocked()
349 UserGrantTimeState backupState = mDatastore.readForUser(user, DATA_TYPE_STAGED); in tryUpdateGrantTimeFromStagedDataLocked()
379 mDatastore.writeForUser(backupState, user, DATA_TYPE_STAGED); in tryUpdateGrantTimeFromStagedDataLocked()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/system-service/src/com/android/server/adservices/rollback/
DRollbackHandlingManagerTest.java55 private BooleanFileDatastore mDatastore; field in RollbackHandlingManagerTest
59 mDatastore = in setup()
69 mDatastore.tearDownForTesting(); in tearDown()
/packages/modules/AdServices/adservices/tests/unittest/ui/src/com/android/adservices/service/consent/
DConsentManagerV2Test.java214 private BooleanFileDatastore mDatastore; field in ConsentManagerV2Test
256 mDatastore = in setup()
265 mAppConsentDaoSpy = spy(new AppConsentDao(mDatastore, mSpyContext.getPackageManager())); in setup()
349 mDatastore.clear(); in teardown()
902 mDatastore.put(AppConsentDaoFixture.APP10_DATASTORE_KEY, false); in testIsFledgeConsentRevokedForAppWithFullApiConsentGaUxEnabled_ppApiOnly()
903 mDatastore.put(AppConsentDaoFixture.APP20_DATASTORE_KEY, true); in testIsFledgeConsentRevokedForAppWithFullApiConsentGaUxEnabled_ppApiOnly()
1188 mDatastore.put(AppConsentDaoFixture.APP10_DATASTORE_KEY, false); in testIsFledgeConsentRevokedForAppAfterSetFledgeUseWithFullApiConsentGaUxEnabled_ppApi()
1189 mDatastore.put(AppConsentDaoFixture.APP20_DATASTORE_KEY, true); in testIsFledgeConsentRevokedForAppAfterSetFledgeUseWithFullApiConsentGaUxEnabled_ppApi()
1412 mDatastore.put(AppConsentDaoFixture.APP10_DATASTORE_KEY, false); in testGetKnownAppsWithConsent_ppApiOnly()
1413 mDatastore.put(AppConsentDaoFixture.APP20_DATASTORE_KEY, false); in testGetKnownAppsWithConsent_ppApiOnly()
[all …]
DConsentManagerTest.java220 private BooleanFileDatastore mDatastore; field in ConsentManagerTest
250 mDatastore = in setup()
256 mAppConsentDaoSpy = spy(new AppConsentDao(mDatastore, mSpyContext.getPackageManager())); in setup()
327 mDatastore.clear(); in teardown()
955 mDatastore.put(AppConsentDaoFixture.APP10_DATASTORE_KEY, false); in testIsFledgeConsentRevokedForAppWithFullApiConsentGaUxEnabled_ppApiOnly()
956 mDatastore.put(AppConsentDaoFixture.APP20_DATASTORE_KEY, true); in testIsFledgeConsentRevokedForAppWithFullApiConsentGaUxEnabled_ppApiOnly()
1245 mDatastore.put(AppConsentDaoFixture.APP10_DATASTORE_KEY, false); in testIsFledgeConsentRevokedForAppAfterSetFledgeUseWithFullApiConsentGaUxEnabled_ppApi()
1246 mDatastore.put(AppConsentDaoFixture.APP20_DATASTORE_KEY, true); in testIsFledgeConsentRevokedForAppAfterSetFledgeUseWithFullApiConsentGaUxEnabled_ppApi()
1469 mDatastore.put(AppConsentDaoFixture.APP10_DATASTORE_KEY, false); in testGetKnownAppsWithConsent_ppApiOnly()
1470 mDatastore.put(AppConsentDaoFixture.APP20_DATASTORE_KEY, false); in testGetKnownAppsWithConsent_ppApiOnly()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/system-service/src/com/android/server/adservices/consent/
DConsentManagerTest.java58 private BooleanFileDatastore mDatastore; field in ConsentManagerTest
62 mDatastore = in setup()
72 mDatastore.tearDownForTesting(); in tearDown()