From a reddit comment: > The permissions you see on the install screen are actually triggered by various permissions in the permission group. I've checked Ubers (there's a button on the web play store and you can see it in the manifest), and the only one from the Device and App History group they actually use is "GET_TASKS", or get a list of recently opened apps. > Furthermore, on Lollipop this permission doesn't eve…
Either that's not entirely truthful, or the app permission system is totally broken... Need to find out when you last opened the app? "Get running apps"...?
IIRC, I needed to identify a couple of states :
- when the user is on the lockscreen.
- when the user is in another app.
- when the user is in our app.
- when the screen is off.
There were business reason behind this for a complex feature, nothing to do with the user's data.
The Android team does not want android devs to access to their own app UI state because 'the business logic should not have to depend on that' ...
Fair enough in theory but in practice there are a couple of times when you just need it.
For example even the Chromecast sample uses a ugly hack to access this piece of information (put a timer behind start/stop activity events).
I remember that a coworker had to revamp this piece of code recently for Marshmallow but I don't remember the details.
Google finally has a working permission model with Marshmallow : protect the private data behind popups, everything else is fair game.
It is not perfect by any means since users still tend to click yes on any popup ... but that's the best we can do IMO.