Loading core/java/android/view/SurfaceControl.java +19 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,9 @@ public final class SurfaceControl implements Parcelable { private static native void nativeSanitize(long transactionObject); private static native void nativeSetDestinationFrame(long transactionObj, long nativeObject, int l, int t, int r, int b); private static native void nativeSetDefaultApplyToken(IBinder token); private static native IBinder nativeGetDefaultApplyToken(); /** * Transforms that can be applied to buffers as they are displayed to a window. Loading Loading @@ -2773,6 +2776,22 @@ public final class SurfaceControl implements Parcelable { readFromParcel(in); } /** * * @hide */ public static void setDefaultApplyToken(IBinder token) { nativeSetDefaultApplyToken(token); } /** * * @hide */ public static IBinder getDefaultApplyToken() { return nativeGetDefaultApplyToken(); } /** * Apply the transaction, clearing it's state, and making it usable * as a new transaction. Loading core/jni/android_view_SurfaceControl.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -2121,6 +2121,20 @@ static jint nativeGetLayerId(JNIEnv* env, jclass clazz, jlong nativeSurfaceContr return surface->getLayerId(); } static void nativeSetDefaultApplyToken(JNIEnv* env, jclass clazz, jobject applyToken) { sp<IBinder> token(ibinderForJavaObject(env, applyToken)); if (token == nullptr) { ALOGE("Null apply token provided."); return; } SurfaceComposerClient::Transaction::setDefaultApplyToken(token); } static jobject nativeGetDefaultApplyToken(JNIEnv* env, jclass clazz) { sp<IBinder> token = SurfaceComposerClient::Transaction::getDefaultApplyToken(); return javaObjectForIBinder(env, token); } // ---------------------------------------------------------------------------- static const JNINativeMethod sSurfaceControlMethods[] = { Loading Loading @@ -2343,6 +2357,10 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*) nativeSanitize }, {"nativeSetDestinationFrame", "(JJIIII)V", (void*)nativeSetDestinationFrame }, {"nativeSetDefaultApplyToken", "(Landroid/os/IBinder;)V", (void*)nativeSetDefaultApplyToken }, {"nativeGetDefaultApplyToken", "()Landroid/os/IBinder;", (void*)nativeGetDefaultApplyToken }, // clang-format on }; Loading Loading
core/java/android/view/SurfaceControl.java +19 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,9 @@ public final class SurfaceControl implements Parcelable { private static native void nativeSanitize(long transactionObject); private static native void nativeSetDestinationFrame(long transactionObj, long nativeObject, int l, int t, int r, int b); private static native void nativeSetDefaultApplyToken(IBinder token); private static native IBinder nativeGetDefaultApplyToken(); /** * Transforms that can be applied to buffers as they are displayed to a window. Loading Loading @@ -2773,6 +2776,22 @@ public final class SurfaceControl implements Parcelable { readFromParcel(in); } /** * * @hide */ public static void setDefaultApplyToken(IBinder token) { nativeSetDefaultApplyToken(token); } /** * * @hide */ public static IBinder getDefaultApplyToken() { return nativeGetDefaultApplyToken(); } /** * Apply the transaction, clearing it's state, and making it usable * as a new transaction. Loading
core/jni/android_view_SurfaceControl.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -2121,6 +2121,20 @@ static jint nativeGetLayerId(JNIEnv* env, jclass clazz, jlong nativeSurfaceContr return surface->getLayerId(); } static void nativeSetDefaultApplyToken(JNIEnv* env, jclass clazz, jobject applyToken) { sp<IBinder> token(ibinderForJavaObject(env, applyToken)); if (token == nullptr) { ALOGE("Null apply token provided."); return; } SurfaceComposerClient::Transaction::setDefaultApplyToken(token); } static jobject nativeGetDefaultApplyToken(JNIEnv* env, jclass clazz) { sp<IBinder> token = SurfaceComposerClient::Transaction::getDefaultApplyToken(); return javaObjectForIBinder(env, token); } // ---------------------------------------------------------------------------- static const JNINativeMethod sSurfaceControlMethods[] = { Loading Loading @@ -2343,6 +2357,10 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*) nativeSanitize }, {"nativeSetDestinationFrame", "(JJIIII)V", (void*)nativeSetDestinationFrame }, {"nativeSetDefaultApplyToken", "(Landroid/os/IBinder;)V", (void*)nativeSetDefaultApplyToken }, {"nativeGetDefaultApplyToken", "()Landroid/os/IBinder;", (void*)nativeGetDefaultApplyToken }, // clang-format on }; Loading