From 6869df3a5db0ca0037394f0fd14aecc1d80b5b42 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Tue, 3 Nov 2009 19:43:21 -0800 Subject: [PATCH 1/2] Add new audio sources to support the A1026 recording configurations. --- include/media/mediarecorder.h | 3 ++- media/java/android/media/MediaRecorder.java | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h index d8ab63d6092f4..8c7392b026f45 100644 --- a/include/media/mediarecorder.h +++ b/include/media/mediarecorder.h @@ -42,7 +42,8 @@ enum audio_source { AUDIO_SOURCE_VOICE_DOWNLINK = 3, AUDIO_SOURCE_VOICE_CALL = 4, AUDIO_SOURCE_CAMCORDER = 5, - AUDIO_SOURCE_MAX = AUDIO_SOURCE_CAMCORDER, + AUDIO_SOURCE_VOICE_RECOGNITION = 6, + AUDIO_SOURCE_MAX = AUDIO_SOURCE_VOICE_RECOGNITION, AUDIO_SOURCE_LIST_END // must be last - used to validate audio source type }; diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java index 9bb00c64bf2c8..0b42cf61e04e8 100644 --- a/media/java/android/media/MediaRecorder.java +++ b/media/java/android/media/MediaRecorder.java @@ -135,6 +135,12 @@ public class MediaRecorder /** Voice call uplink + downlink audio source */ public static final int VOICE_CALL = 4; + + /** @hide Microphone audio source with same orientation as camera */ + public static final int CAMCORDER = 5; + + /** @hide Microphone audio source tuned for voice recognition */ + public static final int VOICE_RECOGNITION = 6; } /** @@ -274,7 +280,7 @@ public class MediaRecorder * Gets the maximum value for audio sources. * @see android.media.MediaRecorder.AudioSource */ - public static final int getAudioSourceMax() { return AudioSource.VOICE_CALL; } + public static final int getAudioSourceMax() { return AudioSource.VOICE_RECOGNITION; } /** * Sets the video source to be used for recording. If this method is not From 2867746d7b59579ecf7b2de41e42fc1ca88d04d9 Mon Sep 17 00:00:00 2001 From: Jason Parks Date: Wed, 4 Nov 2009 14:25:26 -0800 Subject: [PATCH 2/2] When a thread is about to be put back onto the thread pool ensure that it is in the foreground cgroup. --- libs/binder/IPCThreadState.cpp | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index 86c3df6abea0a..d474571bebc7e 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -422,31 +422,13 @@ void IPCThreadState::joinThreadPool(bool isMain) << getReturnString(cmd) << endl; } - bool isTainted = false; - - { - SchedPolicy policy; - get_sched_policy(getpid(), &policy); - - if (policy == SP_BACKGROUND) { - isTainted = true; - } - } result = executeCommand(cmd); - // Make sure that after executing the commands that we put the thread back into the - // default cgroup. - { - int pid = getpid(); - SchedPolicy policy; - get_sched_policy(pid, &policy); - - if (!isTainted && policy == SP_BACKGROUND) { - LOGW("*** THREAD %p (PID %p) was left in SP_BACKGROUND with a priority of %d\n", - (void*)pthread_self(), pid, getpriority(PRIO_PROCESS, pid)); - } - } + // Make sure that after executing the command that we put the thread back into the + // default cgroup. This is just a failsafe incase the thread's priority or cgroup was + // not properly restored. + set_sched_policy(getpid(), SP_FOREGROUND); } // Let this thread exit the thread pool if it is no longer