方法|rk3568開發平臺如何去除android正在啟動彈窗
去除android正在啟動彈窗
開機以後,裝置會有一個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);
}
2、 解鎖結束後退出開機動畫在ActivityRecord中onWindowsDrawn( 退出動畫 開啟系統手勢觸控功能)
路徑: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
}
}
3、 去掉Settings 的Android 正在啟動… 彈窗
//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);
};
重新編譯燒錄即可!
來自 “ ITPUB部落格 ” ,連結:https://blog.itpub.net/70032144/viewspace-3000979/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 去除nag彈窗
- 直播平臺原始碼,Android中常用Dialog彈窗效果原始碼Android
- RK3568開發平臺Android 11強制所有應用橫屏展示Android
- Bootstrap的datetimepicker預設自動開啟彈框(js中開啟彈窗)bootJS
- win10去除彈窗廣告怎麼設定 win10如何阻止廣告彈窗Win10
- antdv彈窗modal可拖動方法
- 短視訊平臺開發,自定義一個彈窗樣式和內容
- iOS開發之彈窗管理iOS
- office正在更新無法正常啟動如何修復_office顯示正在更新無法開啟解決方法
- Android 平臺開啟硬體解碼logAndroid
- 搭建直播平臺,Android開發之禁止下拉通知欄的方法Android
- react-native 仿原生自定義彈窗|iOS/Android 彈窗效果ReactiOSAndroid
- 如何開發直播平臺,直播平臺開發需要CDN嗎
- iOS開發常用之 HUD 彈窗iOS
- EasyBarrage——Android平臺輕量級彈幕效果Android
- 短視訊平臺搭建,收到通知後彈出相關提示的彈窗
- win10啟動應用彈出對話方塊怎麼辦 win10每次開啟應用都要彈窗解決方法Win10
- 移動端彈窗
- 銀彈谷:搭建低程式碼開發平臺的關鍵要素與方法指南
- layer開啟彈窗時傳遞引數(content:)
- 直播電商平臺開發,動態去除系統自帶標題欄、狀態列
- Android彈窗二則: PopupWindow和AlertDialogAndroid
- Android之Window和彈窗問題Android
- 直播電商平臺開發,Android | 圖片縮放、自動居中Android
- 低無程式碼開發平臺正在逐漸打破原有軟體開發模式模式
- 銀彈谷:低程式碼開發平臺發展趨勢展望
- Android11修改攝像頭前後置方法,觸覺智慧RK3568開發板演示Android
- Linux平臺Oracle開機自啟動設定LinuxOracle
- 綠茵面家平臺開發(開發平臺)
- 移動跨平臺開發深度解析
- 線上直播系統原始碼,平臺彈窗自適應裝置原始碼
- Win10系統開機卡在正在啟動如何解決Win10
- Flutter 開發 Android & IOS 啟動頁 splash pageFlutterAndroidiOS
- jenkins配置android自動打包平臺JenkinsAndroid
- 短視訊平臺開發,點選輸入框時自動彈出軟鍵盤
- 為什麼win10開始廣告彈窗_win10如何把開機廣告彈窗刪除Win10
- 量子計算雲平臺“中國版”啟動量子資訊革命正在加速到來
- 微信小程式之animation底部彈窗動畫(兩種方法)微信小程式動畫