Merge "AudioService: Use the default UidObserver implementation." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4de0922e15
@@ -51,6 +51,7 @@ import android.app.AppOpsManager;
|
||||
import android.app.BroadcastOptions;
|
||||
import android.app.IUidObserver;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.UidObserver;
|
||||
import android.app.role.OnRoleHoldersChangedListener;
|
||||
import android.app.role.RoleManager;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
@@ -959,29 +960,16 @@ public class AudioService extends IAudioService.Stub
|
||||
}
|
||||
}
|
||||
|
||||
final private IUidObserver mUidObserver = new IUidObserver.Stub() {
|
||||
@Override public void onUidStateChanged(int uid, int procState, long procStateSeq,
|
||||
int capability) {
|
||||
}
|
||||
|
||||
final private IUidObserver mUidObserver = new UidObserver() {
|
||||
@Override public void onUidGone(int uid, boolean disabled) {
|
||||
// Once the uid is no longer running, no need to keep trying to disable its audio.
|
||||
disableAudioForUid(false, uid);
|
||||
}
|
||||
|
||||
@Override public void onUidActive(int uid) throws RemoteException {
|
||||
}
|
||||
|
||||
@Override public void onUidIdle(int uid, boolean disabled) {
|
||||
}
|
||||
|
||||
@Override public void onUidCachedChanged(int uid, boolean cached) {
|
||||
disableAudioForUid(cached, uid);
|
||||
}
|
||||
|
||||
@Override public void onUidProcAdjChanged(int uid) {
|
||||
}
|
||||
|
||||
private void disableAudioForUid(boolean disable, int uid) {
|
||||
queueMsgUnderWakeLock(mAudioHandler, MSG_DISABLE_AUDIO_FOR_UID,
|
||||
disable ? 1 : 0 /* arg1 */, uid /* arg2 */,
|
||||
|
||||
Reference in New Issue
Block a user