summaryrefslogtreecommitdiff
path: root/src/com/android/camera/VideoModule.java
diff options
context:
space:
mode:
authorBeYkeRYkt <beykerykt@gmail.com>2020-05-26 18:43:00 +0900
committerLuK1337 <priv.luk@gmail.com>2020-11-26 12:41:40 +0100
commit77288f27edafba0656d2c56455cfcff628eca5df (patch)
tree238662fc7687f5c5c389636b9cccd7613141df19 /src/com/android/camera/VideoModule.java
parent7aa564fa6995fe14b007c61c34e622b087a97110 (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-xsrc/com/android/camera/VideoModule.java9
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);