最近我注意到,在使用 Jetpack Datastore 的新项目中,我在应用程序包中添加了一个新的本机库:
bundle.abb\base\lib\arm64-v8a\libdatastore_shared_counter.so
那到底是什么?
是的,我以前没有:
androidxDataStore = "1.0.0"
但更新后得到了:
androidxDataStore = "1.1.0"
这似乎与:
androidx/datastore/multiprocess/SharedCounter.kt
有关,它可能提供后端访问控制。参见包androidx.datastore.multiprocess
,例如DataStoreImpl<T>
:
/**
* If downstream flow is UnInitialized, no data has been read yet, we need to trigger a new
* read then start emitting values once we have seen a new value (or exception).
*
* If downstream flow has a ReadException, there was an exception last time we tried to read
* data. We need to trigger a new read then start emitting values once we have seen a new
* value (or exception).
*
* If downstream flow has Data, we should start emitting from downstream flow as long as its
* version is not stale compared to the version read from the shared counter when we enter
* the flow.
*
* If Downstream flow is Final, the scope has been cancelled so the data store is no
* longer usable. We should just propagate this exception.
*
* State always starts at null. null can transition to ReadException, Data or
* Final. ReadException can transition to another ReadException, Data or Final.
* Data can transition to another Data or Final. Final will not change.
*/