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

Commit ef640cdf authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Don't allow -1 uids for wake locks.

Change-Id: Ia1b412a166f69247be3b047138349e7b4031bd7d
parent 93160828
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -574,6 +574,7 @@ public final class BatteryStatsImpl extends BatteryStats {
            mUptime = in.readLong();
            mPastUptime = in.readLong();
            mUptimeStart = in.readLong();
            mRealtime = in.readLong();
            mPastRealtime = in.readLong();
            mRealtimeStart = in.readLong();
            mUnpluggedUptime = in.readLong();
@@ -586,6 +587,7 @@ public final class BatteryStatsImpl extends BatteryStats {
            out.writeLong(mUptime);
            out.writeLong(runningUptime);
            out.writeLong(mUptimeStart);
            out.writeLong(mRealtime);
            out.writeLong(runningRealtime);
            out.writeLong(mRealtimeStart);
            out.writeLong(mUnpluggedUptime);
+3 −0
Original line number Diff line number Diff line
@@ -2541,6 +2541,9 @@ public final class PowerManagerService extends com.android.server.SystemService
        @Override // Binder call
        public void acquireWakeLockWithUid(IBinder lock, int flags, String tag,
                String packageName, int uid) {
            if (uid < 0) {
                uid = Binder.getCallingUid();
            }
            acquireWakeLock(lock, flags, tag, packageName, new WorkSource(uid), null);
        }