Merge "Handle orientation changes more systematically. Bug: 4981385"

This commit is contained in:
Jeff Brown 2011-09-21 21:09:10 -07:00 committed by Android (Google) Code Review
commit 701e51ac7e
3 changed files with 5 additions and 9 deletions

View File

@ -88,11 +88,6 @@ public:
eElectronBeamAnimationOff = 0x10
};
// flags for setOrientation
enum {
eOrientationAnimationDisable = 0x00000001
};
/* create connection with surface flinger, requires
* ACCESS_SURFACE_FLINGER permission
*/
@ -112,7 +107,8 @@ public:
virtual status_t freezeDisplay(DisplayID dpy, uint32_t flags) = 0;
virtual status_t unfreezeDisplay(DisplayID dpy, uint32_t flags) = 0;
/* Set display orientation. requires ACCESS_SURFACE_FLINGER permission */
/* Set display orientation. requires ACCESS_SURFACE_FLINGER permission
* No flags are currently defined. Set flags to 0. */
virtual int setOrientation(DisplayID dpy, int orientation, uint32_t flags) = 0;
/* signal that we're done booting.

View File

@ -566,7 +566,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
const int dpy = 0;
const int orientation = mCurrentState.orientation;
const uint32_t type = mCurrentState.orientationType;
// Currently unused: const uint32_t flags = mCurrentState.orientationFlags;
GraphicPlane& plane(graphicPlane(dpy));
plane.setOrientation(orientation);
@ -1299,7 +1299,7 @@ int SurfaceFlinger::setOrientation(DisplayID dpy,
Mutex::Autolock _l(mStateLock);
if (mCurrentState.orientation != orientation) {
if (uint32_t(orientation)<=eOrientation270 || orientation==42) {
mCurrentState.orientationType = flags;
mCurrentState.orientationFlags = flags;
mCurrentState.orientation = orientation;
setTransactionFlags(eTransactionNeeded);
mTransactionCV.wait(mStateLock);

View File

@ -245,7 +245,7 @@ private:
}
LayerVector layersSortedByZ;
uint8_t orientation;
uint8_t orientationType;
uint8_t orientationFlags;
uint8_t freezeDisplay;
};