Skip to content

Commit 3176326

Browse files
committed
fixing incorrect upload word usage.
1 parent ad19d64 commit 3176326

File tree

7 files changed

+42
-42
lines changed

7 files changed

+42
-42
lines changed

firebase-ml-modeldownloader/src/main/java/com/google/firebase/ml/modeldownloader/CustomModel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* Used to store information about custom models that are being downloaded or are already downloaded
2626
* on a device. The model file associated with this model can be updated, once the new model file is
27-
* fully uploaded, the original model file will be removed as soon as it is safe to do so.
27+
* fully downloaded, the original model file will be removed as soon as it is safe to do so.
2828
*/
2929
public class CustomModel {
3030
private final String name;
@@ -126,7 +126,7 @@ public String getName() {
126126
* The local model file. If null is returned, use the download Id to check the download status.
127127
*
128128
* @return the local file associated with the model, if the original file download is still in
129-
* progress, returns null, if file update is in progress returns last fully uploaded model.
129+
* progress, returns null, if file update is in progress returns last fully downloaded model.
130130
*/
131131
@Nullable
132132
public File getFile() throws FirebaseMlException {
@@ -137,7 +137,7 @@ public File getFile() throws FirebaseMlException {
137137
* The local model file. If null is returned, use the download Id to check the download status.
138138
*
139139
* @return the local file associated with the model. If the original file download is still in
140-
* progress, returns null. If file update is in progress, returns the last fully uploaded
140+
* progress, returns null. If file update is in progress, returns the last fully downloaded
141141
* model.
142142
*/
143143
@Nullable
@@ -170,7 +170,7 @@ boolean isModelFilePresent() {
170170

171171
/**
172172
* The size of the file currently associated with this model. If a download is in progress, this
173-
* will be the size of the current model, not the new model currently being uploaded.
173+
* will be the size of the current model, not the new model currently being downloaded.
174174
*
175175
* @return the local model size
176176
*/

firebase-ml-modeldownloader/src/main/java/com/google/firebase/ml/modeldownloader/FirebaseModelDownloader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public Task<CustomModel> getModel(
135135
// check for latest model, wait for download if newer model exists
136136
return getCustomModelTask(modelName, conditions, localModelDetails.getModelHash());
137137
case LOCAL_MODEL_UPDATE_IN_BACKGROUND:
138-
// start upload in background, if newer model exists
138+
// start download in background, if newer model exists
139139
getCustomModelTask(modelName, conditions, localModelDetails.getModelHash());
140140
return getCompletedLocalCustomModelTask(localModelDetails);
141141
}

firebase-ml-modeldownloader/src/main/java/com/google/firebase/ml/modeldownloader/internal/ModelFileDownloadService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public File loadNewlyDownloadedModelFile(CustomModel model) {
392392
}
393393

394394
// Successfully moved, update share preferences
395-
sharedPreferencesUtil.setUploadedCustomModelDetails(
395+
sharedPreferencesUtil.setLoadedCustomModelDetails(
396396
new CustomModel(
397397
model.getName(), model.getModelHash(), model.getSize(), 0, newModelFile.getPath()));
398398

firebase-ml-modeldownloader/src/main/java/com/google/firebase/ml/modeldownloader/internal/SharedPreferencesUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public SharedPreferencesUtil(FirebaseApp firebaseApp) {
6565
* Returns the Custom Model details currently associated with this model. If a fully downloaded
6666
* model is present - this returns the details of that model, including local file path. If an
6767
* update of an existing model is in progress, the local model plus the download id for the new
68-
* upload is returned. To get only details related to the downloading model use {@link
68+
* download is returned. To get only details related to the downloading model use {@link
6969
* #getDownloadingCustomModelDetails}. If this is the initial download of a local file - the
7070
* downloading model details are returned.
7171
*
@@ -161,7 +161,7 @@ public synchronized void setDownloadingCustomModelDetails(@NonNull CustomModel c
161161
*
162162
* @param customModel custom model details to be stored.
163163
*/
164-
public synchronized void setUploadedCustomModelDetails(@NonNull CustomModel customModel)
164+
public synchronized void setLoadedCustomModelDetails(@NonNull CustomModel customModel)
165165
throws IllegalArgumentException {
166166
Long id = customModel.getDownloadId();
167167
// only call when download is completed and download id is reset to 0;

firebase-ml-modeldownloader/src/test/java/com/google/firebase/ml/modeldownloader/FirebaseModelDownloaderTest.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class FirebaseModelDownloaderTest {
7979
new CustomModel(MODEL_NAME, UPDATE_MODEL_HASH, 100, MODEL_URL, URL_EXPIRATION + 10L);
8080
private final CustomModel UPDATE_IN_PROGRESS_CUSTOM_MODEL =
8181
new CustomModel(MODEL_NAME, UPDATE_MODEL_HASH, 100, DOWNLOAD_ID);
82-
private CustomModel customModelUploaded;
82+
private CustomModel customModelUpdateLoaded;
8383
private CustomModel customModelLoaded;
8484

8585
private @Mock SharedPreferencesUtil mockPrefs;
@@ -159,7 +159,7 @@ private void setUpTestingFiles(FirebaseApp app) throws Exception {
159159

160160
customModelLoaded =
161161
new CustomModel(MODEL_NAME, MODEL_HASH, 100, 0, expectedDestinationFolder + "/0");
162-
customModelUploaded =
162+
customModelUpdateLoaded =
163163
new CustomModel(MODEL_NAME, MODEL_HASH, 100, 0, expectedDestinationFolder + "/1");
164164
}
165165

@@ -199,15 +199,15 @@ public void getModel_latestModel_localExists_noUpdate_MissingFile() throws Excep
199199
new CustomModel(MODEL_NAME, UPDATE_MODEL_HASH, 100, 0, expectedDestinationFolder + "/4");
200200
when(mockPrefs.getCustomModelDetails(eq(MODEL_NAME)))
201201
.thenReturn(missingFileModel)
202-
.thenReturn(customModelUploaded);
202+
.thenReturn(customModelUpdateLoaded);
203203
when(mockModelDownloadService.getCustomModelDetails(
204204
eq(TEST_PROJECT_ID), eq(MODEL_NAME), eq(null)))
205205
.thenReturn(Tasks.forResult(UPDATE_CUSTOM_MODEL_URL));
206206

207207
when(mockFileDownloadService.download(any(), eq(DEFAULT_DOWNLOAD_CONDITIONS)))
208208
.thenReturn(Tasks.forResult(null));
209209
when(mockFileDownloadService.getExistingDownloadTask(0)).thenReturn(null);
210-
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUploaded)))
210+
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUpdateLoaded)))
211211
.thenReturn(secondDeviceModelFile);
212212

213213
TestOnCompleteListener<CustomModel> onCompleteListener = new TestOnCompleteListener<>();
@@ -221,7 +221,7 @@ public void getModel_latestModel_localExists_noUpdate_MissingFile() throws Excep
221221
verify(mockPrefs, times(1)).clearModelDetails(eq(MODEL_NAME));
222222
verify(mockFileManager, times(1)).deleteAllModels(eq(MODEL_NAME));
223223
assertThat(task.isComplete()).isTrue();
224-
assertEquals(customModel, customModelUploaded);
224+
assertEquals(customModel, customModelUpdateLoaded);
225225
}
226226

227227
@Test
@@ -230,7 +230,7 @@ public void getModel_latestModel_localExists_noUpdate_MissingDownloadId() throws
230230
when(mockPrefs.getCustomModelDetails(eq(MODEL_NAME)))
231231
.thenReturn(badLocalModel) // getlocalModelDetails 1
232232
.thenReturn(null) // getCustomModelTask 1
233-
.thenReturn(customModelUploaded); // finishModelDownload
233+
.thenReturn(customModelUpdateLoaded); // finishModelDownload
234234
when(mockPrefs.getDownloadingCustomModelDetails(eq(MODEL_NAME)))
235235
.thenReturn(UPDATE_IN_PROGRESS_CUSTOM_MODEL); // getLocalModelDetails 2, finishModelDownload
236236

@@ -241,7 +241,7 @@ public void getModel_latestModel_localExists_noUpdate_MissingDownloadId() throws
241241
when(mockFileDownloadService.download(any(), eq(DEFAULT_DOWNLOAD_CONDITIONS)))
242242
.thenReturn(Tasks.forResult(null));
243243
when(mockFileDownloadService.getExistingDownloadTask(0)).thenReturn(null);
244-
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUploaded)))
244+
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUpdateLoaded)))
245245
.thenReturn(secondDeviceModelFile);
246246

