在安装某些扫描apk时,发现Camera的扫描方向不对,可以通过如下的修改,来适配对应的扫描apk。
--- a/mt8765/frameworks/av/services/camera/libcameraservice/api1/CameraClient.cpp
+++ b/mt8765/frameworks/av/services/camera/libcameraservice/api1/CameraClient.cpp
@@ -767,11 +767,15 @@ status_t CameraClient::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
if (orientation == -1) return BAD_VALUE;
if (mOrientation != orientation) {
- mOrientation = orientation;
+ //mOrientation = orientation;
+ mOrientation = 7;
if (mPreviewWindow != 0) {
mHardware->setPreviewTransform(mOrientation);
}
}
+ mOrientation = 7;
//!++
if(mHardware != 0)
mHardware->sendCommand(cmd, mOrientation, arg2);