Loading apex/statsd/service/java/com/android/server/stats/StatsCompanionService.java +14 −0 Original line number Diff line number Diff line Loading @@ -2183,6 +2183,20 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { e.writeLong(op.getBackgroundRejectCount(OP_FLAGS_ALL_TRUSTED)); e.writeLong(op.getForegroundAccessDuration(OP_FLAGS_ALL_TRUSTED)); e.writeLong(op.getBackgroundAccessDuration(OP_FLAGS_ALL_TRUSTED)); String perm = AppOpsManager.opToPermission(op.getOpCode()); if (perm == null) { e.writeBoolean(false); } else { PermissionInfo permInfo; try { permInfo = mContext.getPackageManager().getPermissionInfo(perm, 0); e.writeBoolean(permInfo.getProtection() == PROTECTION_DANGEROUS); } catch (PackageManager.NameNotFoundException exception) { e.writeBoolean(false); } } pulledData.add(e); } } Loading cmds/statsd/src/atoms.proto +3 −0 Original line number Diff line number Diff line Loading @@ -6717,6 +6717,9 @@ message AppOps { // For long-running operations, total duration of the operation // while the app was in the background (only for trusted requests) optional int64 trusted_background_duration_millis = 9; // Whether AppOps is guarded by Runtime permission optional bool is_runtime_permission = 10; } /** Loading Loading
apex/statsd/service/java/com/android/server/stats/StatsCompanionService.java +14 −0 Original line number Diff line number Diff line Loading @@ -2183,6 +2183,20 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { e.writeLong(op.getBackgroundRejectCount(OP_FLAGS_ALL_TRUSTED)); e.writeLong(op.getForegroundAccessDuration(OP_FLAGS_ALL_TRUSTED)); e.writeLong(op.getBackgroundAccessDuration(OP_FLAGS_ALL_TRUSTED)); String perm = AppOpsManager.opToPermission(op.getOpCode()); if (perm == null) { e.writeBoolean(false); } else { PermissionInfo permInfo; try { permInfo = mContext.getPackageManager().getPermissionInfo(perm, 0); e.writeBoolean(permInfo.getProtection() == PROTECTION_DANGEROUS); } catch (PackageManager.NameNotFoundException exception) { e.writeBoolean(false); } } pulledData.add(e); } } Loading
cmds/statsd/src/atoms.proto +3 −0 Original line number Diff line number Diff line Loading @@ -6717,6 +6717,9 @@ message AppOps { // For long-running operations, total duration of the operation // while the app was in the background (only for trusted requests) optional int64 trusted_background_duration_millis = 9; // Whether AppOps is guarded by Runtime permission optional bool is_runtime_permission = 10; } /** Loading