diff options
| author | 2019-01-17 21:19:43 +0000 | |
|---|---|---|
| committer | 2019-01-17 21:19:43 +0000 | |
| commit | 7df94aba42833c21112d4e8ba3e85521915e685b (patch) | |
| tree | 96a14bf3d91a6b6e7f97567131130f6da47bdc88 | |
| parent | b39f47fe46fa580e68201e17fa92e6e9ef7f6a14 (diff) | |
| parent | 9dc1dac24ea5f5f57f0ea6fd35abbf9ded43d8a8 (diff) | |
Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190105.001) into master"
| -rw-r--r-- | services/core/java/com/android/server/camera/CameraServiceProxy.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/camera/CameraServiceProxy.java b/services/core/java/com/android/server/camera/CameraServiceProxy.java index 0ee55ed2e832..527539d8ce0d 100644 --- a/services/core/java/com/android/server/camera/CameraServiceProxy.java +++ b/services/core/java/com/android/server/camera/CameraServiceProxy.java @@ -21,6 +21,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.hardware.ICameraService; import android.hardware.ICameraServiceProxy; +import android.media.AudioManager; import android.metrics.LogMaker; import android.nfc.INfcAdapter; import android.os.Binder; @@ -393,6 +394,19 @@ public class CameraServiceProxy extends SystemService boolean wasEmpty = mActiveCameraUsage.isEmpty(); switch (newCameraState) { case ICameraServiceProxy.CAMERA_STATE_OPEN: + // Notify the audio subsystem about the facing of the most-recently opened + // camera This can be used to select the best audio tuning in case video + // recording with that camera will happen. Since only open events are used, if + // multiple cameras are opened at once, the one opened last will be used to + // select audio tuning. + AudioManager audioManager = getContext().getSystemService(AudioManager.class); + if (audioManager != null) { + // Map external to front for audio tuning purposes + String facingStr = (facing == ICameraServiceProxy.CAMERA_FACING_BACK) ? + "back" : "front"; + String facingParameter = "cameraFacing=" + facingStr; + audioManager.setParameters(facingParameter); + } break; case ICameraServiceProxy.CAMERA_STATE_ACTIVE: CameraUsageEvent newEvent = new CameraUsageEvent(facing, clientName, apiLevel); |