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

Commit 21657181 authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Add a method to set a list of uids for a wake lock" into klp-dev

parents 2a40da55 738ffdc9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,11 +23,12 @@ import android.os.WorkSource;

interface IPowerManager
{
    // WARNING: The first three methods must remain the first three methods because their
    // WARNING: The first four 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 updateWakeLockUids(IBinder lock, in int[] uids);

    void updateWakeLockWorkSource(IBinder lock, in WorkSource ws);
    boolean isWakeLockLevelSupported(int level);
+15 −0
Original line number Diff line number Diff line
@@ -746,6 +746,21 @@ public final class PowerManagerService extends IPowerManager.Stub
        }
    }

    @Override // Binder call
    public void updateWakeLockUids(IBinder lock, int[] uids) {
        WorkSource ws = null;

        if (uids != null) {
            ws = new WorkSource();
            // XXX should WorkSource have a way to set uids as an int[] instead of adding them
            // one at a time?
            for (int i = 0; i < uids.length; i++) {
                ws.add(uids[i]);
            }
        }
        updateWakeLockWorkSource(lock, ws);
    }

    @Override // Binder call
    public void updateWakeLockWorkSource(IBinder lock, WorkSource ws) {
        if (lock == null) {
+5 −0
Original line number Diff line number Diff line
@@ -80,6 +80,11 @@ public class BridgePowerManager implements IPowerManager {
        // pass for now.
    }

    @Override
    public void updateWakeLockUids(IBinder arg0, int[] arg1) throws RemoteException {
        // pass for now.
    }

    @Override
    public void setAttentionLight(boolean arg0, int arg1) throws RemoteException {
        // pass for now.