FWIW. I am able to rotate the screen 180 degrees. Using following
"change" but the screen gets transformed along the vertical axis at
regular interval, anyone has pointers as to why that would be?
( I know this an unusual situation, I am trying to salvage hardware
that was put together bit in haste using software solution... )
+++ b/services/java/com/android/server/wm/ScreenRotationAnimation.java
@@ -279,15 +279,16 @@ class ScreenRotationAnimation {
Matrix outMatrix) {
switch (rotation) {
case Surface.ROTATION_0:
- outMatrix.reset();
+ outMatrix.reset();
+ outMatrix.setRotate(180, 0, 0);
+ outMatrix.postTranslate(width, height);
break;
case Surface.ROTATION_90:
outMatrix.setRotate(90, 0, 0);
outMatrix.postTranslate(height, 0);
break;
case Surface.ROTATION_180:
- outMatrix.setRotate(180, 0, 0);
- outMatrix.postTranslate(width, height);
+ outMatrix.reset();
break;
case Surface.ROTATION_270:
outMatrix.setRotate(270, 0, 0);
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp
b/services/surfaceflinger/SurfaceFlinger.cpp
index 292b3ae..5914261 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2797,11 +2797,15 @@ void
GraphicPlane::setDisplayHardware(DisplayHardware *hw)
case 90:
displayOrientation = ISurfaceComposer::eOrientation90;
break;
+ case 180:
+ displayOrientation = ISurfaceComposer::eOrientation180;
+ break;
case 270:
displayOrientation = ISurfaceComposer::eOrientation270;
break;
}
}
+ displayOrientation = ISurfaceComposer::eOrientation180;
const float w = hw->getWidth();
const float h = hw->getHeight();
-Subodh