247247
TestOnCompleteListener<CustomModel> onCompleteListener = new TestOnCompleteListener<>();
@@ -255,7 +255,7 @@ public void getModel_latestModel_localExists_noUpdate_MissingDownloadId() throws
255255
verify(mockPrefs, times(1)).clearModelDetails(eq(MODEL_NAME));
256256
verify(mockFileManager, times(1)).deleteAllModels(eq(MODEL_NAME));
257257
assertThat(task.isComplete()).isTrue();
258-
assertEquals(customModel, customModelUploaded);
258+
assertEquals(customModel, customModelUpdateLoaded);
259259
}
260260

261261
@Test
@@ -265,7 +265,7 @@ public void getModel_latestModel_localExists_noUpdate_inProgress() throws Except
265265
when(mockPrefs.getCustomModelDetails(eq(MODEL_NAME)))
266266
.thenReturn(inProgressLocalModel) // getlocalModelDetails 1
267267
.thenReturn(inProgressLocalModel) // getCustomModelTask 1
268-
.thenReturn(customModelUploaded); // finishModelDownload
268+
.thenReturn(customModelUpdateLoaded); // finishModelDownload
269269
when(mockPrefs.getDownloadingCustomModelDetails(eq(MODEL_NAME)))
270270
.thenReturn(inProgressLocalModel); // getLocalModelDetails 2, finishModelDownload
271271

