Last active
December 21, 2016 23:13
-
-
Save quiro91/e0a524ca07d1453af2542f9f3478f48b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean checkForPermission(Context context) { | |
AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); | |
int mode = appOps.checkOpNoThrow(OPSTR_GET_USAGE_STATS, Process.myUid(), context.getPackageName()); | |
return mode == MODE_ALLOWED; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment