Merge Android Pie into master

Bug: 112104996
Change-Id: I61757fda78b0f72d99bac9e54aa0c7d5b7ea3a60
diff --git a/amber/camera/Android.bp b/amber/camera/Android.bp
new file mode 100644
index 0000000..d0d2dad
--- /dev/null
+++ b/amber/camera/Android.bp
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+cc_library_headers {
+    name: "libhdrplusclient_headers",
+    proprietary: true,
+    owner: "google",
+    host_supported: false,
+    export_include_dirs: [
+        "include",
+        "libhdrplusclient/include",
+    ],
+}
diff --git a/camera/Android.mk b/amber/camera/Android.mk
similarity index 100%
rename from camera/Android.mk
rename to amber/camera/Android.mk
diff --git a/camera/include/HdrPlusProfiler.h b/amber/camera/include/HdrPlusProfiler.h
similarity index 100%
rename from camera/include/HdrPlusProfiler.h
rename to amber/camera/include/HdrPlusProfiler.h
diff --git a/camera/include/HdrPlusTypes.h b/amber/camera/include/HdrPlusTypes.h
similarity index 99%
rename from camera/include/HdrPlusTypes.h
rename to amber/camera/include/HdrPlusTypes.h
index 9f66ffb..c24a60f 100644
--- a/camera/include/HdrPlusTypes.h
+++ b/amber/camera/include/HdrPlusTypes.h
@@ -232,6 +232,8 @@
 static const uint32_t DEBUG_PARAM_SAVE_GCAME_INPUT_METERING = (1u);
 static const uint32_t DEBUG_PARAM_SAVE_GCAME_INPUT_PAYLOAD  = (1u << 1);
 static const uint32_t DEBUG_PARAM_SAVE_GCAME_TEXT           = (1u << 2);
+static const uint32_t DEBUG_PARAM_SAVE_PROFILE              = (1u << 3);
+static const uint32_t DEBUG_PARAM_SAVE_GCAME_IPU_WATERMARK  = (1u << 4);
 
 /*
  * StaticMetadata defines a camera device's characteristics.
diff --git a/camera/libhdrplusclient/Android.mk b/amber/camera/libhdrplusclient/Android.mk
similarity index 88%
rename from camera/libhdrplusclient/Android.mk
rename to amber/camera/libhdrplusclient/Android.mk
index a24eeb2..249111a 100644
--- a/camera/libhdrplusclient/Android.mk
+++ b/amber/camera/libhdrplusclient/Android.mk
@@ -29,9 +29,13 @@
 ifeq ($(wildcard vendor/google_easel),)
     LOCAL_CFLAGS += -DUSE_DUMMY_IMPL=1
 else
+ifneq ($(TARGET_EASEL_VARIANT), amber)
+    LOCAL_CFLAGS += -DUSE_DUMMY_IMPL=1
+else
     LOCAL_CFLAGS += -DUSE_DUMMY_IMPL=0
     LOCAL_SHARED_LIBRARIES += libhdrplusclientimpl
 endif
+endif
 
 LOCAL_HEADER_LIBRARIES := \
     libsystem_headers \
@@ -41,13 +45,13 @@
 
 LOCAL_C_INCLUDES += \
     $(LOCAL_PATH)/include \
-    hardware/google/easel/camera/include
+    hardware/google/easel/amber/camera/include
 
 LOCAL_CFLAGS += -Wall -Wextra -Werror
 
 LOCAL_EXPORT_C_INCLUDE_DIRS += \
     $(LOCAL_PATH)/include \
-    hardware/google/easel/camera/include
+    hardware/google/easel/amber/camera/include
 
 LOCAL_MODULE:= libhdrplusclient
 LOCAL_PROPRIETARY_MODULE := true
diff --git a/camera/libhdrplusclient/EaselManagerClient.cpp b/amber/camera/libhdrplusclient/EaselManagerClient.cpp
similarity index 100%
rename from camera/libhdrplusclient/EaselManagerClient.cpp
rename to amber/camera/libhdrplusclient/EaselManagerClient.cpp
diff --git a/camera/libhdrplusclient/HdrPlusClientUtils.cpp b/amber/camera/libhdrplusclient/HdrPlusClientUtils.cpp
similarity index 100%
rename from camera/libhdrplusclient/HdrPlusClientUtils.cpp
rename to amber/camera/libhdrplusclient/HdrPlusClientUtils.cpp
diff --git a/camera/libhdrplusclient/include/EaselManagerClient.h b/amber/camera/libhdrplusclient/include/EaselManagerClient.h
similarity index 100%
rename from camera/libhdrplusclient/include/EaselManagerClient.h
rename to amber/camera/libhdrplusclient/include/EaselManagerClient.h
diff --git a/camera/libhdrplusclient/include/HdrPlusClient.h b/amber/camera/libhdrplusclient/include/HdrPlusClient.h
similarity index 96%
rename from camera/libhdrplusclient/include/HdrPlusClient.h
rename to amber/camera/libhdrplusclient/include/HdrPlusClient.h
index 40905cc..31f7124 100644
--- a/camera/libhdrplusclient/include/HdrPlusClient.h
+++ b/amber/camera/libhdrplusclient/include/HdrPlusClient.h
@@ -143,6 +143,12 @@
     virtual void notifyFrameMetadata(uint32_t frameNumber, const camera_metadata_t &resultMetadata,
             bool lastMetadata=true) = 0;
 
+    /*
+     * Notify Easel has encountered a fatal error and HDR+ client should stop sending messages
+     * to Easel.
+     */
+    virtual void nofityEaselFatalError() = 0;
+
 private:
     // Disallow copy and assign.
     HdrPlusClient(const HdrPlusClient&) = delete;
diff --git a/camera/libhdrplusclient/include/HdrPlusClientListener.h b/amber/camera/libhdrplusclient/include/HdrPlusClientListener.h
similarity index 100%
rename from camera/libhdrplusclient/include/HdrPlusClientListener.h
rename to amber/camera/libhdrplusclient/include/HdrPlusClientListener.h
diff --git a/camera/libhdrplusclient/include/HdrPlusClientUtils.h b/amber/camera/libhdrplusclient/include/HdrPlusClientUtils.h
similarity index 100%
rename from camera/libhdrplusclient/include/HdrPlusClientUtils.h
rename to amber/camera/libhdrplusclient/include/HdrPlusClientUtils.h