List of usage examples for android.app AppOpsManager OPSTR_SYSTEM_ALERT_WINDOW
String OPSTR_SYSTEM_ALERT_WINDOW
To view the source code for android.app AppOpsManager OPSTR_SYSTEM_ALERT_WINDOW.
Click Source Link
From source file:Main.java
@SuppressWarnings("IncompatibleBitwiseMaskOperation") public static boolean isFloatWindowOpAllowed(Context context) { if (Build.VERSION.SDK_INT >= 19) { // 19, 4.4, KITKAT final AppOpsManager manager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); final int mode = manager.checkOp(AppOpsManager.OPSTR_SYSTEM_ALERT_WINDOW, Binder.getCallingUid(), context.getPackageName()); return AppOpsManager.MODE_ALLOWED == mode; } else {// w w w . j a va2 s . c om return (context.getApplicationInfo().flags & 1 << 27) == 1; } }