-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop caching preferences instance (#20445)
It appears that reusing the shared preferences instance sometimes causes changes to not be properly committed to disk as the instance is not disposed in some cases before the app is torn down (eg: force close). Caching isn't really necessary here anyways as the underlying android preference manager does its own layer of caching (so we are just paying the interop tax to get a 'new' instance here). The simplest fix is to stop caching which is the real content of this change. We don't cache in the regular preferences API where we use shared preferences and the issue does not seem to exist there.
- Loading branch information
Showing
1 changed file
with
17 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Redth I think this change here is related to #18230
On dotnet8 doing an uninstall/reinstall causes GetEncryptedSharedPreferences() to throw but then you can't remove the keys anymore because PlatformRemove now calls GetEncryptedSharedPreferences. So we're kind of stuck with a bad secure storage implementation with no workaround.