Remove getInternalDisplayToken from ColorFade

There's no need for ColorFade to use the internal display token since it
already gets display info based on the displayId. It was only using the
display token to get colorMode but it's already stored in DisplayInfo

Test: ColorFadeTest
Bug: 242714168
Change-Id: I2261189135b21f9c34ed7a0120e111d0f3788da9
This commit is contained in:
Chavi Weingarten
2022-09-20 19:49:31 +00:00
parent 5473b217d7
commit d0ec3a75f6

View File

@@ -31,7 +31,6 @@ import android.opengl.EGLDisplay;
import android.opengl.EGLSurface;
import android.opengl.GLES11Ext;
import android.opengl.GLES20;
import android.os.IBinder;
import android.util.Slog;
import android.view.Display;
import android.view.DisplayInfo;
@@ -170,15 +169,7 @@ final class ColorFade {
mDisplayWidth = displayInfo.getNaturalWidth();
mDisplayHeight = displayInfo.getNaturalHeight();
final IBinder token = SurfaceControl.getInternalDisplayToken();
if (token == null) {
Slog.e(TAG,
"Failed to take screenshot because internal display is disconnected");
return false;
}
final boolean isWideColor = SurfaceControl.getDynamicDisplayInfo(token).activeColorMode
== Display.COLOR_MODE_DISPLAY_P3;
final boolean isWideColor = displayInfo.colorMode == Display.COLOR_MODE_DISPLAY_P3;
// Set mPrepared here so if initialization fails, resources can be cleaned up.
mPrepared = true;