sync: smoother shared preference manager clearing (fixes #13008)#12877
Conversation
Moves the logic for clearing SharedPreferences while preserving the FIRST_LAUNCH and MANUAL_CONFIG keys out of SyncActivity's companion object and into a new `clearPreferences()` instance method on `SharedPrefManager`. Call sites in SettingsActivity and SyncActivity have been updated to call this new method on their injected SharedPrefManager instances. Extraneous Dagger EntryPoint imports were removed. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Okuro3499
left a comment
There was a problem hiding this comment.
SharedPrefManager.kt:13 — change val context: Context back to private val context: Context. There's no reason to expose it publicly.
Modifies the `SharedPrefManager` constructor to use `private val context` instead of `val context` so that the `Context` is not publicly exposed by the manager instance. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: dogi <13684059+dogi@users.noreply.github.com>
Updated in commit 5d3062d:
Resolved by merging Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR moves the SharedPreferences clearing logic from
SyncActivity's companion object intoSharedPrefManager. This eliminates the need for manual dependency injection viaEntryPointAccessorswhen clearing data and properly encapsulates preference lifecycle management.Changes:
clearPreferences()toSharedPrefManagerand injectedApplicationContextas a class property for accessingPreferenceManager.SettingsActivityandSyncActivitywith the injectedSharedPrefManagerinstance.companion object.PR created automatically by Jules for task 16783400589895170730 started by @dogi