Android 10 removes android is starting pop-up window

After booting, the device will have a bullet box saying android is starting, and this interface is FallbackHome.

The FallbackHome mechanism is to enter the page where android is starting the pop-up window in the Settings before the system is unlocked, and then enter the default Launcher after the system is completely unlocked. However, the pop-up window will also affect the product effect, so finally remove this pop-up window and not display it on the desktop wallpaper, and directly enter the Launcher.

  1. Extend the boot animation to go directly to the Launcher after unlocking
    在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. After unlocking, exit the boot animation in ActivityRecord onWindowsDrawn (exit animation to enable system gesture touch function)
    路径: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. Android with Settings removed is starting... Pop-up window
    //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);
        };

    Daily record: come on! ! !

Single cycle "Fulfillment"

Guess you like

Origin blog.csdn.net/androidzmm/article/details/128285719