源码位置:
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