Merge "Add a method to set a list of uids for a wake lock" into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2165718153
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user