Flowchart of launcher startup [androidics4.0 --> launcher Series 4]

Source: Internet
Author: User

First, draw a launche startup flowchart. Although it is not a special specification, I can barely look at it. I also sorted out a series of launcher flowcharts. Recently I modified launcher and learned more about launcher,

Reprinted please indicate the source: http://blog.csdn.net/wdaming1986/article/details/8267156

Daming figure (1)

 

Note: loadworkspacefirst is a Boolean value. Add the following code:

 

public void run() {            // Optimize for end-user experience: if the Launcher is up and // running with the            // All Apps interface in the foreground, load All Apps first. Otherwise, load the            // workspace first (default).            final Callbacks cbk = mCallbacks.get();            final boolean loadWorkspaceFirst = cbk != null ? (!cbk.isAllAppsVisible()) : true;            keep_running: {                // Elevate priority when Home launches for the first time to avoid                // starving at boot time. Staring at a blank home is not cool.                synchronized (mLock) {                    if (DEBUG_LOADERS) Log.d(TAG, "Setting thread priority to " +                            (mIsLaunching ? "DEFAULT" : "BACKGROUND"));                    android.os.Process.setThreadPriority(mIsLaunching                            ? Process.THREAD_PRIORITY_DEFAULT : Process.THREAD_PRIORITY_BACKGROUND);                }                // First Step                if (loadWorkspaceFirst) {                    if (DEBUG_LOADERS) Log.d(TAG, "step 1: loading workspace");                    loadAndBindWorkspace();                } else {                    if (DEBUG_LOADERS) Log.d(TAG, "step 1: special: loading all apps");                    loadAndBindAllApps();                }                if (mStopped) {                    break keep_running;                }                // Whew! Hard work done.  Slow us down, and wait until the UI thread has                // settled down.                synchronized (mLock) {                    if (mIsLaunching) {                        if (DEBUG_LOADERS) Log.d(TAG, "Setting thread priority to BACKGROUND");                        android.os.Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);                    }                }                waitForIdle();                // Second step                if (loadWorkspaceFirst) {                    if (DEBUG_LOADERS) Log.d(TAG, "step 2: loading all apps");                    loadAndBindAllApps();                } else {                    if (DEBUG_LOADERS) Log.d(TAG, "step 2: special: loading workspace");                    loadAndBindWorkspace();                }                // Restore the default thread priority after we are done loading items                synchronized (mLock) {                    android.os.Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);                }            }            // Update the saved icons if necessary            if (DEBUG_LOADERS) Log.d(TAG, "Comparing loaded icons to database icons");            for (Object key : sDbIconCache.keySet()) {                updateSavedIcon(mContext, (ShortcutInfo) key, sDbIconCache.get(key));            }            sDbIconCache.clear();            // Clear out this reference, otherwise we end up holding it until all of the            // callback runnables are done.            mContext = null;            synchronized (mLock) {                // If we are still the last one to be scheduled, remove ourselves.                if (mLoaderTask == this) {                    mLoaderTask = null;                }            }        }

This includes frist step and second step, which means,

When loadworkspacefirst = true: First load the workspace, then load allapps

When loadworkspacefirst = false: or load allapps first and then workspace;

So when I draw a picture, use True/false, false/true;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.