1拷贝横屏logo和关机充电动画图片
将BOOT_LOGO改为横屏:BOOT_LOGO := wuxganl
2开机logo显示横屏
diff --git a/vendor/mediatek/proprietary/bootable/bootloader/lk/platform/[xxxx]/mt_logo.c b/vendor/mediatek/proprietary/bootable/bootloader/lk/platform/[xxxx]/mt_logo.c
index 62d5a55..bae9e62 100644
--- a/vendor/mediatek/proprietary/bootable/bootloader/lk/platform/[xxxx]/mt_logo.c
+++ b/vendor/mediatek/proprietary/bootable/bootloader/lk/platform/[xxxx]/mt_logo.c
@@ -85,6 +85,8 @@ void init_fb_screen()
} else {
phical_screen.rotation = 0;
}
+ phical_screen.rotation = 270;//有可能是90,看需求
sync_anim_version();
if (show_animationm_ver == 1) {
3关机充电显示横屏
diff --git a/vendor/mediatek/proprietary/external/libshowlogo/charging_animation.cpp b/vendor/mediatek/proprietary/external/libshowlogo/charging_animation.cpp
index 6d4fde0..795d331 100644
--- a/vendor/mediatek/proprietary/external/libshowlogo/charging_animation.cpp
+++ b/vendor/mediatek/proprietary/external/libshowlogo/charging_animation.cpp
@@ -753,6 +753,8 @@ int anim_fb_init(void)
} else {
phical_screen.rotation = 0;
}
+ phical_screen.rotation = 270;//有可能是90
if (MTK_LOG_ENABLE == 1) {
SLOGD("[libshowlogo]phical_screen: width= %d,height= %d,bits_per_pixel =%d,needAllign = %d,allignWidth=%d rotation =%d ,need180Adjust = %d\n",
phical_screen.width, phical_screen.height,
diff --git a/vendor/mediatek/proprietary/external/libshowlogo/utils.cpp b/vendor/mediatek/proprietary/external/libshowlogo/utils.cpp
index 0db0516..729c5ac 100644
--- a/vendor/mediatek/proprietary/external/libshowlogo/utils.cpp
+++ b/vendor/mediatek/proprietary/external/libshowlogo/utils.cpp
@@ -59,5 +59,6 @@ int getRotation() {
break;
}
}
+ rotation = Rotation::ORIENTATION_270;//有可能是90
return rotation;
}
4开机动画显示横屏
diff --git a/frameworks/base/cmds/bootanimation/BootAnimation.cpp b/frameworks/base/cmds/bootanimation/BootAnimation.cpp
old mode 100644
new mode 100755
index bb2de17..60fe4bf
--- a/frameworks/base/cmds/bootanimation/BootAnimation.cpp
+++ b/frameworks/base/cmds/bootanimation/BootAnimation.cpp
@@ -384,12 +384,14 @@ status_t BootAnimation::readyToRun() {
mMaxWidth = android::base::GetIntProperty("ro.surface_flinger.max_graphics_width", 0);
mMaxHeight = android::base::GetIntProperty("ro.surface_flinger.max_graphics_height", 0);
ui::Size resolution = displayConfig.resolution;
- resolution = limitSurfaceSize(resolution.width, resolution.height);
+ resolution = limitSurfaceSize(resolution.height, resolution.width);
// create the native surface
sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
resolution.getWidth(), resolution.getHeight(), PIXEL_FORMAT_RGB_565);
SurfaceComposerClient::Transaction t;
+ Rect destRect(resolution.getHeight(), resolution.getWidth());
+ t.setDisplayProjection(mDisplayToken, ui::ROTATION_90, destRect, destRect);//ui::ROTATION_90 不是固定的,和MTK_LCM_PHYSICAL_ROTATION有关系
// this guest property specifies multi-display IDs to show the boot animation
// multiple ids can be set with comma (,) as separator, for example:
5开机动画显示错乱,先横屏后竖屏
--- a/frameworks/base/services/core/java/com/android/server/wm/DisplayRotation.java
+++ b/frameworks/base/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=1;//可能是其他值,需要调整
@VisibleForTesting
int mLandscapeRotation; // default landscape
@@ -1184,7 +1184,6 @@ public class DisplayRotation {
// We will do exactly what the application asked us to do.
preferredRotation = -1;
}
-
switch (orientation) {
case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
// Return portrait unless overridden.
@@ -1239,10 +1238,13 @@ public class DisplayRotation {
default:
// For USER, UNSPECIFIED, NOSENSOR, SENSOR and FULL_SENSOR,
// just return the preferred orientation we already calculated.
- if (preferredRotation >= 0) {
+ if (orientation == 2){/
+ return Surface.ROTATION_90;//可能是其他值,需要调整
+ }
+ if (preferredRotation >= 0) {
return preferredRotation;
}
- return Surface.ROTATION_0;
+ return Surface.ROTATION_90;//可能是其他值,需要调整
}
}
6recovery 显示横屏
--- a/bootable/recovery/minui/graphics.cpp
+++ b/bootable/recovery/minui/graphics.cpp
@@ -393,7 +393,7 @@ int gr_init() {
}
std::string rotation_str =
- android::base::GetProperty("ro.minui.default_rotation", "ROTATION_NONE");
+ android::base::GetProperty("ro.minui.default_rotation", "ROTATION_LEFT");//ROTATION_NONE
if (rotation_str == "ROTATION_RIGHT") {
gr_rotate(GRRotation::RIGHT);
} else if (rotation_str == "ROTATION_DOWN") {
|