Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2d12fb3 authored by jiabin's avatar jiabin Committed by android-build-merger
Browse files

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

am: ccaba49a

Change-Id: I06bae53d958898a61bea519cc5ee3a1dae4a7074
parents 7b9d3239 ccaba49a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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.
            if (status != AudioManager.ERROR_INVALID_OPERATION) {
                Log.e(TAG, "getMicrophones failed:" + status);
            }
            Log.i(TAG, "fallback on device info");
            addMicrophonesFromAudioDeviceInfo(microphones, filterTypes);
            return microphones;
        }
+4 −1
Original line number Diff line number Diff line
@@ -1627,8 +1627,11 @@ public class AudioRecord implements AudioRouting
        ArrayList<MicrophoneInfo> activeMicrophones = new ArrayList<>();
        int status = native_get_active_microphones(activeMicrophones);
        if (status != AudioManager.SUCCESS) {
            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);

        // Use routed device when there is not information returned by hal.
+4 −1
Original line number Diff line number Diff line
@@ -1433,8 +1433,11 @@ public class MediaRecorder implements AudioRouting
        ArrayList<MicrophoneInfo> activeMicrophones = new ArrayList<>();
        int status = native_getActiveMicrophones(activeMicrophones);
        if (status != AudioManager.SUCCESS) {
            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);

        // Use routed device when there is not information returned by hal.