From e8d9d6526644cc8601352ab0291f0b4566f9175e Mon Sep 17 00:00:00 2001 From: Steven Thomas Date: Fri, 3 Jan 2020 16:14:21 -0800 Subject: [PATCH] Make setActiveConfig() private, remove plumbing This is to address leftover code review feedback from ag/9714241. We no longer use setActiveConfig() except for a call from an internal debug command, so make it private, and remove the plumbing to support calling it from other processes. Bug: 142507213 Test: atest libsurfaceflinger_unittest Test: atest libgui_test Test: atest SurfaceFlinger_test Test: atest sffakehwc_test Change-Id: I8ae9c2636fc009a7ebeba06a72913a37a6af8ef4 --- core/java/android/view/SurfaceControl.java | 11 ----------- core/jni/android_view_SurfaceControl.cpp | 9 --------- 2 files changed, 20 deletions(-) diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index f6d6522f80d60..a4c2167a925c8 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -157,7 +157,6 @@ public final class SurfaceControl implements Parcelable { private static native DisplayedContentSample nativeGetDisplayedContentSample( IBinder displayToken, long numFrames, long timestamp); private static native int nativeGetActiveConfig(IBinder displayToken); - private static native boolean nativeSetActiveConfig(IBinder displayToken, int id); private static native boolean nativeSetDesiredDisplayConfigSpecs(IBinder displayToken, SurfaceControl.DesiredDisplayConfigSpecs desiredDisplayConfigSpecs); private static native SurfaceControl.DesiredDisplayConfigSpecs @@ -1473,16 +1472,6 @@ public final class SurfaceControl implements Parcelable { } - /** - * @hide - */ - public static boolean setActiveConfig(IBinder displayToken, int id) { - if (displayToken == null) { - throw new IllegalArgumentException("displayToken must not be null"); - } - return nativeSetActiveConfig(displayToken, id); - } - /** * Contains information about desired display configuration. * diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp index 4a7276c4f94e3..ee8a7b351c8c5 100644 --- a/core/jni/android_view_SurfaceControl.cpp +++ b/core/jni/android_view_SurfaceControl.cpp @@ -816,13 +816,6 @@ static jint nativeGetActiveConfig(JNIEnv* env, jclass clazz, jobject tokenObj) { return static_cast(SurfaceComposerClient::getActiveConfig(token)); } -static jboolean nativeSetActiveConfig(JNIEnv* env, jclass clazz, jobject tokenObj, jint id) { - sp token(ibinderForJavaObject(env, tokenObj)); - if (token == NULL) return JNI_FALSE; - status_t err = SurfaceComposerClient::setActiveConfig(token, static_cast(id)); - return err == NO_ERROR ? JNI_TRUE : JNI_FALSE; -} - static jintArray nativeGetDisplayColorModes(JNIEnv* env, jclass, jobject tokenObj) { sp token(ibinderForJavaObject(env, tokenObj)); if (token == NULL) return NULL; @@ -1388,8 +1381,6 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeGetDisplayConfigs }, {"nativeGetActiveConfig", "(Landroid/os/IBinder;)I", (void*)nativeGetActiveConfig }, - {"nativeSetActiveConfig", "(Landroid/os/IBinder;I)Z", - (void*)nativeSetActiveConfig }, {"nativeSetDesiredDisplayConfigSpecs", "(Landroid/os/IBinder;Landroid/view/SurfaceControl$DesiredDisplayConfigSpecs;)Z", (void*)nativeSetDesiredDisplayConfigSpecs },