diff options
author | Mathias Agopian <> | 2009-03-27 16:10:37 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-27 16:10:37 -0700 |
commit | 66b8ec99c5fc505877b3711a52e284bbb451f836 (patch) | |
tree | 7551907d6083bcd455632f84f528cbd4d06ffd04 /core | |
parent | 1e880dba106b14619c3eaf94c5dc2d1a943645bc (diff) | |
download | frameworks_base-66b8ec99c5fc505877b3711a52e284bbb451f836.zip frameworks_base-66b8ec99c5fc505877b3711a52e284bbb451f836.tar.gz frameworks_base-66b8ec99c5fc505877b3711a52e284bbb451f836.tar.bz2 |
AI 143171: am: CL 142873 fix [1732012] Only show screen rotation animation when triggered by sensor
Original author: mathias
Merged from: //branches/cupcake/...
Automated import of CL 143171
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 }, |