Replace android_color_mode usage with ColorMode.
To ease the pain when we add color mode v1.1, we want to replace all
android_color_mode usage in framework native with ColorMode directly from HAL.
This patch cleans up usage in framework base because of the APIs call into
framework native gui.
BUG: 73824924
Test: Build & flash
Change-Id: I0f7af4cc41b832e977c15041de200733ca853cfe
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 8ca5062..7753c3f 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -36,8 +36,9 @@
#include <stdio.h>
#include <system/graphics.h>
#include <ui/DisplayInfo.h>
-#include <ui/HdrCapabilities.h>
#include <ui/FrameStats.h>
+#include <ui/GraphicsTypes.h>
+#include <ui/HdrCapabilities.h>
#include <ui/Rect.h>
#include <ui/Region.h>
#include <utils/Log.h>
@@ -593,7 +594,7 @@
static jintArray nativeGetDisplayColorModes(JNIEnv* env, jclass, jobject tokenObj) {
sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
if (token == NULL) return NULL;
- Vector<android_color_mode_t> colorModes;
+ Vector<ColorMode> colorModes;
if (SurfaceComposerClient::getDisplayColorModes(token, &colorModes) != NO_ERROR ||
colorModes.isEmpty()) {
return NULL;
@@ -623,7 +624,7 @@
sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
if (token == NULL) return JNI_FALSE;
status_t err = SurfaceComposerClient::setActiveColorMode(token,
- static_cast<android_color_mode_t>(colorMode));
+ static_cast<ColorMode>(colorMode));
return err == NO_ERROR ? JNI_TRUE : JNI_FALSE;
}