summaryrefslogtreecommitdiff
path: root/libs/surfaceflinger/OrientationAnimation.cpp
diff options
context:
space:
mode:
author Mathias Agopian <> 2009-03-27 18:11:38 -0700
committer The Android Open Source Project <initial-contribution@android.com> 2009-03-27 18:11:38 -0700
commiteb0c86e18b7d620b679ff2a45a0233867a53a334 (patch)
tree9202e5ef5179bf79540459845de414ddb5df719e /libs/surfaceflinger/OrientationAnimation.cpp
parente4fbd6235c8d1c5b0ed4883ec275dd3fc9c919fb (diff)
AI 143320: am: CL 143171 am: CL 142873 fix [1732012] Only show screen rotation animation when triggered by sensor
Original author: mathias Merged from: //branches/cupcake/... Original author: android-build Merged from: //branches/donutburger/... Automated import of CL 143320
Diffstat (limited to 'libs/surfaceflinger/OrientationAnimation.cpp')
-rw-r--r--libs/surfaceflinger/OrientationAnimation.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/libs/surfaceflinger/OrientationAnimation.cpp b/libs/surfaceflinger/OrientationAnimation.cpp
index e59688e43a96..70eec8d68e1f 100644
--- a/libs/surfaceflinger/OrientationAnimation.cpp
+++ b/libs/surfaceflinger/OrientationAnimation.cpp
@@ -44,10 +44,14 @@ OrientationAnimation::~OrientationAnimation()
{
}
-void OrientationAnimation::onOrientationChanged()
+void OrientationAnimation::onOrientationChanged(uint32_t type)
{
- if (mState == DONE)
- mState = PREPARE;
+ if (mState == DONE) {
+ mType = type;
+ if (!(type & ISurfaceComposer::eOrientationAnimationDisable)) {
+ mState = PREPARE;
+ }
+ }
}
void OrientationAnimation::onAnimationFinished()
@@ -82,14 +86,7 @@ bool OrientationAnimation::run_impl()
bool OrientationAnimation::done()
{
- if (mFlinger->isFrozen()) {
- // we are not allowed to draw, but pause a bit to make sure
- // apps don't end up using the whole CPU, if they depend on
- // surfaceflinger for synchronization.
- usleep(8333); // 8.3ms ~ 120fps
- return true;
- }
- return false;
+ return done_impl();
}
bool OrientationAnimation::prepare()
@@ -115,11 +112,13 @@ bool OrientationAnimation::prepare()
LayerOrientationAnimBase* l;
- l = new LayerOrientationAnim(
- mFlinger.get(), 0, this, bitmap, bitmapIn);
-
- //l = new LayerOrientationAnimRotate(
- // mFlinger.get(), 0, this, bitmap, bitmapIn);
+ if (mType & 0x80) {
+ l = new LayerOrientationAnimRotate(
+ mFlinger.get(), 0, this, bitmap, bitmapIn);
+ } else {
+ l = new LayerOrientationAnim(
+ mFlinger.get(), 0, this, bitmap, bitmapIn);
+ }
l->initStates(w, h, 0);
l->setLayer(INT_MAX-1);