"); //-->
开机以后,设备会有一个android is starting的弹框,该界面就是FallbackHome。
FallbackHome机制是为了在系统还没有解锁前先进入Setting中的android正在启动弹窗 的页面等系统完全解锁后,然后进入默认Launcher但是弹窗也会影响产品效果,所以最后去掉这个弹窗不显示在桌面壁纸,直接进入Launcher。
1、延长开机动画 在解锁后直接进去Launcher在WindowManagerService.java中,注释掉退出开机动画的逻辑,延时开机动画
路径:frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
private void performEnableScreen() {
synchronized (mGlobalLock) {
if (DEBUG_BOOT) Slog.i(TAG_WM, "performEnableScreen: mDisplayEnabled=" + mDisplayEnabled
+ " mForceDisplayEnabled=" + mForceDisplayEnabled
+ " mShowingBootMessages=" + mShowingBootMessages
+ " mSystemBooted=" + mSystemBooted
+ " mOnlyCore=" + mOnlyCore,
new RuntimeException("here").fillInStackTrace());
if (mDisplayEnabled) {
return;
}
if (!mSystemBooted && !mShowingBootMessages) {
return;
}
if (!mShowingBootMessages && !mPolicy.canDismissBootAnimation()) {
return;
}
// Don't enable the screen until all existing windows have been drawn.
if (!mForceDisplayEnabled
// TODO(multidisplay): Expand to all displays?
&& getDefaultDisplayContentLocked().checkWaitingForWindows()) {
return;
}
//在这里处理播放完开机动画后是否退出开机动画,所以注释掉
//phoebe add for Extend Animation at ActivityRecord.java onWindowsDrawn start
/*if (!mBootAnimationStopped) {
Trace.asyncTraceBegin(TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0);
// stop boot animation
// formerly we would just kill the process, but we now ask it to exit so it
// can choose where to stop the animation.
SystemProperties.set("service.bootanim.exit", "1");
mBootAnimationStopped = true;
}
if (!mForceDisplayEnabled && !checkBootAnimationCompleteLocked()) {
if (DEBUG_BOOT) Slog.i(TAG_WM, "performEnableScreen: Waiting for anim complete");
return;
}
try {
IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger");
if (surfaceFlinger != null) {
Slog.i(TAG_WM, "******* TELLING SURFACE FLINGER WE ARE BOOTED!");
Parcel data = Parcel.obtain();
data.writeInterfaceToken("android.ui.ISurfaceComposer");
surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED
data, null, 0);
data.recycle();
}
} catch (RemoteException ex) {
Slog.e(TAG_WM, "Boot completed: SurfaceFlinger is dead!");
}*/
//phoebe add for Extend Animation at ActivityRecord.java onWindowsDrawn end
EventLog.writeEvent(EventLogTags.WM_BOOT_ANIMATION_DONE, SystemClock.uptimeMillis());
Trace.asyncTraceEnd(TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0);
mDisplayEnabled = true;
if (DEBUG_SCREEN_ON || DEBUG_BOOT) Slog.i(TAG_WM, "******************** ENABLING SCREEN!");
// Enable input dispatch.
mInputManagerCallback.setEventDispatchingLw(mEventDispatchingEnabled);
}
try {
mActivityManager.bootAnimationComplete();
} catch (RemoteException e) {
}
mPolicy.enableScreenAfterBoot();
// Make sure the last requested orientation has been applied.
updateRotationUnchecked(false, false);
}
路径:frameworks/base/services/core/java/com/android/server/wm/ActivityRecord.java
/** Called when the windows associated app window container are drawn. */
public void onWindowsDrawn(boolean drawn, long timestamp) {
synchronized (mAtmService.mGlobalLock) {
mDrawn = drawn;
if (!drawn) {
return;
}
final WindowingModeTransitionInfoSnapshot info = mStackSupervisor
.getActivityMetricsLogger().notifyWindowsDrawn(getWindowingMode(), timestamp);
final int windowsDrawnDelayMs = info != null ? info.windowsDrawnDelayMs : INVALID_DELAY;
final @LaunchState int launchState = info != null ? info.getLaunchState() : -1;
mStackSupervisor.reportActivityLaunchedLocked(false /* timeout */, this,
windowsDrawnDelayMs, launchState);
mStackSupervisor.stopWaitingForActivityVisible(this);
finishLaunchTickingLocked();
if (task != null) {
task.hasBeenVisible = true;
}
//解锁后退出开机动画
// phoebe add for exit bootanim start
if (isHomeIntent(intent) && shortComponentName != null && !shortComponentName.contains("FallbackHome")) {
SystemProperties.set("service.bootanim.exit", "1");
android.util.Log.e("ActivityRecord", "real home....." + shortComponentName);
try {
IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger");
if (surfaceFlinger != null) {
Slog.i(TAG_WM, "******* TELLING SURFACE FLINGER WE ARE BOOTED!");
Parcel data = Parcel.obtain();
data.writeInterfaceToken("android.ui.ISurfaceComposer");
surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED
data, null, 0);
data.recycle();
}
} catch (RemoteException ex) {
Slog.e(TAG, "Boot completed: SurfaceFlinger is dead!");
}
}
// phoebe add for exit bootanim end
//modify for performance begin
Bundle b = new Bundle();
b.putLong(ProcessInfo.KEY_LAUNCH_TIME, (long)windowsDrawnDelayMs);
b.putBoolean(ProcessInfo.KEY_FULLSCREEN, (task != null && task.mFullscreen));
mAtmService.notifyActivityStateChange(this.intent, ProcessInfo.ACTIVITY_STATE_LAUNCHDONE, b);
//modify for performance end
}
}
//packages\apps\Settings\src\com\android\settings\FallbackHome.java
private final Runnable mProgressTimeoutRunnable = () -> {
//phoebe add for remove android is starting tips
// View v = getLayoutInflater().inflate(
// R.layout.fallback_home_finishing_boot, null /* root */);
// setContentView(v);
// v.setAlpha(0f);
// v.animate()
// .alpha(1f)
// .setDuration(500)
// .setInterpolator(AnimationUtils.loadInterpolator(
// this, android.R.interpolator.fast_out_slow_in))
// .start();
getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON);
};
重新编译烧录即可!
-END-
专栏文章内容及配图由作者撰写发布,仅供工程师学习之用,如有侵权或者其他违规问题,请联系本站处理。 联系我们
相关推荐
RK3576 + ROS2 SLAM建图与导航实战
嵌入式系统的实时数据接口扩展
LCD驱动器SD0432与嵌入式系统的接口设计
嵌入式看门狗如何提升系统稳定性
大家在互相借鉴吧!--嵌入式系统词汇表
华清远见嵌入式在线视频教程——3、嵌入式Linux开发应用介绍
Windows CE 开发初步(第一部)
嵌入式系统方案设计
从COM到SMARC再到OSM:嵌入式计算模块的发展
华清远见嵌入式在线视频教程——2、嵌入式系统的选择与开发
华清远见嵌入式在线视频教程——5、嵌入式Linux移植和u-boot
浅谈嵌入式LINUX系统教与学
意法半导体出厂中国制造的STM32 MCU
第一讲:嵌入式系统概述
嵌入式操作系统大比拼
嵌入式U盘读写器接口技术和系统设计
大家在互相借鉴吧!--嵌入式系统词汇表
陈渝大侠翻译的 uClinux2.6入门
大家在互相借鉴吧!--嵌入式系统词汇表
LAN91C111型控制器在嵌入式以太网接口中的应用
TI将边缘AI微控制器更深入地融入嵌入式设计
USB-HOST实时数据采集嵌入式模块的实现
华清远见嵌入式在线视频教程——4、基于ARM的嵌入式开发
大家在互相借鉴吧!--嵌入式系统词汇表
汽车存储器新突破:8nm128Mb嵌入式MRAM的研发
米尔亮相德国嵌入式展2026 Embedded World
未来倾向于UFS用于高性能嵌入式闪存
展会预告!米尔邀您相约德国嵌入式展 2026Embedded World
华清远见嵌入式在线视频教程——1、走近嵌入式系统
IAR 扩展了嵌入式开发平台,提供 LTS 服务