43 次浏览
方法一:Launcher启动权限高于FallbackHome //使用改方法后无法进入开发者模式并获取root权限,已不采用
path: <source>/packages/apps/Launcher3/AndroidManifest.xml
(1)<intent-filter>中增加启动优先级
<!-- edited by peng, add android:priority="20" -->
<intent-filter android:priority="20" >
方法二:开机动画延迟覆盖FallbackHome
path: <source>/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
(1)屏蔽private void performEnableScreen()函数中退出开机动画相关代码
// edited by peng
/*
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!");
}
*/
path: <source>/frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
(1)在private void reportLaunchTimeLocked()函数中增加退出开机动画相关代码
// added by peng
if (isHomeIntent(intent) && shortComponentName != null && !shortComponentName.contains("FallbackHome")) {
SystemProperties.set("service.bootanim.exit", "1");
Log.d(TAG, "reportLaunchTimeLocked:real home....." + shortComponentName);
}
apk中需添加HOME属性
方法三:屏蔽fallbackhome界面中的“平板电脑正在启动”的弹窗 //状态栏仍有时间和电量显示
path: <source>/packages/apps/Settings/src/com/android/settings/FallbackHome.java
(1)屏蔽函数private final Runnable mProgressTimeoutRunnable = ()中的代码。