@@ -275,7 +275,7 @@ public void getModel_latestModel_localExists_noUpdate_inProgress() throws Except
275275
when(mockFileDownloadService.getExistingDownloadTask(88)).thenReturn(Tasks.forResult(null));
276276
when(mockFileDownloadService.download(any(), eq(DEFAULT_DOWNLOAD_CONDITIONS)))
277277
.thenReturn(Tasks.forResult(null));
278-
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUploaded)))
278+
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUpdateLoaded)))
279279
.thenReturn(secondDeviceModelFile);
280280

281281
TestOnCompleteListener<CustomModel> onCompleteListener = new TestOnCompleteListener<>();
@@ -290,7 +290,7 @@ public void getModel_latestModel_localExists_noUpdate_inProgress() throws Except
290290
verify(mockFileManager, never()).deleteAllModels(eq(MODEL_NAME));
291291
verify(mockFileDownloadService, times(1)).getExistingDownloadTask(eq(88L));
292292
assertThat(task.isComplete()).isTrue();
293-
assertEquals(customModel, customModelUploaded);
293+
assertEquals(customModel, customModelUpdateLoaded);
294294
}
295295

296296
@Test
@@ -317,14 +317,14 @@ public void getModel_latestModel_localExists_UpdateFound() throws Exception {
317317
when(mockPrefs.getCustomModelDetails(eq(MODEL_NAME)))
318318
.thenReturn(customModelLoaded)
319319
.thenReturn(customModelLoaded)
320-
.thenReturn(customModelUploaded);
320+
.thenReturn(customModelUpdateLoaded);
321321

322322
when(mockModelDownloadService.getCustomModelDetails(
323323
eq(TEST_PROJECT_ID), eq(MODEL_NAME), eq(MODEL_HASH)))
324324
.thenReturn(Tasks.forResult(UPDATE_CUSTOM_MODEL_URL));
325325
when(mockFileDownloadService.download(any(), eq(DEFAULT_DOWNLOAD_CONDITIONS)))
326326
.thenReturn(Tasks.forResult(null));
327-
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUploaded)))
327+
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUpdateLoaded)))
328328
.thenReturn(secondDeviceModelFile);
329329

330330
TestOnCompleteListener<CustomModel> onCompleteListener = new TestOnCompleteListener<>();
@@ -336,7 +336,7 @@ public void getModel_latestModel_localExists_UpdateFound() throws Exception {
336336

337337
verify(mockPrefs, times(4)).getCustomModelDetails(eq(MODEL_NAME));
338338
assertThat(task.isComplete()).isTrue();
339-
assertEquals(customModel, customModelUploaded);
339+
assertEquals(customModel, customModelUpdateLoaded);
340340
}
341341

