Goldfish CameraHAL3 fixes:

1, Static variablies only for attributes unique across HAL objects
2, Bug when parsing resolutions for multiple cameras
3, Front camera always report INACTIVE for AF_MODE requests

Bug: 110795223, 110853354, 110778954

Test: All combinations of cameras,
      Front Back Switch Picture Recording
      E     E    Y      Y       Y
      W     E    Y      Y       Y
      E     W    Y      Y       Y
      W     W    Y      Y       Y
      E     V    Y      Y       Y
      W     V    Y      Y       Y

      E: Emulated  W: Webcam  V: AR

Change-Id: I1fbaea5ec33945876c4f0466e9bd951bd5d01f0f
diff --git a/camera/EmulatedCameraFactory.cpp b/camera/EmulatedCameraFactory.cpp
index 3f40aab..cf26a9e 100755
--- a/camera/EmulatedCameraFactory.cpp
+++ b/camera/EmulatedCameraFactory.cpp
@@ -312,8 +312,7 @@
     size_t lineBegin = 0;
     size_t lineEnd = cameraListStr.find('\n');
     while (lineEnd != std::string::npos) {
-        std::string cameraStr = cameraListStr.substr(lineBegin, lineEnd);
-
+        std::string cameraStr = cameraListStr.substr(lineBegin, lineEnd - lineBegin);
         // Parse the 'name', 'framedims', and 'dir' tokens.
         char *name, *frameDims, *dir;
         if (getTokenValue(kListNameToken, cameraStr, &name) &&
diff --git a/camera/EmulatedFakeCamera3.cpp b/camera/EmulatedFakeCamera3.cpp
index 9a86f4f..296d06e 100644
--- a/camera/EmulatedFakeCamera3.cpp
+++ b/camera/EmulatedFakeCamera3.cpp
@@ -441,8 +441,8 @@
     static const uint8_t metadataMode = ANDROID_REQUEST_METADATA_MODE_FULL;
     settings.update(ANDROID_REQUEST_METADATA_MODE, &metadataMode, 1);
 
-    static const int32_t id = 0;
-    settings.update(ANDROID_REQUEST_ID, &id, 1);
+    static const int32_t requestId = 0;
+    settings.update(ANDROID_REQUEST_ID, &requestId, 1);
 
     static const int32_t frameCount = 0;
     settings.update(ANDROID_REQUEST_FRAME_COUNT, &frameCount, 1);
@@ -473,13 +473,13 @@
     /** android.sensor */
 
     if (hasCapability(MANUAL_SENSOR)) {
-        static const int64_t exposureTime = 10 * MSEC;
+        const int64_t exposureTime = 10 * MSEC;
         settings.update(ANDROID_SENSOR_EXPOSURE_TIME, &exposureTime, 1);
 
-        static const int64_t frameDuration = 33333333L; // 1/30 s
+        const int64_t frameDuration = 33333333L; // 1/30 s
         settings.update(ANDROID_SENSOR_FRAME_DURATION, &frameDuration, 1);
 
-        static const int32_t sensitivity = 100;
+        const int32_t sensitivity = 100;
         settings.update(ANDROID_SENSOR_SENSITIVITY, &sensitivity, 1);
     }
 
@@ -574,7 +574,7 @@
 
     /** android.scaler */
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const int32_t cropRegion[4] = {
+        const int32_t cropRegion[4] = {
             0, 0, mSensorWidth, mSensorHeight
         };
         settings.update(ANDROID_SCALER_CROP_REGION, cropRegion, 4);
@@ -669,7 +669,7 @@
         static const uint8_t effectMode = ANDROID_CONTROL_EFFECT_MODE_OFF;
         settings.update(ANDROID_CONTROL_EFFECT_MODE, &effectMode, 1);
 
-        static const uint8_t sceneMode = ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY;
+        const uint8_t sceneMode = ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY;
         settings.update(ANDROID_CONTROL_SCENE_MODE, &sceneMode, 1);
 
         const uint8_t aeMode = (type == CAMERA3_TEMPLATE_MANUAL) ?
@@ -737,7 +737,7 @@
 
         settings.update(ANDROID_CONTROL_AF_REGIONS, controlRegions, 5);
 
-        static const uint8_t afTrigger = ANDROID_CONTROL_AF_TRIGGER_IDLE;
+        const uint8_t afTrigger = ANDROID_CONTROL_AF_TRIGGER_IDLE;
         settings.update(ANDROID_CONTROL_AF_TRIGGER, &afTrigger, 1);
 
         static const uint8_t vstabMode =
@@ -1244,10 +1244,9 @@
     }
 
     // android.lens
-
-    static const float focalLength = 5.0f; // mm
+    static const float focalLengths = 5.0f;
     ADD_STATIC_ENTRY(ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,
-            &focalLength, 1);
+            &focalLengths, 1);
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
         // 5 cm min focus distance for back camera, infinity (fixed focus) for front
@@ -1258,14 +1257,14 @@
         // 5 m hyperfocal distance for back camera, infinity (fixed focus) for front
         const float hyperFocalDistance = mFacingBack ? 1.0/5.0 : 0.0;
         ADD_STATIC_ENTRY(ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,
-                &minFocusDistance, 1);
+                &hyperFocalDistance, 1);
 
