Fixed
Status Update
Comments
pr...@gmail.com <pr...@gmail.com> #2
When I migrate Normal shared preference (without encryption) to data store . It is successfully migrating to data store . After migration if we check data in shared preference ,we will find no data and in data store ,there will be data .
But if we try to migrate encrypted shared preference to data store , we will find no data in shared preference as well as no data in data store .
How can we migrate encrypted shared preference to data store ? Is there any way to do that . I didn't find any method for that. Please help.
But if we try to migrate encrypted shared preference to data store , we will find no data in shared preference as well as no data in data store .
How can we migrate encrypted shared preference to data store ? Is there any way to do that . I didn't find any method for that. Please help.
ro...@google.com <ro...@google.com> #3
SharedPreferencesMigration doesn't support this yet. You can implement a DataMigration yourself and migrate from EncryptedSharedPreferences with it right now. I'll mark this as a feature request to support EncryptedSharedPreferences in SharedPreferencesMigration.
pr...@gmail.com <pr...@gmail.com> #4
Hi,
when can we get this feature to support EncryptedSharedPreferences in SharedPreferencesMigration?
Also , i am using flatmap/map (rxJava) , so calling suspend function inside flatMap is not directly possible. So do i need to convert all Rx things to coroutine to go with this? Do you have any docs for this?
when can we get this feature to support EncryptedSharedPreferences in SharedPreferencesMigration?
Also , i am using flatmap/map (rxJava) , so calling suspend function inside flatMap is not directly possible. So do i need to convert all Rx things to coroutine to go with this? Do you have any docs for this?
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit bd56cad31f8a28f08d85caf010ea082c8c8fbf88
Author: rohitsat13 <rohitsat@google.com>
Date: Mon Feb 08 15:05:52 2021
Add SharedPreferencesMigration variant that allows you to inject a SharedPreferences instance and remove the deleteEmptyPreferences option.
Test: SharedPreferencesMigrationTest
Bug: 177278510
Relnote: If you want to migrate EncryptedSharedPreferences (or direct boot SharedPreferences) to DataStore you can now do that with the new SharedPreferencesMigration constructor that allows you to inject the SharedPreferences.
Change-Id: I8e04e9f3c62d41ba6bfeffe3e5978be4790b3661
M datastore/datastore-preferences/api/current.txt
M datastore/datastore-preferences/api/public_plus_experimental_current.txt
M datastore/datastore-preferences/api/restricted_current.txt
M datastore/datastore-preferences/src/androidTest/java/androidx/datastore/preferences/SharedPreferencesToPreferencesTest.kt
M datastore/datastore-preferences/src/main/java/androidx/datastore/preferences/SharedPreferencesMigration.kt
M datastore/datastore-rxjava2/api/current.txt
M datastore/datastore-rxjava2/api/public_plus_experimental_current.txt
M datastore/datastore-rxjava2/api/restricted_current.txt
M datastore/datastore-rxjava2/src/androidTest/java/androidx/datastore/rxjava2/RxSharedPreferencesMigrationTest.java
M datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxSharedPreferencesMigration.kt
M datastore/datastore-rxjava3/api/current.txt
M datastore/datastore-rxjava3/api/public_plus_experimental_current.txt
M datastore/datastore-rxjava3/api/restricted_current.txt
M datastore/datastore-rxjava3/src/androidTest/java/androidx/datastore/rxjava3/RxSharedPreferencesMigrationTest.java
M datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxSharedPreferencesMigration.kt
M datastore/datastore/api/current.txt
M datastore/datastore/api/public_plus_experimental_current.txt
M datastore/datastore/api/restricted_current.txt
M datastore/datastore/src/androidTest/java/androidx/datastore/migrations/SharedPreferencesMigrationTest.kt
M datastore/datastore/src/main/java/androidx/datastore/migrations/SharedPreferencesMigration.kt
https://android-review.googlesource.com/1580977
Branch: androidx-main
commit bd56cad31f8a28f08d85caf010ea082c8c8fbf88
Author: rohitsat13 <rohitsat@google.com>
Date: Mon Feb 08 15:05:52 2021
Add SharedPreferencesMigration variant that allows you to inject a SharedPreferences instance and remove the deleteEmptyPreferences option.
Test: SharedPreferencesMigrationTest
Bug: 177278510
Relnote: If you want to migrate EncryptedSharedPreferences (or direct boot SharedPreferences) to DataStore you can now do that with the new SharedPreferencesMigration constructor that allows you to inject the SharedPreferences.
Change-Id: I8e04e9f3c62d41ba6bfeffe3e5978be4790b3661
M datastore/datastore-preferences/api/current.txt
M datastore/datastore-preferences/api/public_plus_experimental_current.txt
M datastore/datastore-preferences/api/restricted_current.txt
M datastore/datastore-preferences/src/androidTest/java/androidx/datastore/preferences/SharedPreferencesToPreferencesTest.kt
M datastore/datastore-preferences/src/main/java/androidx/datastore/preferences/SharedPreferencesMigration.kt
M datastore/datastore-rxjava2/api/current.txt
M datastore/datastore-rxjava2/api/public_plus_experimental_current.txt
M datastore/datastore-rxjava2/api/restricted_current.txt
M datastore/datastore-rxjava2/src/androidTest/java/androidx/datastore/rxjava2/RxSharedPreferencesMigrationTest.java
M datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxSharedPreferencesMigration.kt
M datastore/datastore-rxjava3/api/current.txt
M datastore/datastore-rxjava3/api/public_plus_experimental_current.txt
M datastore/datastore-rxjava3/api/restricted_current.txt
M datastore/datastore-rxjava3/src/androidTest/java/androidx/datastore/rxjava3/RxSharedPreferencesMigrationTest.java
M datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxSharedPreferencesMigration.kt
M datastore/datastore/api/current.txt
M datastore/datastore/api/public_plus_experimental_current.txt
M datastore/datastore/api/restricted_current.txt
M datastore/datastore/src/androidTest/java/androidx/datastore/migrations/SharedPreferencesMigrationTest.kt
M datastore/datastore/src/main/java/androidx/datastore/migrations/SharedPreferencesMigration.kt
ro...@google.com <ro...@google.com> #6
EncryptedSharedPreferences can be migrated with the next release.
ru...@gmail.com <ru...@gmail.com> #7
Will it still be encrypted post-migration? I assume no, since
ro...@google.com <ro...@google.com> #8
No - this will allow you to migrate from Encrypted shared prefs to a regular DataStore. Once we have out of the box support for encryption you'll be able to migrate to that.
Description
DataStore Version used:
Devices/Android versions reproduced on:
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).