tech:2617: localstate from sharedpref to pref DataStore
Description
AdvancedPrivacy use sharedpreferences to store various settings of the apps, like which feature is activated, what is the fakelocation location, ...
Android provides the Preferences Datastore component to upgrade the SharedPreferences component and fix some bad sides. Main improvements are better thread handling, and better synchronization handling.
We also use SharedPreferences for trackers whitelist, and it is used in OrbotService, but these would not be the subject of this issue.
Issues
https://gitlab.e.foundation/e/os/backlog/-/issues/2617
10 commandments of code reviews
Summary by CodeRabbit
Release Notes
-
New Features
- Introduced support for AndroidX DataStore Preferences for improved key-value storage.
- Added utility functions for managing preferences in DataStore.
- Enhanced coroutine support for asynchronous operations in various components.
-
Bug Fixes
- Improved performance and responsiveness through better asynchronous handling.
-
Documentation
- Updated copyright notices to reflect the years 2022-2024.
-
Chores
- Updated method signatures across multiple classes to support asynchronous operations.