Open yanioaioan opened 2 years ago
@skydoves would you be able to check my PR, please? (as it's on 'awaiting approval')
Hi @yanioaioan, thanks for contributing to this PR.
I'm just wondering if reading and writing to SharedPreferences
must be run on a worker thread over Android 11. Or does only PowerMenu affects the exception? Thank you!
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. With my suggestion we would only allow it temporarily to avoid showing the disk access violation error but the point is more lie whther we can avoid touching the disk all together, so that when we initialize the library we save one unnecessary disk access?
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