Merge cherrypicks of [12459010, 12458938, 12457091, 12457819, 12459162, 12459126, 12459127, 12458858, 12458859, 12458912, 12459163] into rvc-d1-release

Change-Id: I9c129a1a97fdb121c72fc1bc7a6c189c9246bb56
diff --git a/gralloc/gr_adreno_info.cpp b/gralloc/gr_adreno_info.cpp
index 2b82dc6..8133da7 100644
--- a/gralloc/gr_adreno_info.cpp
+++ b/gralloc/gr_adreno_info.cpp
@@ -282,7 +282,15 @@
     case HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
       return ADRENO_PIXELFORMAT_ASTC_12X12_SRGB;
     default:
-      ALOGE("%s: No map for format: 0x%x", __FUNCTION__, hal_format);
+      // Because ag/12418822 to fix GCA camera-Berlin
+      // long shot issue (b/165335520) will cause log
+      // spew here, add below protected condition to avoid
+      // the log spew first and keep tracking the root cause
+      // on b/166142588.
+      if (hal_format != HAL_PIXEL_FORMAT_R_8)
+      {
+        ALOGE("%s: No map for format: 0x%x", __FUNCTION__, hal_format);
+      }
       break;
   }
 
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 18bd9a5..1c1ad98 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -204,7 +204,15 @@
       bpp = 2;
       break;
     default:
-      ALOGE("Error : %s New format request = 0x%x", __FUNCTION__, format);
+      // Because ag/12418822 to fix GCA camera-Berlin
+      // long shot issue (b/165335520) will cause log
+      // spew here, add below protected condition to avoid
+      // the log spew first and keep tracking the root cause
+      // on b/166142588.
+      if (format != HAL_PIXEL_FORMAT_R_8)
+      {
+        ALOGE("Error : %s New format request = 0x%x", __FUNCTION__, format);
+      }
       break;
   }