-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
strict mode violation exception prevention #89
base: main
Are you sure you want to change the base?
Conversation
@skydoves would you be able to check my PR, please? (as it's on 'awaiting approval') |
Hi @yanioaioan, thanks for contributing to this PR. |
Hi @skydoves, thanks for your response. I suppose shared prefs could potentially be accessesed on the background thread, however I am not sure is necessary to be fair. This change should temporarily be allowing disk access anyway and sort that issue anyway. |
Hi @skydoves , actually even my suggestion is not really solving the original problem which is touching the disk in the first place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skydoves , please check the change suggested. Basically moved sharedPrefs creation out of the MenuPreferenceManager construction. This way, there wouldn't be any disk access violations (by simply initializing the lib), but onlt if the getPosition, setPosition or clearPosition were actually used.
Please complete the following information:
Library Version 2.2.0
Android 11.0
Describe the Bug:
Using the CustomPowerMenu.Builder and having Strict mode enabled in our Android app we get StrictMode policy violation; ~duration=453 ms: android.os.strictmode.DiskReadViolation exception when trying to inflate our view
Expected Behavior:
Is it possible to provide a way of using for the CustomPowerMenu.Builder which uses AbstractPowerMenu which uses MenuPreferenceManager but NOT read or write to sharedPrefs from within MenuPreferenceManager as it currently stands, so as to avoid the StrictMode policy violation; ~duration=453 ms: android.os.strictmode.DiskReadViolation