diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/Surface.java | 19 | ||||
-rw-r--r-- | core/jni/android_view_Surface.cpp | 6 |
2 files changed, 21 insertions, 4 deletions
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java index 54ccf33..0178d63 100644 --- a/core/java/android/view/Surface.java +++ b/core/java/android/view/Surface.java @@ -118,6 +118,12 @@ public class Surface implements Parcelable { public static final int ROTATION_180 = 2; public static final int ROTATION_270 = 3; + /** + * Disable the orientation animation + * {@hide} + */ + public static final int FLAGS_ORIENTATION_ANIMATION_DISABLE = 0x000000001; + @SuppressWarnings("unused") private int mSurface; @SuppressWarnings("unused") @@ -226,10 +232,21 @@ public class Surface implements Parcelable { * set the orientation of the given display. * @param display * @param orientation + * @param flags + * {@hide} */ - public static native void setOrientation(int display, int orientation); + public static native void setOrientation(int display, int orientation, int flags); /** + * set the orientation of the given display. + * @param display + * @param orientation + */ + public static void setOrientation(int display, int orientation) { + setOrientation(display, orientation, 0); + } + + /** * set surface parameters. * needs to be inside open/closeTransaction block */ diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp index 8baaa84..076775f 100644 --- a/core/jni/android_view_Surface.cpp +++ b/core/jni/android_view_Surface.cpp @@ -324,9 +324,9 @@ static void Surface_closeTransaction( } static void Surface_setOrientation( - JNIEnv* env, jobject clazz, jint display, jint orientation) + JNIEnv* env, jobject clazz, jint display, jint orientation, jint flags) { - int err = SurfaceComposerClient::setOrientation(display, orientation); + int err = SurfaceComposerClient::setOrientation(display, orientation, flags); if (err < 0) { doThrow(env, "java/lang/IllegalArgumentException", NULL); } @@ -565,7 +565,7 @@ static JNINativeMethod gSurfaceMethods[] = { {"unlockCanvas", "(Landroid/graphics/Canvas;)V", (void*)Surface_unlockCanvas }, {"openTransaction", "()V", (void*)Surface_openTransaction }, {"closeTransaction", "()V", (void*)Surface_closeTransaction }, - {"setOrientation", "(II)V", (void*)Surface_setOrientation }, + {"setOrientation", "(III)V", (void*)Surface_setOrientation }, {"freezeDisplay", "(I)V", (void*)Surface_freezeDisplay }, {"unfreezeDisplay", "(I)V", (void*)Surface_unfreezeDisplay }, {"setLayer", "(I)V", (void*)Surface_setLayer }, |