It seems that apps, or maybe it's just my app, that have the following required permissions:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
tend to occasionally crash the UI when for example you're running the app and then you decide to switch from Charge Only to Disk Drive. The other thing is that the app becomes unavailable to the user when the user is on Disk Drive mode. You get the message : "The Linked program is no longer installed on your phone".
Is there a way to mitigate this issue, programmatically. Maybe, by checking when the user is on Disk Drive mode which should trigger the removal of the permissions or something similar. Is this possible?