android的启动动画旋转180
sd1/NXP/VT-SBC-BIOL/frameworks/base$ git diff .
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index cdd80150f19..53caddca450 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -391,7 +391,7 @@ status_t BootAnimation::readyToRun() {
SurfaceComposerClient::Transaction t;
Rect displayRect(resolution.getWidth(),resolution.getHeight());
- t.setDisplayProjection(mDisplayToken, ui::ROTATION_0, displayRect, displayRect);
+ t.setDisplayProjection(mDisplayToken, ui::ROTATION_180, displayRect, displayRect);
// this guest property specifies multi-display IDs to show the boot animation
// multiple ids can be set with comma (,) as separator, for example:
@@ -1259,7 +1259,7 @@ void BootAnimation::handleViewport(nsecs_t timestep) {
SurfaceComposerClient::Transaction t;
t.setPosition(mFlingerSurfaceControl, 0, -mTargetInset)
.setCrop(mFlingerSurfaceControl, Rect(0, mTargetInset, mWidth, mHeight));
- t.setDisplayProjection(mDisplayToken, ui::ROTATION_0, layerStackRect, displayRect);
+ t.setDisplayProjection(mDisplayToken, ui::ROTATION_180, layerStackRect, displayRect);
t.apply();
android的界面旋转180(有问题,清理后台是反向显示的)
diff --git a/services/core/java/com/android/server/wm/DisplayRotation.java b/services/core/java/com/android/server/wm/DisplayRotation.java
index 1284e009ee3..e8d31fff84d 100644
--- a/services/core/java/com/android/server/wm/DisplayRotation.java
+++ b/services/core/java/com/android/server/wm/DisplayRotation.java
@@ -120,7 +120,7 @@ public class DisplayRotation {
* @see #updateRotationUnchecked
*/
@Surface.Rotation
- private int mRotation;
+ private int mRotation = 2;
@VisibleForTesting
int mLandscapeRotation; // default landscape
@@ -351,7 +351,7 @@ public class DisplayRotation {
@Surface.Rotation
int getRotation() {
- return mRotation;
+ return 2;
}
rockchip的会有一个对应的宏在device目录下
./BoardConfig.mk:#0: ROTATION_NONE ORIENTATION_0 : 0
./BoardConfig.mk:#90: ROTATION_RIGHT ORIENTATION_90 : 90
./BoardConfig.mk:#180: ROTATION_DOWN ORIENTATION_180: 180
./BoardConfig.mk:#270: ROTATION_LEFT ORIENTATION_270: 270
./BoardConfig.mk:TARGET_RECOVERY_DEFAULT_ROTATION ?= ROTATION_NONE
这里就说明他可以修改对应的结果进行一个旋转。而nxp的没有这个宏