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

Commit 787addce authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "audio: remove flag android.media.audiopolicy.audio_mix_ownership" into main

parents 91fc447f 8e320673
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -289,9 +289,7 @@ public class AudioMix implements Parcelable {
        if (o == null || getClass() != o.getClass()) return false;

        final AudioMix that = (AudioMix) o;
        boolean tokenMatch = android.media.audiopolicy.Flags.audioMixOwnership()
                ? Objects.equals(this.mToken, that.mToken)
                : true;
        boolean tokenMatch = Objects.equals(this.mToken, that.mToken);
        return Objects.equals(this.mRouteFlags, that.mRouteFlags)
            && Objects.equals(this.mRule, that.mRule)
            && Objects.equals(this.mMixType, that.mMixType)
@@ -302,11 +300,8 @@ public class AudioMix implements Parcelable {
    /** @hide */
    @Override
    public int hashCode() {
        if (android.media.audiopolicy.Flags.audioMixOwnership()) {
        return Objects.hash(mRouteFlags, mRule, mMixType, mFormat, mToken);
    }
        return Objects.hash(mRouteFlags, mRule, mMixType, mFormat);
    }

    @Override
    public int describeContents() {
+16 −26
Original line number Diff line number Diff line
@@ -13983,7 +13983,6 @@ public class AudioService extends IAudioService.Stub
            if (app == null) {
                return AudioManager.ERROR;
            }
            if (android.media.audiopolicy.Flags.audioMixOwnership()) {
            for (AudioMix mix : policyConfig.getMixes()) {
                if (!app.getMixes().contains(mix)) {
                    Slog.e(TAG,
@@ -13992,7 +13991,6 @@ public class AudioService extends IAudioService.Stub
                    return AudioManager.ERROR;
                }
            }
            }
            return app.removeMixes(policyConfig.getMixes()) == AudioSystem.SUCCESS
                ? AudioManager.SUCCESS : AudioManager.ERROR;
        }
@@ -14791,13 +14789,9 @@ public class AudioService extends IAudioService.Stub
            }
            final long identity = Binder.clearCallingIdentity();
            try {
                if (android.media.audiopolicy.Flags.audioMixOwnership()) {
                synchronized (mMixes) {
                    removeMixes(new ArrayList(mMixes));
                }
                } else {
                    mAudioSystem.registerPolicyMixes(mMixes, false);
                }
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
@@ -14841,7 +14835,6 @@ public class AudioService extends IAudioService.Stub
        int addMixes(@NonNull ArrayList<AudioMix> mixes) {
            synchronized (mMixes) {
                if (android.media.audiopolicy.Flags.audioMixOwnership()) {
                for (AudioMix mix : mixes) {
                    setMixRegistration(mix);
                    mix.setVirtualDeviceId(mAttributionSource.getDeviceId());
@@ -14853,9 +14846,6 @@ public class AudioService extends IAudioService.Stub
                }
                return result;
            }
                this.add(mixes);
                return mAudioSystem.registerPolicyMixes(mixes, true);
            }
        }
        int removeMixes(@NonNull ArrayList<AudioMix> mixes) {