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

Commit d983ba5c authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Add PowerManager method to assign blame to a single uid

Currently used by audioflinger to account for recording wakelocks.
b/10985160

Change-Id: I18fc8487f2a197bf02b5269a4bcae9e75b6c2207
parent d6957d5f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,9 +23,10 @@ import android.os.WorkSource;

interface IPowerManager
{
    // WARNING: The first two methods must remain the first two methods because their
    // WARNING: The first three methods must remain the first three methods because their
    // transaction numbers must not change unless IPowerManager.cpp is also updated.
    void acquireWakeLock(IBinder lock, int flags, String tag, String packageName, in WorkSource ws);
    void acquireWakeLockWithUid(IBinder lock, int flags, String tag, String packageName, int uidtoblame);
    void releaseWakeLock(IBinder lock, int flags);

    void updateWakeLockWorkSource(IBinder lock, in WorkSource ws);
+1 −0
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@
    <assign-permission name="android.permission.MODIFY_AUDIO_SETTINGS" uid="media" />
    <assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="media" />
    <assign-permission name="android.permission.WAKE_LOCK" uid="media" />
    <assign-permission name="android.permission.UPDATE_DEVICE_STATS" uid="media" />
    <assign-permission name="android.permission.UPDATE_APP_OPS_STATS" uid="media" />

    <assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="graphics" />
+6 −0
Original line number Diff line number Diff line
@@ -578,6 +578,12 @@ public final class PowerManagerService extends IPowerManager.Stub
        updatePowerStateLocked();
    }

    @Override // Binder call
    public void acquireWakeLockWithUid(IBinder lock, int flags, String tag, String packageName,
            int uid) {
        acquireWakeLock(lock, flags, tag, packageName, new WorkSource(uid));
    }

    @Override // Binder call
    public void acquireWakeLock(IBinder lock, int flags, String tag, String packageName,
            WorkSource ws) {