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

This commit is contained in:
Marco Nelissen
2013-10-25 21:55:55 +00:00
committed by Android (Google) Code Review
3 changed files with 22 additions and 1 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -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.