I am having an issue granting WRITE_EXTERNAL_STORAGE
runtime permission in the app. On accepting the permission app is restarting, this I figured out is because of our custom firmware.
What I like to know is that, can we call ADB command for granting permission from the app. I've tried calling like this
final String STORAGE_PERMISSION_COMMAND = "sh -c adb -d shell pm grant com.example.easypermission.easypermissionsample android.permission.WRITE_EXTERNAL_STORAGE";
try {
Runtime.getRuntime().exec(STORAGE_PERMISSION_COMMAND,null,null);
} catch (IOException e) {
e.printStackTrace();
}
But nothing is happening. Can someone tell me whether this can be done, if so how?