Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOB-9235] ANR Prevention by migrating data from encrypted to shared prefs and discontinue use of encrypted shared prefs #849

Merged
merged 46 commits into from
Dec 30, 2024

Conversation

sumeruchat
Copy link
Contributor

@sumeruchat sumeruchat commented Dec 18, 2024

… shared prefs

🔹 Jira Ticket(s) if any

✏️ Description

To prevent ANRs we are migrating data from encrypted to shared prefs and discontinue use of encrypted shared prefs

@sumeruchat
Copy link
Contributor Author

sumeruchat commented Dec 18, 2024

Screenshot 2024-12-18 at 18 09 28

@evantk91 evantk91 self-requested a review December 23, 2024 17:15
@evantk91 evantk91 assigned evantk91 and sumeruchat and unassigned evantk91 and sumeruchat Dec 23, 2024
@sumeruchat sumeruchat force-pushed the feature/MOB-9235-ANR-EncryptedSharedPrefs branch from 3412df8 to c292958 Compare December 25, 2024 23:48
Copy link
Contributor

@evantk91 evantk91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some clarifying comments.

// Only attempt migration on Android M and above
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
markMigrationCompleted()
migrationCompletionCallback?.invoke(null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we do for android versions less than M? Is migration off of encrypted shared preference not required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we did not try to have encrypted shared preferences on our older keychain in versions less than M we dont need to migrate either

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it is a good point if we should migrate from normal shared preferences in those versions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added support for this now

}

@Test
public void testSkipIfBelowAndroidM() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@sumeruchat sumeruchat merged commit 067c2f3 into master Dec 30, 2024
3 of 4 checks passed
@sumeruchat sumeruchat deleted the feature/MOB-9235-ANR-EncryptedSharedPrefs branch December 30, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants