File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
firebase-common/src/main/java/com/google/firebase/datastore Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import androidx.datastore.preferences.core.MutablePreferences
2323import androidx.datastore.preferences.core.Preferences
2424import androidx.datastore.preferences.core.edit
2525import androidx.datastore.preferences.preferencesDataStore
26+ import com.google.firebase.annotations.concurrent.Background
2627import kotlinx.coroutines.flow.firstOrNull
2728import kotlinx.coroutines.runBlocking
2829
@@ -33,6 +34,10 @@ import kotlinx.coroutines.runBlocking
3334 *
3435 * There should only ever be _one_ instance of this class per context and name variant.
3536 *
37+ * Note that most of the methods in this class **block** on the _current_ thread, as to help keep
38+ * parity with existing Java code. Typically, you'd want to dispatch this work to another thread
39+ * like [@Background][Background].
40+ *
3641 * > Do **NOT** use this _unless_ you're bridging Java code. If you're writing new code, or your
3742 * code is in Kotlin, then you should create your own singleton that uses [DataStore] directly.
3843 *
@@ -43,6 +48,8 @@ import kotlinx.coroutines.runBlocking
4348 *
4449 * @property context The [Context] that this data will be saved under.
4550 * @property name What the storage file should be named.
51+ *
52+ * @hide
4653 */
4754class DataStorage (val context : Context , val name : String ) {
4855 /* *
Original file line number Diff line number Diff line change 1+ // Copyright 2023 Google LLC
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ /** @hide */
16+ package com .google .firebase .datastore ;
You can’t perform that action at this time.
0 commit comments