Merge "Change log level when microphone enumeration APIs native call fail." into pi-dev

This commit is contained in:
TreeHugger Robot
2018-04-12 17:05:12 +00:00
committed by Android (Google) Code Review
3 changed files with 12 additions and 3 deletions

View File

@@ -4816,7 +4816,10 @@ public class AudioManager {
filterTypes.add(AudioDeviceInfo.TYPE_TELEPHONY); filterTypes.add(AudioDeviceInfo.TYPE_TELEPHONY);
if (status != AudioManager.SUCCESS) { if (status != AudioManager.SUCCESS) {
// fail and populate microphones with unknown characteristics by device information. // fail and populate microphones with unknown characteristics by device information.
if (status != AudioManager.ERROR_INVALID_OPERATION) {
Log.e(TAG, "getMicrophones failed:" + status); Log.e(TAG, "getMicrophones failed:" + status);
}
Log.i(TAG, "fallback on device info");
addMicrophonesFromAudioDeviceInfo(microphones, filterTypes); addMicrophonesFromAudioDeviceInfo(microphones, filterTypes);
return microphones; return microphones;
} }

View File

@@ -1627,8 +1627,11 @@ public class AudioRecord implements AudioRouting
ArrayList<MicrophoneInfo> activeMicrophones = new ArrayList<>(); ArrayList<MicrophoneInfo> activeMicrophones = new ArrayList<>();
int status = native_get_active_microphones(activeMicrophones); int status = native_get_active_microphones(activeMicrophones);
if (status != AudioManager.SUCCESS) { if (status != AudioManager.SUCCESS) {
if (status != AudioManager.ERROR_INVALID_OPERATION) {
Log.e(TAG, "getActiveMicrophones failed:" + status); Log.e(TAG, "getActiveMicrophones failed:" + status);
} }
Log.i(TAG, "getActiveMicrophones failed, fallback on routed device info");
}
AudioManager.setPortIdForMicrophones(activeMicrophones); AudioManager.setPortIdForMicrophones(activeMicrophones);
// Use routed device when there is not information returned by hal. // Use routed device when there is not information returned by hal.

View File

@@ -1433,8 +1433,11 @@ public class MediaRecorder implements AudioRouting
ArrayList<MicrophoneInfo> activeMicrophones = new ArrayList<>(); ArrayList<MicrophoneInfo> activeMicrophones = new ArrayList<>();
int status = native_getActiveMicrophones(activeMicrophones); int status = native_getActiveMicrophones(activeMicrophones);
if (status != AudioManager.SUCCESS) { if (status != AudioManager.SUCCESS) {
if (status != AudioManager.ERROR_INVALID_OPERATION) {
Log.e(TAG, "getActiveMicrophones failed:" + status); Log.e(TAG, "getActiveMicrophones failed:" + status);
} }
Log.i(TAG, "getActiveMicrophones failed, fallback on routed device info");
}
AudioManager.setPortIdForMicrophones(activeMicrophones); AudioManager.setPortIdForMicrophones(activeMicrophones);
// Use routed device when there is not information returned by hal. // Use routed device when there is not information returned by hal.