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

Commit 4de0922e authored by Austin Borger's avatar Austin Borger Committed by Android (Google) Code Review
Browse files

Merge "AudioService: Use the default UidObserver implementation." into udc-dev

parents ea6b64e6 de3112e0
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -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 */,