-        static const float aperture = 2.8f;
+        static const float apertures = 2.8f;
         ADD_STATIC_ENTRY(ANDROID_LENS_INFO_AVAILABLE_APERTURES,
-                &aperture, 1);
-        static const float filterDensity = 0;
+                &apertures, 1);
+        static const float filterDensities = 0;
         ADD_STATIC_ENTRY(ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES,
-                &filterDensity, 1);
+                &filterDensities, 1);
         static const uint8_t availableOpticalStabilization =
                 ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF;
         ADD_STATIC_ENTRY(ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,
@@ -1307,8 +1306,8 @@
                 sizeof(lensPoseTranslation)/sizeof(float));
 
         // Intrinsics are 'ideal' (f_x, f_y, c_x, c_y, s) match focal length and active array size
-        float f_x = focalLength * mSensorWidth / sensorPhysicalSize[0];
-        float f_y = focalLength * mSensorHeight / sensorPhysicalSize[1];
+        float f_x = focalLengths * mSensorWidth / sensorPhysicalSize[0];
+        float f_y = focalLengths * mSensorHeight / sensorPhysicalSize[1];
         float c_x = mSensorWidth / 2.f;
         float c_y = mSensorHeight / 2.f;
         float s = 0.f;
@@ -1327,7 +1326,7 @@
     }
 
 
-    static const uint8_t lensFacing = mFacingBack ?
+    const uint8_t lensFacing = mFacingBack ?
             ANDROID_LENS_FACING_BACK : ANDROID_LENS_FACING_FRONT;
     ADD_STATIC_ENTRY(ANDROID_LENS_FACING, &lensFacing, 1);
 
