Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbecd4db authored by mattgilbride's avatar mattgilbride Committed by Matt Gilbride
Browse files

ProcessStatsService - call PermissionEnforcer helper on methods annotated with @EnforcePermission

Migrates all existing java methods annotated with @EnforcePermission
such that they call the super.<methodName>_enforcePermission
method provided by PermissionEnforcer.

This required by the @EnforcePermission annotation, but is currently a no-op, and will be switched on with ag/20325484.

Bug: 234083358
Test: TH
Change-Id: Id8aec2a997444a2efc3b8ea7451c4d07819b5cde
parent 66257b83
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -567,6 +567,8 @@ public final class ProcessStatsService extends IProcessStats.Stub {
    @android.annotation.EnforcePermission(android.Manifest.permission.PACKAGE_USAGE_STATS)
    @Override
    public byte[] getCurrentStats(List<ParcelFileDescriptor> historic) {
        super.getCurrentStats_enforcePermission();

        Parcel current = Parcel.obtain();
        synchronized (mLock) {
            long now = SystemClock.uptimeMillis();
@@ -623,6 +625,8 @@ public final class ProcessStatsService extends IProcessStats.Stub {
    public long getCommittedStatsMerged(long highWaterMarkMs, int section, boolean doAggregate,
            List<ParcelFileDescriptor> committedStats, ProcessStats mergedStats) {

        super.getCommittedStatsMerged_enforcePermission();

        long newHighWaterMark = highWaterMarkMs;
        mFileLock.lock();
        try {
@@ -709,6 +713,8 @@ public final class ProcessStatsService extends IProcessStats.Stub {
    @android.annotation.EnforcePermission(android.Manifest.permission.PACKAGE_USAGE_STATS)
    @Override
    public ParcelFileDescriptor getStatsOverTime(long minTime) {
        super.getStatsOverTime_enforcePermission();

        Parcel current = Parcel.obtain();
        long curTime;
        synchronized (mLock) {