summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-10-08 19:17:06 -0700
committerJeff Brown <jeffbrown@google.com>2012-10-08 19:23:15 -0700
commit9e316a1a2a8d734315bbd56a85308f9657a92913 (patch)
treeff72f3b90a0e585ef183ff4339a9450ebdd5b174 /core/jni
parent2aac1a0fe8fe5dea1185374ed914f95101de16ed (diff)
downloadframeworks_base-9e316a1a2a8d734315bbd56a85308f9657a92913.zip
frameworks_base-9e316a1a2a8d734315bbd56a85308f9657a92913.tar.gz
frameworks_base-9e316a1a2a8d734315bbd56a85308f9657a92913.tar.bz2
Blank or unblank all displays as need.
Ensures that both the internal display and HDMI are blanked or unblanked in tandem. Bug: 7309812 Change-Id: Ie8b96d393e8bb20d23c92f3320142d9f7cf42aff
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_view_Surface.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index fc04cd1..4982f31 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -48,6 +48,7 @@
#include <android_runtime/android_view_SurfaceSession.h>
#include <android_runtime/android_graphics_SurfaceTexture.h>
#include <utils/misc.h>
+#include <utils/Log.h>
#include <ScopedUtfChars.h>
@@ -710,6 +711,22 @@ static jboolean nativeGetDisplayInfo(JNIEnv* env, jclass clazz,
return JNI_TRUE;
}
+static void nativeBlankDisplay(JNIEnv* env, jclass clazz, jobject tokenObj) {
+ sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
+ if (token == NULL) return;
+
+ ALOGD_IF_SLOW(100, "Excessive delay in blankDisplay() while turning screen off");
+ SurfaceComposerClient::blankDisplay(token);
+}
+
+static void nativeUnblankDisplay(JNIEnv* env, jclass clazz, jobject tokenObj) {
+ sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
+ if (token == NULL) return;
+
+ ALOGD_IF_SLOW(100, "Excessive delay in unblankDisplay() while turning screen on");
+ SurfaceComposerClient::unblankDisplay(token);
+}
+
// ----------------------------------------------------------------------------
static void nativeCopyFrom(JNIEnv* env, jobject surfaceObj, jobject otherObj) {
@@ -832,6 +849,10 @@ static JNINativeMethod gSurfaceMethods[] = {
(void*)nativeSetDisplayProjection },
{"nativeGetDisplayInfo", "(Landroid/os/IBinder;Landroid/view/Surface$PhysicalDisplayInfo;)Z",
(void*)nativeGetDisplayInfo },
+ {"nativeBlankDisplay", "(Landroid/os/IBinder;)V",
+ (void*)nativeBlankDisplay },
+ {"nativeUnblankDisplay", "(Landroid/os/IBinder;)V",
+ (void*)nativeUnblankDisplay },
{"nativeCopyFrom", "(Landroid/view/Surface;)V",
(void*)nativeCopyFrom },
{"nativeTransferFrom", "(Landroid/view/Surface;)V",