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

Commit d21310ae authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am 5d5902d1: Merge "Don\'t allow -1 uids for wake locks."

* commit '5d5902d1':
  Don't allow -1 uids for wake locks.
parents a6066bb7 5d5902d1
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -574,6 +574,7 @@ public final class BatteryStatsImpl extends BatteryStats {
            mUptime = in.readLong();
            mUptime = in.readLong();
            mPastUptime = in.readLong();
            mPastUptime = in.readLong();
            mUptimeStart = in.readLong();
            mUptimeStart = in.readLong();
            mRealtime = in.readLong();
            mPastRealtime = in.readLong();
            mPastRealtime = in.readLong();
            mRealtimeStart = in.readLong();
            mRealtimeStart = in.readLong();
            mUnpluggedUptime = in.readLong();
            mUnpluggedUptime = in.readLong();
@@ -586,6 +587,7 @@ public final class BatteryStatsImpl extends BatteryStats {
            out.writeLong(mUptime);
            out.writeLong(mUptime);
            out.writeLong(runningUptime);
            out.writeLong(runningUptime);
            out.writeLong(mUptimeStart);
            out.writeLong(mUptimeStart);
            out.writeLong(mRealtime);
            out.writeLong(runningRealtime);
            out.writeLong(runningRealtime);
            out.writeLong(mRealtimeStart);
            out.writeLong(mRealtimeStart);
            out.writeLong(mUnpluggedUptime);
            out.writeLong(mUnpluggedUptime);
+3 −0
Original line number Original line Diff line number Diff line
@@ -2541,6 +2541,9 @@ public final class PowerManagerService extends com.android.server.SystemService
        @Override // Binder call
        @Override // Binder call
        public void acquireWakeLockWithUid(IBinder lock, int flags, String tag,
        public void acquireWakeLockWithUid(IBinder lock, int flags, String tag,
                String packageName, int uid) {
                String packageName, int uid) {
            if (uid < 0) {
                uid = Binder.getCallingUid();
            }
            acquireWakeLock(lock, flags, tag, packageName, new WorkSource(uid), null);
            acquireWakeLock(lock, flags, tag, packageName, new WorkSource(uid), null);
        }
        }