Reputation: 25
For example I want the user to be able to grant and deny access based on time/date/. To be able to specify the period e.g. 2 hours.
Other restriction that the user can use is: e.g. If I'm on 3G, this X application should not be able to access my location.
If I'm on a Wi-Fi called work. This why application is able to access my location.
Any help would be appreciated.
Upvotes: 0
Views: 1417
Reputation: 1986
Application permission can not be modified at runtime and must be declared in the android.manifest.The only thing you could do is,put all your permissions in the manifest file nonetheless like:
<uses-permission android:name="ACCESS_COARSE_LOCATION" />
<uses-permission android:name="ACCESS_FINE_LOCATION" />
and then simply deciding by code when and how a user can access location.Maybe showing him an alert dialog?
If the application you want to restrict is not yours,then i think there is not much you can do.
Upvotes: 1
Reputation: 1877
As I see it, there are two posibillities: If the "controlling app" and the "controlled app" are yours, just let them share a config file/database on the sd card and enable/disable geolocation according to settings there.
If the "controlled app" is not yours, there seems to be a way to control other apps persmissions on a rooted device according to this blog post. They only link to apps that can do this and not to a programming guide, but this may be a good starting point for further research.
Upvotes: 0