342342
@Test
@@ -374,7 +374,7 @@ public void getModel_latestModel_noLocalModel() throws Exception {
374374
.thenReturn(Tasks.forResult(ORIG_CUSTOM_MODEL_URL));
375375
when(mockFileDownloadService.download(any(), eq(DEFAULT_DOWNLOAD_CONDITIONS)))
376376
.thenReturn(Tasks.forResult(null));
377-
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUploaded)))
377+
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUpdateLoaded)))
378378
.thenReturn(firstDeviceModelFile);
379379
TestOnCompleteListener<CustomModel> onCompleteListener = new TestOnCompleteListener<>();
380380
Task<CustomModel> task =
@@ -510,7 +510,7 @@ public void getModel_updateBackground_noLocalModel() throws Exception {
510510
.thenReturn(Tasks.forResult(ORIG_CUSTOM_MODEL_URL));
511511
when(mockFileDownloadService.download(any(), eq(DOWNLOAD_CONDITIONS)))
512512
.thenReturn(Tasks.forResult(null));
513-
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUploaded)))
513+
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUpdateLoaded)))
514514
.thenReturn(firstDeviceModelFile);
515515
TestOnCompleteListener<CustomModel> onCompleteListener = new TestOnCompleteListener<>();
516516
Task<CustomModel> task =
@@ -577,7 +577,7 @@ public void getModel_local_noLocalModel() throws Exception {
577577
.thenReturn(UPDATE_IN_PROGRESS_CUSTOM_MODEL); // getLocalModelDetails
578578
when(mockFileDownloadService.download(any(), eq(DOWNLOAD_CONDITIONS)))
579579
.thenReturn(Tasks.forResult(null));
580-
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUploaded)))
580+
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUpdateLoaded)))
581581
.thenReturn(firstDeviceModelFile);
582582
TestOnCompleteListener<CustomModel> onCompleteListener = new TestOnCompleteListener<>();
583583
Task<CustomModel> task =
@@ -601,7 +601,7 @@ public void getModel_local_noLocalModel_urlRetry() throws Exception {
601601
when(mockFileDownloadService.download(any(), eq(DOWNLOAD_CONDITIONS)))
602602
.thenReturn(Tasks.forException(new Exception("Retry: Expired URL")))
603603
.thenReturn(Tasks.forResult(null));
604-
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUploaded)))
604+
when(mockFileDownloadService.loadNewlyDownloadedModelFile(eq(customModelUpdateLoaded)))
605605
.thenReturn(firstDeviceModelFile);
606606
TestOnCompleteListener<CustomModel> onCompleteListener = new TestOnCompleteListener<>();
607607
Task<CustomModel> task =

firebase-ml-modeldownloader/src/test/java/com/google/firebase/ml/modeldownloader/internal/ModelFileDownloadServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ public void maybeCheckDownloadingComplete_downloadFailed() throws Exception {
596596

597597
@Test
598598
public void maybeCheckDownloadingComplete_secondDownloadFailed() throws Exception {
599-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_PREVIOUS_LOADED);
599+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_PREVIOUS_LOADED);
600600
sharedPreferencesUtil.setDownloadingCustomModelDetails(CUSTOM_MODEL_DOWNLOADING);
601601
assertNull(modelFileDownloadService.getDownloadingModelStatusCode(0L));
602602
matrixCursor.addRow(new Integer[] {DownloadManager.STATUS_FAILED});

firebase-ml-modeldownloader/src/test/java/com/google/firebase/ml/modeldownloader/internal/SharedPreferencesUtilTest.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,33 +73,33 @@ public void setDownloadingCustomModelDetails_initializeDownload()
7373
}
7474

