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);
if (status != AudioManager.SUCCESS) {
// fail and populate microphones with unknown characteristics by device information.
Log.e(TAG, "getMicrophones failed:" + status);
if (status != AudioManager.ERROR_INVALID_OPERATION) {
Log.e(TAG, "getMicrophones failed:" + status);
}
Log.i(TAG, "fallback on device info");
addMicrophonesFromAudioDeviceInfo(microphones, filterTypes);
return microphones;
}

View File

@@ -1627,7 +1627,10 @@ public class AudioRecord implements AudioRouting
ArrayList<MicrophoneInfo> activeMicrophones = new ArrayList<>();
int status = native_get_active_microphones(activeMicrophones);
if (status != AudioManager.SUCCESS) {
Log.e(TAG, "getActiveMicrophones failed:" + status);
if (status != AudioManager.ERROR_INVALID_OPERATION) {
Log.e(TAG, "getActiveMicrophones failed:" + status);
}
Log.i(TAG, "getActiveMicrophones failed, fallback on routed device info");
}
AudioManager.setPortIdForMicrophones(activeMicrophones);

View File

@@ -1433,7 +1433,10 @@ public class MediaRecorder implements AudioRouting
ArrayList<MicrophoneInfo> activeMicrophones = new ArrayList<>();
int status = native_getActiveMicrophones(activeMicrophones);
if (status != AudioManager.SUCCESS) {
Log.e(TAG, "getActiveMicrophones failed:" + status);
if (status != AudioManager.ERROR_INVALID_OPERATION) {
Log.e(TAG, "getActiveMicrophones failed:" + status);
}
Log.i(TAG, "getActiveMicrophones failed, fallback on routed device info");
}
AudioManager.setPortIdForMicrophones(activeMicrophones);