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

am: ccaba49ab5

Change-Id: I06bae53d958898a61bea519cc5ee3a1dae4a7074
This commit is contained in:
jiabin
2018-04-12 10:17:24 -07:00
committed by android-build-merger
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);