summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-12-10 01:33:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-10 01:33:09 +0000
commit65bc1125b4bdb0e982b37e76ab8a9a66adefd2e0 (patch)
tree6b9e3c09ccef421e93dd1e916a528b7de261a277 /media
parent37f271869ed9c9e9f0e7de7339017e0bb6719780 (diff)
parent7f5eb9fe3c10d8d83ff0e2b0fc60a05c2e6d5b02 (diff)
downloadframeworks_base-65bc1125b4bdb0e982b37e76ab8a9a66adefd2e0.zip
frameworks_base-65bc1125b4bdb0e982b37e76ab8a9a66adefd2e0.tar.gz
frameworks_base-65bc1125b4bdb0e982b37e76ab8a9a66adefd2e0.tar.bz2
Merge "AudioSystem JNI: Add audio policy custom mixes registration" into lmp-mr1-dev
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioService.java27
-rw-r--r--media/java/android/media/AudioSystem.java3
2 files changed, 14 insertions, 16 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index b99b4fd..ea9e703 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -4299,6 +4299,13 @@ public class AudioService extends IAudioService.Stub {
}
}
}
+
+ synchronized (mAudioPolicies) {
+ for(AudioPolicyProxy policy : mAudioPolicies.values()) {
+ policy.connectMixes();
+ }
+ }
+
// indicate the end of reconfiguration phase to audio HAL
AudioSystem.setParameters("restarting=false");
break;
@@ -5939,7 +5946,7 @@ public class AudioService extends IAudioService.Stub {
if (mHasFocusListener) {
mMediaFocusControl.addFocusFollower(mPolicyToken);
}
- updateMixes(AudioSystem.DEVICE_STATE_AVAILABLE);
+ connectMixes();
}
public void binderDied() {
@@ -5961,23 +5968,11 @@ public class AudioService extends IAudioService.Stub {
if (mHasFocusListener) {
mMediaFocusControl.removeFocusFollower(mPolicyToken);
}
- updateMixes(AudioSystem.DEVICE_STATE_UNAVAILABLE);
+ AudioSystem.registerPolicyMixes(mMixes, false);
}
- void updateMixes(int connectionState) {
- for (AudioMix mix : mMixes) {
- // TODO implement sending the mix attribute matching info to native audio policy
- if (DEBUG_AP) {
- Log.v(TAG, "AudioPolicyProxy mix new connection state=" + connectionState
- + " addr=" + mix.getRegistration());
- }
- AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_IN_REMOTE_SUBMIX,
- connectionState,
- mix.getRegistration());
- AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_REMOTE_SUBMIX,
- connectionState,
- mix.getRegistration());
- }
+ void connectMixes() {
+ AudioSystem.registerPolicyMixes(mMixes, true);
}
};
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index e795fa7..46ab7e0 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -16,6 +16,7 @@
package android.media;
+import android.media.audiopolicy.AudioMix;
import java.util.ArrayList;
/* IF YOU CHANGE ANY OF THE CONSTANTS IN THIS FILE, DO NOT FORGET
@@ -566,5 +567,7 @@ public class AudioSystem
public static final int AUDIO_HW_SYNC_INVALID = 0;
public static native int getAudioHwSyncForSession(int sessionId);
+
+ public static native int registerPolicyMixes(ArrayList<AudioMix> mixes, boolean register);
}