diff options
| author | BeYkeRYkt <beykerykt@gmail.com> | 2020-05-26 18:43:00 +0900 |
|---|---|---|
| committer | LuK1337 <priv.luk@gmail.com> | 2020-11-26 12:41:40 +0100 |
| commit | 77288f27edafba0656d2c56455cfcff628eca5df (patch) | |
| tree | 238662fc7687f5c5c389636b9cccd7613141df19 /src/com/android/camera/VideoModule.java | |
| parent | 7aa564fa6995fe14b007c61c34e622b087a97110 (diff) | |
Snap: Report device orientation to Audio HAL
* Our Audio HAL can connect microphones depending on the orientation of the
device. Let him know about it.
Change-Id: I56cf0a96cac0226222d666aa3910ea190e3630ca
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
| -rwxr-xr-x | src/com/android/camera/VideoModule.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index c71dec776..b74458897 100755 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -777,6 +777,15 @@ public class VideoModule implements CameraModule, setFlipValue(); updatePowerMode(); mCameraDevice.setParameters(mParameters); + + AudioManager am = mActivity.getSystemService(AudioManager.class); + if (am != null) { + int rotation = newOrientation; + if (rotation == 90 || rotation == 270) { + rotation = (newOrientation + 180) % 360; + } + am.setParameters("rotation=" + rotation); + } } mUI.tryToCloseSubList(); mUI.setOrientation(newOrientation, true); |
