From c14bacf1fb511472138eeb5dc84a9423fc003214 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 23 Apr 2012 18:23:08 -0700 Subject: add a (hidden) api on Surface to query if the consumer is running behind the producer Change-Id: I71ec1602f66a4850b130893fc7017b5b1ac1b647 --- core/java/android/view/Surface.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/java/android/view/Surface.java') diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java index eb80290d5991..53af3c56bf21 100644 --- a/core/java/android/view/Surface.java +++ b/core/java/android/view/Surface.java @@ -323,6 +323,15 @@ public class Surface implements Parcelable { return mSurfaceGenerationId; } + + /** + * Whether the consumer of this Surface is running behind the producer; + * that is, isConsumerRunningBehind() returns true if the consumer is more + * than one buffer ahead of the producer. + * @hide + */ + public native boolean isConsumerRunningBehind(); + /** * A Canvas class that can handle the compatibility mode. This does two * things differently. -- cgit v1.2.3