android appos 笔记

来源:互联网 发布:js验证数字和小数点 编辑:程序博客网 时间:2024/06/05 21:18

源码位置:

frameworks/base/services/java/com/android/server/AppOpsService.java

frameworks/base/core/java/android/app/AppOpsManager.{aidl,java}

frameworks/base/core/java/com/android/internal/app/IAppOps{Service,Callback}.aidl

是否打开服务:

修改系统属性:persist.sys.strict_op_enable

开启应用权限管理:true

关闭应用权限管理:false


public AppOpsService(File storagePath)

 {  

    mStrictEnable = "true".equals(SystemProperties.get(STRICT_PERMISSION_PROPERTY)); 

 }  

check if strict

private boolean isStrict(int code, int uid, String packageName) {     

 if (!mStrictEnable)         

 return false;       

return ((uid > Process.FIRST_APPLICATION_UID) &&              (AppOpsManager.opStrict(code)) && !isInWhitelist(packageName)); 

 }  


private static boolean[] sOpStrict =new boolean[]{

true, //OP_COARSE_LOCATION

true,//OP_FINE_LOCATION

true,//OP_GPS

...

true,//OP_READ_SMS

};


不过目前测试好像上面的几个都没生效

菜单在

package/apps/settings/res/xml/security_settings_misc.xml


0 0
原创粉丝点击