7575
@Test
76-
public void setUploadedCustomModelDetails_localModelPresent() throws IllegalArgumentException {
77-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
76+
public void setLoadedCustomModelDetails_localModelPresent() throws IllegalArgumentException {
77+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
7878
CustomModel retrievedModel = sharedPreferencesUtil.getCustomModelDetails(MODEL_NAME);
7979
assertEquals(retrievedModel, CUSTOM_MODEL_DOWNLOAD_COMPLETE);
8080
}
8181

8282
@Test
83-
public void setUploadedCustomModelDetails_initialDownloadStartedAndCompleted()
83+
public void setLoadedCustomModelDetails_initialDownloadStartedAndCompleted()
8484
throws IllegalArgumentException {
8585
sharedPreferencesUtil.setDownloadingCustomModelDetails(CUSTOM_MODEL_DOWNLOADING);
86-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
86+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
8787
CustomModel retrievedModel = sharedPreferencesUtil.getCustomModelDetails(MODEL_NAME);
8888
assertEquals(retrievedModel, CUSTOM_MODEL_DOWNLOAD_COMPLETE);
8989
}
9090

9191
@Test
92-
public void setUploadedCustomModelDetails_localModelWithUploadInBackGround()
92+
public void setLoadedCustomModelDetails_localModelWithDownloadInBackGround()
9393
throws IllegalArgumentException {
94-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
94+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
9595
sharedPreferencesUtil.setDownloadingCustomModelDetails(CUSTOM_MODEL_DOWNLOADING);
9696
CustomModel retrievedModel = sharedPreferencesUtil.getCustomModelDetails(MODEL_NAME);
9797
assertEquals(retrievedModel, CUSTOM_MODEL_UPDATE_IN_BACKGROUND);
9898
}
9999

100100
@Test
101101
public void clearModelDetails_clearLocalAndDownloadingInfo() throws IllegalArgumentException {
102-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
102+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
103103
sharedPreferencesUtil.setDownloadingCustomModelDetails(CUSTOM_MODEL_DOWNLOADING);
104104
CustomModel retrievedModel = sharedPreferencesUtil.getCustomModelDetails(MODEL_NAME);
105105
assertEquals(retrievedModel, CUSTOM_MODEL_UPDATE_IN_BACKGROUND);
@@ -110,7 +110,7 @@ public void clearModelDetails_clearLocalAndDownloadingInfo() throws IllegalArgum
110110

111111
@Test
112112
public void clearDownloadingModelDetails_keepsLocalModel() throws IllegalArgumentException {
113-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
113+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
114114
sharedPreferencesUtil.setDownloadingCustomModelDetails(CUSTOM_MODEL_DOWNLOADING);
115115
CustomModel retrievedModel = sharedPreferencesUtil.getCustomModelDetails(MODEL_NAME);
116116
assertEquals(retrievedModel, CUSTOM_MODEL_UPDATE_IN_BACKGROUND);
@@ -123,7 +123,7 @@ public void clearDownloadingModelDetails_keepsLocalModel() throws IllegalArgumen
123123

124124
@Test
125125
public void clearDownloadCustomModelDetails_keepsLocalModel() throws IllegalArgumentException {
126-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
126+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
127127
sharedPreferencesUtil.setDownloadingCustomModelDetails(CUSTOM_MODEL_DOWNLOADING);
128128
CustomModel retrievedModel = sharedPreferencesUtil.getCustomModelDetails(MODEL_NAME);
129129
assertEquals(retrievedModel, CUSTOM_MODEL_UPDATE_IN_BACKGROUND);
@@ -134,7 +134,7 @@ public void clearDownloadCustomModelDetails_keepsLocalModel() throws IllegalArgu
134134

135135
@Test
136136
public void listDownloadedModels_localModelFound() {
137-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
137+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
138138
Set<CustomModel> retrievedModel = sharedPreferencesUtil.listDownloadedModels();
139139
assertEquals(retrievedModel.size(), 1);
140140
assertEquals(retrievedModel.iterator().next(), CUSTOM_MODEL_DOWNLOAD_COMPLETE);
@@ -153,16 +153,16 @@ public void listDownloadedModels_noModels() {
153153

154154
@Test
155155
public void listDownloadedModels_multipleModels() {
156-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
156+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
157157

158158
CustomModel model2 =
159159
new CustomModel(MODEL_NAME + "2", MODEL_HASH + "2", 102, 0, "file/path/store/ModelName2/1");
160-
sharedPreferencesUtil.setUploadedCustomModelDetails(model2);
160+
sharedPreferencesUtil.setLoadedCustomModelDetails(model2);
161161

162162
CustomModel model3 =
163163
new CustomModel(MODEL_NAME + "3", MODEL_HASH + "3", 103, 0, "file/path/store/ModelName3/1");
164164

165-
sharedPreferencesUtil.setUploadedCustomModelDetails(model3);
165+
sharedPreferencesUtil.setLoadedCustomModelDetails(model3);
166166

167167
Set<CustomModel> retrievedModel = sharedPreferencesUtil.listDownloadedModels();
168168
assertEquals(retrievedModel.size(), 3);
@@ -197,7 +197,7 @@ public void setModelDownloadBeginTimeMs_updates() {
197197

198198
// Completing the download clears the begin time.
199199
SystemClock.setCurrentTimeMillis(200L);
200-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
200+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
201201
assertEquals(sharedPreferencesUtil.getModelDownloadBeginTimeMs(CUSTOM_MODEL_DOWNLOADING), 0L);
202202
}
203203

@@ -220,7 +220,7 @@ public void setModelDownloadCompleteTimeMs_updates() {
220220

221221
// Completing the download clears the begin time.
222222
SystemClock.setCurrentTimeMillis(300L);
223-
sharedPreferencesUtil.setUploadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
223+
sharedPreferencesUtil.setLoadedCustomModelDetails(CUSTOM_MODEL_DOWNLOAD_COMPLETE);
224224
assertEquals(
225225
sharedPreferencesUtil.getModelDownloadCompleteTimeMs(CUSTOM_MODEL_DOWNLOADING), 0L);
226226
}

0 commit comments

Comments
 (0)