Loading core/java/android/view/SurfaceControl.java +6 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class SurfaceControl { boolean allLayers, boolean useIdentityTransform); private static native void nativeOpenTransaction(); private static native void nativeCloseTransaction(); private static native void nativeCloseTransaction(boolean sync); private static native void nativeSetAnimationTransaction(); private static native void nativeSetLayer(long nativeObject, int zorder); Loading Loading @@ -372,7 +372,11 @@ public class SurfaceControl { /** end a transaction */ public static void closeTransaction() { nativeCloseTransaction(); nativeCloseTransaction(false); } public static void closeTransactionSync() { nativeCloseTransaction(true); } public void deferTransactionUntil(IBinder handle, long frame) { Loading core/jni/android_view_SurfaceControl.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -223,8 +223,9 @@ static void nativeOpenTransaction(JNIEnv* env, jclass clazz) { SurfaceComposerClient::openGlobalTransaction(); } static void nativeCloseTransaction(JNIEnv* env, jclass clazz) { SurfaceComposerClient::closeGlobalTransaction(); static void nativeCloseTransaction(JNIEnv* env, jclass clazz, jboolean sync) { SurfaceComposerClient::closeGlobalTransaction(sync); } static void nativeSetAnimationTransaction(JNIEnv* env, jclass clazz) { Loading Loading @@ -649,7 +650,7 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeScreenshot }, {"nativeOpenTransaction", "()V", (void*)nativeOpenTransaction }, {"nativeCloseTransaction", "()V", {"nativeCloseTransaction", "(Z)V", (void*)nativeCloseTransaction }, {"nativeSetAnimationTransaction", "()V", (void*)nativeSetAnimationTransaction }, Loading services/core/java/com/android/server/wm/WindowManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -6386,6 +6386,11 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_SCREENSHOT && inRotation) Slog.v(TAG_WM, "Taking screenshot while rotating"); // We force pending transactions to flush before taking // the screenshot by pushing an empty synchronous transaction. SurfaceControl.openTransaction(); SurfaceControl.closeTransactionSync(); bm = SurfaceControl.screenshot(crop, width, height, minLayer, maxLayer, inRotation, rot); if (bm == null) { Loading Loading
core/java/android/view/SurfaceControl.java +6 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class SurfaceControl { boolean allLayers, boolean useIdentityTransform); private static native void nativeOpenTransaction(); private static native void nativeCloseTransaction(); private static native void nativeCloseTransaction(boolean sync); private static native void nativeSetAnimationTransaction(); private static native void nativeSetLayer(long nativeObject, int zorder); Loading Loading @@ -372,7 +372,11 @@ public class SurfaceControl { /** end a transaction */ public static void closeTransaction() { nativeCloseTransaction(); nativeCloseTransaction(false); } public static void closeTransactionSync() { nativeCloseTransaction(true); } public void deferTransactionUntil(IBinder handle, long frame) { Loading
core/jni/android_view_SurfaceControl.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -223,8 +223,9 @@ static void nativeOpenTransaction(JNIEnv* env, jclass clazz) { SurfaceComposerClient::openGlobalTransaction(); } static void nativeCloseTransaction(JNIEnv* env, jclass clazz) { SurfaceComposerClient::closeGlobalTransaction(); static void nativeCloseTransaction(JNIEnv* env, jclass clazz, jboolean sync) { SurfaceComposerClient::closeGlobalTransaction(sync); } static void nativeSetAnimationTransaction(JNIEnv* env, jclass clazz) { Loading Loading @@ -649,7 +650,7 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeScreenshot }, {"nativeOpenTransaction", "()V", (void*)nativeOpenTransaction }, {"nativeCloseTransaction", "()V", {"nativeCloseTransaction", "(Z)V", (void*)nativeCloseTransaction }, {"nativeSetAnimationTransaction", "()V", (void*)nativeSetAnimationTransaction }, Loading
services/core/java/com/android/server/wm/WindowManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -6386,6 +6386,11 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_SCREENSHOT && inRotation) Slog.v(TAG_WM, "Taking screenshot while rotating"); // We force pending transactions to flush before taking // the screenshot by pushing an empty synchronous transaction. SurfaceControl.openTransaction(); SurfaceControl.closeTransactionSync(); bm = SurfaceControl.screenshot(crop, width, height, minLayer, maxLayer, inRotation, rot); if (bm == null) { Loading