Loading media/java/android/media/audiopolicy/AudioMix.java +2 −7 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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() { Loading services/core/java/com/android/server/audio/AudioService.java +16 −26 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -13992,7 +13991,6 @@ public class AudioService extends IAudioService.Stub return AudioManager.ERROR; } } } return app.removeMixes(policyConfig.getMixes()) == AudioSystem.SUCCESS ? AudioManager.SUCCESS : AudioManager.ERROR; } Loading Loading @@ -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); } Loading Loading @@ -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()); Loading @@ -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) { Loading
media/java/android/media/audiopolicy/AudioMix.java +2 −7 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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() { Loading
services/core/java/com/android/server/audio/AudioService.java +16 −26 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -13992,7 +13991,6 @@ public class AudioService extends IAudioService.Stub return AudioManager.ERROR; } } } return app.removeMixes(policyConfig.getMixes()) == AudioSystem.SUCCESS ? AudioManager.SUCCESS : AudioManager.ERROR; } Loading Loading @@ -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); } Loading Loading @@ -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()); Loading @@ -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) {