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;
            }
            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!");
            }
            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);
    }
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;
            }
           
            if (!mForceDisplayEnabled
                   
                    && getDefaultDisplayContentLocked().checkWaitingForWindows()) {
                return;
            }
            if (!mBootAnimationStopped) {
                Trace.asyncTraceBegin(TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0);
               
               
               
                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,
                            data, null, 0);
                    data.recycle();
                }
            } catch (RemoteException ex) {
                Slog.e(TAG_WM, "Boot completed: SurfaceFlinger is dead!");
            }
            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!");
           
            mInputManagerCallback.setEventDispatchingLw(mEventDispatchingEnabled);
        }
        try {
            mActivityManager.bootAnimationComplete();
        } catch (RemoteException e) {
        }
        mPolicy.enableScreenAfterBoot();
       
        updateRotationUnchecked(false, false);
    }
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; } if (!mforcedisplayenabled && getdefaultdisplaycontentlocked().checkwaitingforwindows()) { return; } if (!mbootanimationstopped) { trace.asynctracebegin(trace_tag_window_manager, "stop bootanim", 0); 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, data, null, 0); data.recycle(); } } catch (remoteexception ex) { slog.e(tag_wm, "boot completed: surfaceflinger is dead!"); } 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!"); minputmanagercallback.seteventdispatchinglw(meventdispatchingenabled); } try { mactivitymanager.bootanimationcomplete(); } catch (remoteexception e) { } mpolicy.enablescreenafterboot(); updaterotationunchecked(false, false); }