@@ -1597,20 +1596,20 @@
     // android.control
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableControlModes[] = {
+        const uint8_t availableControlModes[] = {
             ANDROID_CONTROL_MODE_OFF, ANDROID_CONTROL_MODE_AUTO, ANDROID_CONTROL_MODE_USE_SCENE_MODE
         };
         ADD_STATIC_ENTRY(ANDROID_CONTROL_AVAILABLE_MODES,
                 availableControlModes, sizeof(availableControlModes));
     } else {
-        static const uint8_t availableControlModes[] = {
+        const uint8_t availableControlModes[] = {
             ANDROID_CONTROL_MODE_AUTO
         };
         ADD_STATIC_ENTRY(ANDROID_CONTROL_AVAILABLE_MODES,
                 availableControlModes, sizeof(availableControlModes));
     }
 
-    static const uint8_t availableSceneModes[] = {
+    const uint8_t availableSceneModes[] = {
         hasCapability(BACKWARD_COMPATIBLE) ?
             ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY :
             ANDROID_CONTROL_SCENE_MODE_DISABLED
@@ -1644,7 +1643,7 @@
         ADD_STATIC_ENTRY(ANDROID_CONTROL_AE_COMPENSATION_STEP,
                 &exposureCompensationStep, 1);
 
-        int32_t exposureCompensationRange[] = {0, 0};
+        static const int32_t exposureCompensationRange[] = {0, 0};
         ADD_STATIC_ENTRY(ANDROID_CONTROL_AE_COMPENSATION_RANGE,
                 exposureCompensationRange,
                 sizeof(exposureCompensationRange)/sizeof(int32_t));
@@ -1666,7 +1665,7 @@
                 availableAntibandingModes, sizeof(availableAntibandingModes));
     }
 
-    static const uint8_t aeLockAvailable = hasCapability(BACKWARD_COMPATIBLE) ?
+    const uint8_t aeLockAvailable = hasCapability(BACKWARD_COMPATIBLE) ?
             ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE : ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE;
 
     ADD_STATIC_ENTRY(ANDROID_CONTROL_AE_LOCK_AVAILABLE,
@@ -1685,7 +1684,7 @@
                 availableAwbModes, sizeof(availableAwbModes));
     }
 
