首页 > 编程知识 正文

小米开启应用上层显示权限,小米手机弹出界面权限在哪?

时间:2023-05-06 05:48:52 阅读:230036 作者:3003

private boolean canBackgroundStart(Context context) { AppOpsManager ops = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); try { int op = 10021; // >= 23 // ops.checkOpNoThrow(op, uid, packageName) Method method = ops.getClass().getMethod("checkOpNoThrow", new Class[] {int.class, int.class, String.class} ); Integer result = (Integer) method.invoke(ops, op, android.os.Process.myUid(), context.getPackageName()); return result == AppOpsManager.MODE_ALLOWED; } catch (Exception e) { e.printStackTrace(); } return false;}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。