Hello,
I have a project over kitkat that needs to stay connected to an usb accessory.
It's not an app for user-end devices, so we don't want the system.ui popup asking for the permission to connect to it. Also, sometimes after a restart or app update, a new intent connection never reaches the app, so I eventually lose the connection to the accessory.
My goal is to hard-set the permission in order to always receive the intent and get to be always connected.
In order to do that, I'm investigating the android source code, but I guess that the scope is to big, so I was wondering if someone could give me some leads.
1) How does Android knows that an app have being allowed to connect to an accessory?
I know that there's an xml file that stores this permission on android system, but even if I replace this xml file with a new one, it seems that the android system sort of ignores the file. So I am guessing it has a different way to store this. Also, it would be of great help if there's anyone that could point me the project and classes that handle this so I can investigate it more closely.
2) Would be there another reasons (besides permission) that would end up on the system not sending the usb_accessory intents to the app?
kind regards,
José