Home
last modified time | relevance | path

Searched refs:mAtomicFile (Results 1 – 10 of 10) sorted by relevance

/packages/modules/Connectivity/thread/tests/unit/src/com/android/server/thread/
DThreadPersistentSettingsTest.java60 @Mock private AtomicFile mAtomicFile; field in ThreadPersistentSettingsTest
74 when(mAtomicFile.startWrite()).thenReturn(fos); in setUp()
76 new ThreadPersistentSettings(mAtomicFile, mConnectivityResources); in setUp()
123 verify(mAtomicFile).startWrite(); in put_ThreadFeatureEnabledTrue_returnsTrue()
124 verify(mAtomicFile).finishWrite(any()); in put_ThreadFeatureEnabledTrue_returnsTrue()
133 verify(mAtomicFile).startWrite(); in put_ThreadFeatureEnabledFalse_returnsFalse()
134 verify(mAtomicFile).finishWrite(any()); in put_ThreadFeatureEnabledFalse_returnsFalse()
144 verify(mAtomicFile).startWrite(); in put_ThreadCountryCodeString_returnsString()
145 verify(mAtomicFile).finishWrite(any()); in put_ThreadCountryCodeString_returnsString()
155 verify(mAtomicFile).startWrite(); in put_ThreadCountryCodeNull_returnsNull()
[all …]
/packages/modules/OnDevicePersonalization/systemservice/java/com/android/server/ondevicepersonalization/
DBooleanFileDataStore.java56 private final AtomicFile mAtomicFile; field in BooleanFileDataStore
66 mAtomicFile = new AtomicFile(new File(parentPath, filename)); in BooleanFileDataStore()
74 sLogger.d(TAG + ": reading from file " + mAtomicFile.getBaseFile()); in initialize()
169 out = mAtomicFile.startWrite(); in writeToFile()
171 mAtomicFile.finishWrite(out); in writeToFile()
173 mAtomicFile.failWrite(out); in writeToFile()
174 sLogger.e(TAG + ": write to file " + mAtomicFile.getBaseFile() + " failed."); in writeToFile()
183 mAtomicFile.readFully()); in readFromFile()
195 sLogger.e(TAG + ": read from " + mAtomicFile.getBaseFile() + " failed"); in readFromFile()
207 mAtomicFile.delete(); in tearDownForTesting()
/packages/modules/Uwb/service/tests/src/com/android/server/uwb/
DUwbSettingsStoreTest.java68 @Mock private AtomicFile mAtomicFile; field in UwbSettingsStoreTest
81 when(mAtomicFile.startWrite()).thenReturn(fos); in setUp()
83 mContext, new Handler(mLooper.getLooper()), mAtomicFile, mUwbInjector); in setUp()
102 verify(mAtomicFile).startWrite(); in testSetterGetter()
103 verify(mAtomicFile).finishWrite(any()); in testSetterGetter()
136 verify(mAtomicFile, never()).startWrite(); in testLoadFromStore()
141 doThrow(new FileNotFoundException()).when(mAtomicFile).openRead(); in testMigrationWhenStoreFileEmptyOrNotFound()
155 verify(mAtomicFile, times(1)).startWrite(); in testMigrationWhenStoreFileEmptyOrNotFound()
161 doThrow(new FileNotFoundException()).when(mAtomicFile).openRead(); in testNoMigrationLoadFromStoreWhenStoreFileEmptyOrNotFound()
173 verify(mAtomicFile, never()).startWrite(); in testNoMigrationLoadFromStoreWhenStoreFileEmptyOrNotFound()
[all …]
/packages/modules/AdServices/shared/libraries/device-side/java/com/android/adservices/shared/storage/
DBooleanFileDatastore.java71 private final AtomicFile mAtomicFile; field in BooleanFileDatastore
83 mAtomicFile = new AtomicFile(Objects.requireNonNull(file)); in BooleanFileDatastore()
98 LogUtil.d("Reading from store file: %s", mAtomicFile.getBaseFile()); in initialize()
126 out = mAtomicFile.startWrite(); in writeToFile()
128 mAtomicFile.finishWrite(out); in writeToFile()
131 mAtomicFile.failWrite(out); in writeToFile()
144 new ByteArrayInputStream(mAtomicFile.readFully()); in readFromFile()
438 writer.printf("%smAtomicFile: %s", prefix, mAtomicFile.getBaseFile().getAbsolutePath()); in dump()
440 writer.printf(" (last modified at %d)", mAtomicFile.getLastModifiedTime()); in dump()
454 mAtomicFile.delete(); in tearDownForTesting()
/packages/apps/Nfc/tests/unit/src/com/android/nfc/cardemulation/
DRegisteredNfcFServicesCacheTest.java115 private AtomicFile mAtomicFile; field in RegisteredNfcFServicesCacheTest
174 when(mAtomicFile.startWrite()).thenReturn(mFos); in setUp()
175 when(mAtomicFile.openRead()).thenReturn(mFis); in setUp()
176 when(mAtomicFile.getBaseFile()).thenReturn(mFile); in setUp()
483 cache = new RegisteredNfcFServicesCache(mContext, mCallback, mAtomicFile); in testRegisterSystemCodeForService_ReturnsTrue()
535 cache = new RegisteredNfcFServicesCache(mContext, mCallback, mAtomicFile); in testRemoveSystemCodeForService_ReturnsTrue()
614 cache = new RegisteredNfcFServicesCache(mContext, mCallback, mAtomicFile); in testSetNfcid2ForService_ReturnsTrue()
725 when(mAtomicFile.startWrite()).thenThrow(IOException.class); in testWriteDynamicSystemCodeNfcid2LockedWithInvalidSerializer_ReturnsFalse()
726 cache = new RegisteredNfcFServicesCache(mContext, mCallback, mAtomicFile); in testWriteDynamicSystemCodeNfcid2LockedWithInvalidSerializer_ReturnsFalse()
731 verify(mAtomicFile, never()).failWrite(any(FileOutputStream.class)); in testWriteDynamicSystemCodeNfcid2LockedWithInvalidSerializer_ReturnsFalse()
[all …]
/packages/modules/Connectivity/thread/service/java/com/android/server/thread/
DThreadPersistentSettings.java80 private final AtomicFile mAtomicFile; field in ThreadPersistentSettings
97 mAtomicFile = atomicFile; in ThreadPersistentSettings()
207 writeToAtomicFile(mAtomicFile, outputStream.toByteArray()); in writeToStoreFile()
218 Log.i(TAG, "Reading from store file: " + mAtomicFile.getBaseFile()); in readFromStoreFile()
219 readData = readFromAtomicFile(mAtomicFile); in readFromStoreFile()
/packages/modules/Uwb/service/java/com/android/server/uwb/
DUwbConfigStore.java794 private final AtomicFile mAtomicFile; field in UwbConfigStore.StoreFile
810 mAtomicFile = new AtomicFile(file); in StoreFile()
816 return mAtomicFile.getBaseFile().getName(); in getName()
833 bytes = mAtomicFile.readFully(); in readRawData()
862 out = mAtomicFile.startWrite(); in writeBufferedRawData()
864 mAtomicFile.finishWrite(out); in writeBufferedRawData()
867 mAtomicFile.failWrite(out); in writeBufferedRawData()
DUwbSettingsStore.java99 private final AtomicFile mAtomicFile; field in UwbSettingsStore
128 mAtomicFile = atomicFile; in UwbSettingsStore()
136 Log.i(TAG, "Reading from store file: " + mAtomicFile.getBaseFile()); in initialize()
327 FileUtils.writeToAtomicFile(mAtomicFile, outputStream.toByteArray()); in writeToStoreFile()
335 final byte[] readData = FileUtils.readFromAtomicFile(mAtomicFile); in readFromStoreFile()
/packages/modules/Wifi/service/java/com/android/server/wifi/
DWifiConfigStore.java776 private final AtomicFile mAtomicFile; field in WifiConfigStore.StoreFile
801 mAtomicFile = new AtomicFile(file); in StoreFile()
809 return mAtomicFile.getBaseFile().getName(); in getName()
834 bytes = mAtomicFile.readFully(); in readRawData()
863 out = mAtomicFile.startWrite(); in writeBufferedRawData()
866 mAtomicFile.finishWrite(out); in writeBufferedRawData()
869 mAtomicFile.failWrite(out); in writeBufferedRawData()
/packages/services/Telecomm/src/com/android/server/telecom/
DPhoneAccountRegistrar.java173 private final AtomicFile mAtomicFile; field in PhoneAccountRegistrar
205 mAtomicFile = new AtomicFile(new File(context.getFilesDir(), fileName)); in PhoneAccountRegistrar()
2030 fileOutput = mAtomicFile.startWrite(); in doInBackground()
2032 mAtomicFile.finishWrite(fileOutput); in doInBackground()
2036 mAtomicFile.failWrite(fileOutput); in doInBackground()
2058 is = mAtomicFile.openRead(); in read()