Camera2: Only _some_ FPS values in the old API are scaled.

The (deprecated) single-FPS parameter is not scaled by 1000.

Bug: 7230239
Change-Id: I5664cce90f9cb01e57e39f1a1f7c8eb730501da3
diff --git a/services/camera/libcameraservice/camera2/Parameters.cpp b/services/camera/libcameraservice/camera2/Parameters.cpp
index 95e9d83..6383434 100644
--- a/services/camera/libcameraservice/camera2/Parameters.cpp
+++ b/services/camera/libcameraservice/camera2/Parameters.cpp
@@ -170,15 +170,16 @@
     // PREVIEW_FRAME_RATE / SUPPORTED_PREVIEW_FRAME_RATES are deprecated, but
     // still have to do something sane for them
 
+    // NOTE: Not scaled like FPS range values are.
     params.set(CameraParameters::KEY_PREVIEW_FRAME_RATE,
-            previewFpsRange[0] * kFpsToApiScale);
+            previewFpsRange[0]);
 
     {
         String8 supportedPreviewFrameRates;
         for (size_t i=0; i < availableFpsRanges.count; i += 2) {
             if (i != 0) supportedPreviewFrameRates += ",";
             supportedPreviewFrameRates += String8::format("%d",
-                    availableFpsRanges.data.i32[i] * kFpsToApiScale);
+                    availableFpsRanges.data.i32[i]);
         }
         params.set(CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES,
                 supportedPreviewFrameRates);
@@ -946,7 +947,7 @@
     // Deprecated, only use if the preview fps range is unchanged this time.
     // The single-value FPS is the same as the minimum of the range.
     if (!fpsRangeChanged) {
-        validatedParams.previewFps = newParams.getPreviewFrameRate() / kFpsToApiScale;
+        validatedParams.previewFps = newParams.getPreviewFrameRate();
         if (validatedParams.previewFps != previewFps) {
             camera_metadata_ro_entry_t availableFrameRates =
                 staticInfo(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES);
diff --git a/services/camera/libcameraservice/camera2/Parameters.h b/services/camera/libcameraservice/camera2/Parameters.h
index 5dd3391..af23a4e 100644
--- a/services/camera/libcameraservice/camera2/Parameters.h
+++ b/services/camera/libcameraservice/camera2/Parameters.h
@@ -223,6 +223,8 @@
     // Map from camera orientation + facing to gralloc transform enum
     static int degToTransform(int degrees, bool mirror);
 
+    // API specifies FPS ranges are done in fixed point integer, with LSB = 0.001.
+    // Note that this doesn't apply to the (deprecated) single FPS value.
     static const int kFpsToApiScale = 1000;
 
     // Transform between (-1000,-1000)-(1000,1000) normalized coords from camera