Add pixel-display interface

The interfaces is for display high brightness mode
and display local brightness enhancement.

Bug:154066722

Test: build
Change-Id: I21a24d9982df1ca34434c7f6f6168b38cf6ecaaf
diff --git a/display/Android.bp b/display/Android.bp
new file mode 100644
index 0000000..78c2885
--- /dev/null
+++ b/display/Android.bp
@@ -0,0 +1,19 @@
+aidl_interface {
+    name: "com.google.hardware.pixel.display",
+    vendor_available: true,
+    srcs: [
+        "com/google/hardware/pixel/display/*.aidl",
+    ],
+
+    stability: "vintf",
+
+    backend: {
+        java: {
+            platform_apis: true,
+        },
+        cpp: {
+            enabled: false,
+        },
+    },
+    versions: ["1"],
+}
diff --git a/display/aidl_api/com.google.hardware.pixel.display/1/.hash b/display/aidl_api/com.google.hardware.pixel.display/1/.hash
new file mode 100644
index 0000000..08e4043
--- /dev/null
+++ b/display/aidl_api/com.google.hardware.pixel.display/1/.hash
@@ -0,0 +1 @@
+b8ea6e2c79ac4b3f458cb195c70420250eea6614
diff --git a/display/aidl_api/com.google.hardware.pixel.display/1/com/google/hardware/pixel/display/HbmState.aidl b/display/aidl_api/com.google.hardware.pixel.display/1/com/google/hardware/pixel/display/HbmState.aidl
new file mode 100644
index 0000000..440a95e
--- /dev/null
+++ b/display/aidl_api/com.google.hardware.pixel.display/1/com/google/hardware/pixel/display/HbmState.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package com.google.hardware.pixel.display;
+@Backing(type="byte") @VintfStability
+enum HbmState {
+  OFF = 0,
+  HDR = 1,
+  SUNLIGHT = 2,
+}
diff --git a/display/aidl_api/com.google.hardware.pixel.display/1/com/google/hardware/pixel/display/IDisplay.aidl b/display/aidl_api/com.google.hardware.pixel.display/1/com/google/hardware/pixel/display/IDisplay.aidl
new file mode 100644
index 0000000..df43035
--- /dev/null
+++ b/display/aidl_api/com.google.hardware.pixel.display/1/com/google/hardware/pixel/display/IDisplay.aidl
@@ -0,0 +1,28 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package com.google.hardware.pixel.display;
+@VintfStability
+interface IDisplay {
+  boolean isHbmSupported();
+  void setHbmState(in com.google.hardware.pixel.display.HbmState state);
+  com.google.hardware.pixel.display.HbmState getHbmState();
+  boolean isLbeSupported();
+  void setLbeState(in com.google.hardware.pixel.display.LbeState state);
+  void setLbeAmbientLight(in int ambientLux);
+  com.google.hardware.pixel.display.LbeState getLbeState();
+}
diff --git a/display/aidl_api/com.google.hardware.pixel.display/1/com/google/hardware/pixel/display/LbeState.aidl b/display/aidl_api/com.google.hardware.pixel.display/1/com/google/hardware/pixel/display/LbeState.aidl
new file mode 100644
index 0000000..0e4985a
--- /dev/null
+++ b/display/aidl_api/com.google.hardware.pixel.display/1/com/google/hardware/pixel/display/LbeState.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package com.google.hardware.pixel.display;
+@Backing(type="byte") @VintfStability
+enum LbeState {
+  OFF = 0,
+  NORMAL = 1,
+  HIGH_BRIGHTNESS = 2,
+  POWER_SAVE = 3,
+}
diff --git a/display/aidl_api/com.google.hardware.pixel.display/current/com/google/hardware/pixel/display/HbmState.aidl b/display/aidl_api/com.google.hardware.pixel.display/current/com/google/hardware/pixel/display/HbmState.aidl
new file mode 100644
index 0000000..440a95e
--- /dev/null
+++ b/display/aidl_api/com.google.hardware.pixel.display/current/com/google/hardware/pixel/display/HbmState.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package com.google.hardware.pixel.display;
+@Backing(type="byte") @VintfStability
+enum HbmState {
+  OFF = 0,
+  HDR = 1,
+  SUNLIGHT = 2,
+}
diff --git a/display/aidl_api/com.google.hardware.pixel.display/current/com/google/hardware/pixel/display/IDisplay.aidl b/display/aidl_api/com.google.hardware.pixel.display/current/com/google/hardware/pixel/display/IDisplay.aidl
new file mode 100644
index 0000000..df43035
--- /dev/null
+++ b/display/aidl_api/com.google.hardware.pixel.display/current/com/google/hardware/pixel/display/IDisplay.aidl
@@ -0,0 +1,28 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package com.google.hardware.pixel.display;
+@VintfStability
+interface IDisplay {
+  boolean isHbmSupported();
+  void setHbmState(in com.google.hardware.pixel.display.HbmState state);
+  com.google.hardware.pixel.display.HbmState getHbmState();
+  boolean isLbeSupported();
+  void setLbeState(in com.google.hardware.pixel.display.LbeState state);
+  void setLbeAmbientLight(in int ambientLux);
+  com.google.hardware.pixel.display.LbeState getLbeState();
+}
diff --git a/display/aidl_api/com.google.hardware.pixel.display/current/com/google/hardware/pixel/display/LbeState.aidl b/display/aidl_api/com.google.hardware.pixel.display/current/com/google/hardware/pixel/display/LbeState.aidl
new file mode 100644
index 0000000..0e4985a
--- /dev/null
+++ b/display/aidl_api/com.google.hardware.pixel.display/current/com/google/hardware/pixel/display/LbeState.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package com.google.hardware.pixel.display;
+@Backing(type="byte") @VintfStability
+enum LbeState {
+  OFF = 0,
+  NORMAL = 1,
+  HIGH_BRIGHTNESS = 2,
+  POWER_SAVE = 3,
+}
diff --git a/display/com/google/hardware/pixel/display/HbmState.aidl b/display/com/google/hardware/pixel/display/HbmState.aidl
new file mode 100644
index 0000000..39270a2
--- /dev/null
+++ b/display/com/google/hardware/pixel/display/HbmState.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+package com.google.hardware.pixel.display;
+
+@VintfStability
+@Backing(type="byte")
+enum HbmState {
+    OFF = 0,
+    HDR = 1,
+    SUNLIGHT = 2,
+}
diff --git a/display/com/google/hardware/pixel/display/IDisplay.aidl b/display/com/google/hardware/pixel/display/IDisplay.aidl
new file mode 100644
index 0000000..ff60b89
--- /dev/null
+++ b/display/com/google/hardware/pixel/display/IDisplay.aidl
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+package com.google.hardware.pixel.display;
+
+import com.google.hardware.pixel.display.HbmState;
+import com.google.hardware.pixel.display.LbeState;
+
+@VintfStability
+interface IDisplay {
+    /**
+     * Query Display High Brightness Mode Supported
+     *
+     * @return true if HBM is supported on this platform.
+     *         If false, HBM is not supported.
+     */
+    boolean isHbmSupported();
+
+    /**
+     * Set Display High Brightness Mode
+     *
+     * @param state to be queried.
+     */
+    void setHbmState(in HbmState state);
+
+    /**
+     * Get Display High Brightness Mode State
+     *
+     * @return state of display high brightness mode
+     */
+    HbmState getHbmState();
+
+    /**
+     * Query Display Local Brightness Enhancement Supported
+     *
+     * @return true if LBE is supported on this platform.
+     *         If false, LBE is not supported.
+     */
+    boolean isLbeSupported();
+
+    /**
+     * Set Display Local Brightness Enhancement
+     *
+     * @param state to be queried.
+     */
+    void setLbeState(in LbeState state);
+
+    /**
+     * Set Display Local Brightness Enhancement Ambient Light
+     *
+     * @param ambientLux the proper ambient light in Lux.
+     *        The value is equal to zero or above zero.
+     */
+    void setLbeAmbientLight(in int ambientLux);
+
+    /**
+     * Get Display Local Brightness Enhancement State
+     *
+     * @return state of display local brightness enhancement
+     */
+    LbeState getLbeState();
+}
diff --git a/display/com/google/hardware/pixel/display/LbeState.aidl b/display/com/google/hardware/pixel/display/LbeState.aidl
new file mode 100644
index 0000000..810dcc7
--- /dev/null
+++ b/display/com/google/hardware/pixel/display/LbeState.aidl
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+package com.google.hardware.pixel.display;
+
+@VintfStability
+@Backing(type="byte")
+enum LbeState {
+    OFF = 0,
+    NORMAL = 1,
+    HIGH_BRIGHTNESS = 2,
+    POWER_SAVE = 3,
+}