[General Topics] stealz0r:
TL;DR: Go down to summary to just grab the idea

I've been working a lot on optimizing my battery life, and I've become more aware about security concerns regarding Permissions, and I came up with an Idea that would make all of this a lot easier, even for unexperienced users.

Instead of giving apps general permission for wakelock, positionning or connectivity, there should be groups for these permissions. Let me explain with an example:

Say there is a permission group called "Instant Messenger connectivity" for apps like skype, facebook messanger, ICQ and such. you are able to set the update intervall for this group, there are 2 settings: phone in deep sleep and phone awake. The default deep sleep intervall would be like 1 or 2 minutes, the awake setting would be constant. Now every time the intervall runs through, the phone calls a hook that allows all apps in the group to check for new messages. If you want to optimize your battery life or bandwith useage and dont need to instantly know who is sending you a message you set the update intervall to, say 5 or even 15 minutes.

"E-Mail" group would be set to 15 minutes or an hour or 5 hours, whenever you want your not so urgent messages to be delivered. Or set it to "screen activated" so emails get checked when you actually look at your device.

"Updates" group would be allowed to check once a day.

Similar grouping would be done for GPS: One group would be "Navigation software" that would be constantly allowed to track your position, another group could be called "Check-Ins" or "Geographic postings" or something, those apps would only be allowed GPS access after a prompt. Permission through the promt lasts for 5 minutes or so during which the app can get your position, even several times if needed.

This way your navigation software works flawlessly, and you would be able to tag your photos or add locations to your posts or use check-ins but apps couldnt track or log your positions without you knowing it.

Similar thing for waking the phone: "alarms" group is able to wake your phone at any time to ring the alarm. "Maintainance" group would be triggered once every three hours or so.

Timing options would be something like: Always, every X seconds/minutes/hours, while screen is on.

The permission intervall should have a limited duration, which expires either after all the hooks are completed or after a fixed amount of time, stopping apps from gaining GPS permission to tag a post and afterwards keeping the permission to log your movement patterns, or keeping the internet connection alive while trying to get an info from a server that is not currently online or reachable.

Advantages

This would lead to a centralized settings, where you can - if you choose to - set how often you want updates or permissions granted for each group.

Instead of each app waking up the phone individually for their task, all the apps would get a signal to update at the same time, getting the best use out of the time the phone is not on deep sleep.

Permissions would be more transparent to unexperienced users, and it would be either very obvious if apps want permissions they shouldnt have, or they dont get tempted to go overboard with the use of the permissions they are granted.

Summary

- Apps are given permissions in matching groups allowing them permission to use the functions as the user sees fit

- Permissions work as hooks: Instead of letting the app decide when to trigger a certain event, i.e. connect to the internet or wake the phone, the phone decides when the permission should be activated and sends a command to the app which in return then does what it needs to do with the permission (check for messages, get your location etc.)

Disclaimer

This is more of a general demonstration of a principle, my coding knowledge or knowledge of procedures in android is not enough to describe the actual implementation.

I am also not sure at which level this would have to be implemented, i.e. if it could be done within a custom rom or it had to be implemented in the android kernel. I am well aware that it would probably require some recoding from the app developers, and this is not a simple tweak but a pretty big overhaul of the way android works. I just wanted to get the idea out there, just to get you guys thinking or giving you adifferent perspective on things.

Tell me what you think.