Skip to content

Commit 6091f82

Browse files
committed
Address comments #1
1 parent 1adcfbd commit 6091f82

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

firebase-segmentation/src/main/java/com/google/firebase/segmentation/FirebaseSegmentation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public static FirebaseSegmentation getInstance(@NonNull FirebaseApp app) {
7979
return app.get(FirebaseSegmentation.class);
8080
}
8181

82-
Task<Void> setCustomInstallationId(@Nullable String customInstallationId) {
82+
@NonNull
83+
public synchronized Task<Void> setCustomInstallationId(@Nullable String customInstallationId) {
8384
if (customInstallationId == null) {
8485
return clearCustomInstallationId();
8586
}

firebase-segmentation/src/main/java/com/google/firebase/segmentation/local/CustomInstallationIdCache.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,7 @@ private String getSharedPreferencesKey(String key) {
101101

102102
private Task<Boolean> commitSharedPreferencesEditAsync(SharedPreferences.Editor editor) {
103103
TaskCompletionSource<Boolean> result = new TaskCompletionSource<>();
104-
ioExecuter.execute(
105-
new Runnable() {
106-
@Override
107-
public void run() {
108-
result.setResult(editor.commit());
109-
}
110-
});
104+
ioExecuter.execute(() -> result.setResult(editor.commit()));
111105
return result.getTask();
112106
}
113107
}

0 commit comments

Comments
 (0)