-    static const uint8_t awbLockAvailable = hasCapability(BACKWARD_COMPATIBLE) ?
+    const uint8_t awbLockAvailable = hasCapability(BACKWARD_COMPATIBLE) ?
             ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE : ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE;
 
     ADD_STATIC_ENTRY(ANDROID_CONTROL_AWB_LOCK_AVAILABLE,
@@ -1720,7 +1719,7 @@
     // android.colorCorrection
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableAberrationModes[] = {
+        const uint8_t availableAberrationModes[] = {
             ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF,
             ANDROID_COLOR_CORRECTION_ABERRATION_MODE_FAST,
             ANDROID_COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
@@ -1728,7 +1727,7 @@
         ADD_STATIC_ENTRY(ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,
                 availableAberrationModes, sizeof(availableAberrationModes));
     } else {
-        static const uint8_t availableAberrationModes[] = {
+        const uint8_t availableAberrationModes[] = {
             ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF,
         };
         ADD_STATIC_ENTRY(ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,
@@ -1737,13 +1736,13 @@
     // android.edge
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableEdgeModes[] = {
+        const uint8_t availableEdgeModes[] = {
             ANDROID_EDGE_MODE_OFF, ANDROID_EDGE_MODE_FAST, ANDROID_EDGE_MODE_HIGH_QUALITY
         };
         ADD_STATIC_ENTRY(ANDROID_EDGE_AVAILABLE_EDGE_MODES,
                 availableEdgeModes, sizeof(availableEdgeModes));
     } else {
-        static const uint8_t availableEdgeModes[] = {
+        const uint8_t availableEdgeModes[] = {
             ANDROID_EDGE_MODE_OFF
         };
         ADD_STATIC_ENTRY(ANDROID_EDGE_AVAILABLE_EDGE_MODES,
@@ -1752,7 +1751,7 @@
 
     // android.info
 
-    static const uint8_t supportedHardwareLevel =
+    const uint8_t supportedHardwareLevel =
             hasCapability(FULL_LEVEL) ? ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL :
                     ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED;
     ADD_STATIC_ENTRY(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL,
@@ -1762,7 +1761,7 @@
     // android.noiseReduction
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableNoiseReductionModes[] = {
+        const uint8_t availableNoiseReductionModes[] = {
             ANDROID_NOISE_REDUCTION_MODE_OFF,
             ANDROID_NOISE_REDUCTION_MODE_FAST,
             ANDROID_NOISE_REDUCTION_MODE_HIGH_QUALITY
@@ -1770,7 +1769,7 @@
         ADD_STATIC_ENTRY(ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,
                 availableNoiseReductionModes, sizeof(availableNoiseReductionModes));
     } else {
-        static const uint8_t availableNoiseReductionModes[] = {
+        const uint8_t availableNoiseReductionModes[] = {
             ANDROID_NOISE_REDUCTION_MODE_OFF,
         };
         ADD_STATIC_ENTRY(ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,
@@ -1809,7 +1808,7 @@
                 availableDepthStallDurations,
                 sizeof(availableDepthStallDurations)/sizeof(int64_t));
 
-        uint8_t depthIsExclusive = ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_FALSE;
+        static const uint8_t depthIsExclusive = ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_FALSE;
         ADD_STATIC_ENTRY(ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE,
                 &depthIsExclusive, 1);
     }
@@ -1817,13 +1816,13 @@
     // android.shading
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableShadingModes[] = {
+        const uint8_t availableShadingModes[] = {
             ANDROID_SHADING_MODE_OFF, ANDROID_SHADING_MODE_FAST, ANDROID_SHADING_MODE_HIGH_QUALITY
         };
         ADD_STATIC_ENTRY(ANDROID_SHADING_AVAILABLE_MODES, availableShadingModes,
                 sizeof(availableShadingModes));
     } else {
-        static const uint8_t availableShadingModes[] = {
+        const uint8_t availableShadingModes[] = {
             ANDROID_SHADING_MODE_OFF
         };
         ADD_STATIC_ENTRY(ANDROID_SHADING_AVAILABLE_MODES, availableShadingModes,
@@ -2154,11 +2153,10 @@
         case ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO:
         case ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE:
             if (!mFacingBack) {
-                ALOGE("%s: Front camera doesn't support AF mode %d",
-                        __FUNCTION__, afMode);
-                return BAD_VALUE;
+                // Always report INACTIVE for front Emulated Camera
+                mAfState = ANDROID_CONTROL_AF_STATE_INACTIVE;
+                return OK;
             }
-            // OK, handle transitions lower on
             break;
         default:
             ALOGE("%s: Emulator doesn't support AF mode %d",
diff --git a/camera/EmulatedQemuCamera3.cpp b/camera/EmulatedQemuCamera3.cpp
index 33939f9..123ab1c 100644
--- a/camera/EmulatedQemuCamera3.cpp
+++ b/camera/EmulatedQemuCamera3.cpp
@@ -136,7 +136,10 @@
          */
         if (sscanf(input.c_str(), "%dx%d%c", &width, &height, &none) == 2) {
             mResolutions.push_back(std::pair<int32_t,int32_t>(width, height));
-            ALOGE("%s: %dx%d", __FUNCTION__, width, height);
+            ALOGI("%s: %dx%d", __FUNCTION__, width, height);
+        }
+        else {
+            ALOGE("wrong resolution input %s", input.c_str());
         }
     }
 
@@ -239,6 +242,20 @@
     res = mReadoutThread->run("EmuCam3::readoutThread");
     if (res != NO_ERROR) return res;
 
+    // Initialize fake 3A
+
+    mFacePriority = false;
+    mAeMode       = ANDROID_CONTROL_AE_MODE_ON;
+    mAfMode       = ANDROID_CONTROL_AF_MODE_AUTO;
+    mAwbMode      = ANDROID_CONTROL_AWB_MODE_AUTO;
+    mAeState      = ANDROID_CONTROL_AE_STATE_INACTIVE;
+    mAfState      = ANDROID_CONTROL_AF_STATE_INACTIVE;
+    mAwbState     = ANDROID_CONTROL_AWB_STATE_INACTIVE;
+    mAeCounter    = 0;
+    mAeTargetExposureTime = kNormalExposureTime;
+    mAeCurrentExposureTime = kNormalExposureTime;
+    mAeCurrentSensitivity  = kNormalSensitivity;
+
     return EmulatedCamera3::connectCamera(device);
 }
 
@@ -516,7 +533,7 @@
 
     /* android.scaler */
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const int32_t cropRegion[4] = {
+        const int32_t cropRegion[4] = {
             0, 0, mSensorWidth, mSensorHeight
         };
         settings.update(ANDROID_SCALER_CROP_REGION, cropRegion, 4);
@@ -607,7 +624,7 @@
         static const uint8_t effectMode = ANDROID_CONTROL_EFFECT_MODE_OFF;
         settings.update(ANDROID_CONTROL_EFFECT_MODE, &effectMode, 1);
 
-        static const uint8_t sceneMode =
+        const uint8_t sceneMode =
                 ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY;
         settings.update(ANDROID_CONTROL_SCENE_MODE, &sceneMode, 1);
 
@@ -1132,27 +1149,27 @@
 
     /* android.lens */
 
-    static const float focalLength = 3.30f; // mm
+    static const float focalLengths = 5.0f; // mm
     ADD_STATIC_ENTRY(ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,
-            &focalLength, 1);
+            &focalLengths, 1);
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
         // infinity (fixed focus)
-        const float minFocusDistance = 0.0;
+        static const float minFocusDistance = 0.0;
         ADD_STATIC_ENTRY(ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,
                 &minFocusDistance, 1);
 
         // (fixed focus)
-        const float hyperFocalDistance = 0.0;
+        static const float hyperFocalDistance = 0.0;
         ADD_STATIC_ENTRY(ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,
-                &minFocusDistance, 1);
+                &hyperFocalDistance, 1);
 
-        static const float aperture = 2.8f;
+        static const float apertures = 2.8f;
         ADD_STATIC_ENTRY(ANDROID_LENS_INFO_AVAILABLE_APERTURES,
-                &aperture, 1);
-        static const float filterDensity = 0;
+                &apertures, 1);
+        static const float filterDensities = 0;
         ADD_STATIC_ENTRY(ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES,
-                &filterDensity, 1);
+                &filterDensities, 1);
         static const uint8_t availableOpticalStabilization =
                 ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF;
         ADD_STATIC_ENTRY(ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,
@@ -1168,7 +1185,7 @@
                 &lensFocusCalibration, 1);
     }
 
-    static const uint8_t lensFacing = mFacingBack ?
+    const uint8_t lensFacing = mFacingBack ?
             ANDROID_LENS_FACING_BACK : ANDROID_LENS_FACING_FRONT;
     ADD_STATIC_ENTRY(ANDROID_LENS_FACING, &lensFacing, 1);
 
@@ -1309,7 +1326,7 @@
 
     /* android.sync */
 
-    static const int32_t maxLatency =
+    const int32_t maxLatency =
             hasCapability(FULL_LEVEL) ?
             ANDROID_SYNC_MAX_LATENCY_PER_FRAME_CONTROL : 3;
     ADD_STATIC_ENTRY(ANDROID_SYNC_MAX_LATENCY, &maxLatency, 1);
@@ -1317,7 +1334,7 @@
     /* android.control */
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableControlModes[] = {
+        const uint8_t availableControlModes[] = {
             ANDROID_CONTROL_MODE_OFF,
             ANDROID_CONTROL_MODE_AUTO,
             ANDROID_CONTROL_MODE_USE_SCENE_MODE
@@ -1325,14 +1342,14 @@
         ADD_STATIC_ENTRY(ANDROID_CONTROL_AVAILABLE_MODES,
                 availableControlModes, sizeof(availableControlModes));
     } else {
-        static const uint8_t availableControlModes[] = {
+        const uint8_t availableControlModes[] = {
             ANDROID_CONTROL_MODE_AUTO
         };
         ADD_STATIC_ENTRY(ANDROID_CONTROL_AVAILABLE_MODES,
                 availableControlModes, sizeof(availableControlModes));
     }
 
-    static const uint8_t availableSceneModes[] = {
+    const uint8_t availableSceneModes[] = {
         hasCapability(BACKWARD_COMPATIBLE) ?
             ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY :
             ANDROID_CONTROL_SCENE_MODE_DISABLED
@@ -1369,7 +1386,7 @@
         ADD_STATIC_ENTRY(ANDROID_CONTROL_AE_COMPENSATION_STEP,
                 &exposureCompensationStep, 1);
 
-        int32_t exposureCompensationRange[] = {-9, 9};
+        static int32_t exposureCompensationRange[] = {-9, 9};
         ADD_STATIC_ENTRY(ANDROID_CONTROL_AE_COMPENSATION_RANGE,
                 exposureCompensationRange,
                 sizeof(exposureCompensationRange) / sizeof(int32_t));
@@ -1439,7 +1456,7 @@
     /* android.colorCorrection */
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableAberrationModes[] = {
+        const uint8_t availableAberrationModes[] = {
             ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF,
             ANDROID_COLOR_CORRECTION_ABERRATION_MODE_FAST,
             ANDROID_COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
@@ -1447,7 +1464,7 @@
         ADD_STATIC_ENTRY(ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,
                 availableAberrationModes, sizeof(availableAberrationModes));
     } else {
-        static const uint8_t availableAberrationModes[] = {
+        const uint8_t availableAberrationModes[] = {
             ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF,
         };
         ADD_STATIC_ENTRY(ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,
@@ -1457,7 +1474,7 @@
     /* android.edge */
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableEdgeModes[] = {
+        const uint8_t availableEdgeModes[] = {
             ANDROID_EDGE_MODE_OFF,
             ANDROID_EDGE_MODE_FAST,
             ANDROID_EDGE_MODE_HIGH_QUALITY,
@@ -1465,7 +1482,7 @@
         ADD_STATIC_ENTRY(ANDROID_EDGE_AVAILABLE_EDGE_MODES,
                 availableEdgeModes, sizeof(availableEdgeModes));
     } else {
-        static const uint8_t availableEdgeModes[] = {
+        const uint8_t availableEdgeModes[] = {
             ANDROID_EDGE_MODE_OFF
         };
         ADD_STATIC_ENTRY(ANDROID_EDGE_AVAILABLE_EDGE_MODES,
@@ -1482,7 +1499,7 @@
     /* android.noiseReduction */
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableNoiseReductionModes[] = {
+        const uint8_t availableNoiseReductionModes[] = {
             ANDROID_NOISE_REDUCTION_MODE_OFF,
             ANDROID_NOISE_REDUCTION_MODE_FAST,
             ANDROID_NOISE_REDUCTION_MODE_HIGH_QUALITY
@@ -1491,7 +1508,7 @@
                 availableNoiseReductionModes,
                 sizeof(availableNoiseReductionModes));
     } else {
-        static const uint8_t availableNoiseReductionModes[] = {
+        const uint8_t availableNoiseReductionModes[] = {
             ANDROID_NOISE_REDUCTION_MODE_OFF
         };
         ADD_STATIC_ENTRY(ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,
@@ -1502,7 +1519,7 @@
     /* android.shading */
 
     if (hasCapability(BACKWARD_COMPATIBLE)) {
-        static const uint8_t availableShadingModes[] = {
+        const uint8_t availableShadingModes[] = {
             ANDROID_SHADING_MODE_OFF,
             ANDROID_SHADING_MODE_FAST,
             ANDROID_SHADING_MODE_HIGH_QUALITY
@@ -1510,7 +1527,7 @@
         ADD_STATIC_ENTRY(ANDROID_SHADING_AVAILABLE_MODES, availableShadingModes,
                 sizeof(availableShadingModes));
     } else {
-        static const uint8_t availableShadingModes[] = {
+        const uint8_t availableShadingModes[] = {
             ANDROID_SHADING_MODE_OFF
         };
         ADD_STATIC_ENTRY(ANDROID_SHADING_AVAILABLE_MODES, availableShadingModes,
diff --git a/camera/qemu-pipeline3/QemuSensor.cpp b/camera/qemu-pipeline3/QemuSensor.cpp
index bf662ab..d52bffd 100644
--- a/camera/qemu-pipeline3/QemuSensor.cpp
+++ b/camera/qemu-pipeline3/QemuSensor.cpp
@@ -341,7 +341,7 @@
             (int) ((endRealTime - startRealTime) / 1000000),
             (int) (frameDuration / 1000000));
     return true;
-};
+}
 
 void QemuSensor::captureRGBA(uint8_t *img, uint32_t width, uint32_t height,
         uint32_t stride, int64_t *timestamp) {