summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeYkeRYkt <beykerykt@gmail.com>2020-05-26 18:43:00 +0900
committerCarlos Solano <csolano@gmail.com>2020-08-17 14:25:22 +0200
commita8051b255ccda255c9364c672125020d5386907a (patch)
tree76e896e0f1f0233b820322a53e0c69b21151ca53
parent62b8df6fc57b19bac8d416dde233bca56516f149 (diff)
Snap: Report device orientation to Audio HALq10.0
* Our Audio HAL can connect microphones depending on the orientation of the device. Let him know about it. Change-Id: I56cf0a96cac0226222d666aa3910ea190e3630ca
-rw-r--r--src/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 190cc248a..a1c5cfb25 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -778,6 +778,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);