Android Lollipop know if app as Usage Stats access
问题 Since Android Lollipop, we have now an API for accessing apps usage stats. However, your app must be granted those permissions by the user. I know that for redirecting the user to those settings using Settings.ACTION_USAGE_ACCESS_SETTINGS. Now, my question is how do you know the user has granted you those permissions so that you can stop redirecting him to the settings. Thanks! 回答1: you can simply query usagestats with daily interval and end time the current time and if nothing is returned