Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 371b98f7 authored by Peiyong Lin's avatar Peiyong Lin
Browse files

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
parent edd7215f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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 jboolean nativeSetActiveConfig(JNIEnv* env, jclass clazz, jobject tokenOb
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 @@ static jboolean nativeSetActiveColorMode(JNIEnv* env, jclass,
    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;
}