sdm710-common: camera_motor: handle mid position state

* oppo_motor gets initialized with position in "MID_STATE"

Change-Id: I5bbe50b20910f9ea9950caa081577c7216ed8b06
This commit is contained in:
Jan Altensen 2019-10-03 18:36:49 +02:00 committed by SamarV-121
parent 7450d7c4a3
commit 8ccb690079

View file

@ -31,6 +31,7 @@
#define DIRECTION_DOWN "0"
#define DIRECTION_UP "1"
#define HALL_CALIBRATION_DEFAULT "170,170,480,0,0,480,500,0,0,500,1500"
#define POSITION_MID "2"
#define POSITION_DOWN "1"
#define POSITION_UP "0"
#define ENABLED "1"
@ -92,7 +93,7 @@ CameraMotor::CameraMotor() {
Return<void> CameraMotor::onConnect(const hidl_string& cameraId) {
auto motorPosition = get<std::string>(CAMERA_MOTOR_POSITION, "");
if (cameraId == CAMERA_ID_FRONT && motorPosition == POSITION_DOWN) {
if (cameraId == CAMERA_ID_FRONT && (motorPosition == POSITION_DOWN || motorPosition == POSITION_MID)) {
LOG(INFO) << "Popping out front camera";
set(CAMERA_MOTOR_DIRECTION, DIRECTION_UP);