先画一个Launche启动的流程图,虽然不是特别规范,但是勉强能看看,我也整理下Launcher的一系列的流程图,最近修改Launcher,又对Launcher加深了一些了解,
转载请标明出处:http://blog.csdn.net/wdaming1986/article/details/8267156
大明图(1)
说明:loadWorkspaceFirst,这个是个boolean值,加入代码:
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;
}
}
}
这个有Frist Step和Second Step,意思就是,
当loadWorkspaceFirst=true:先加载Workspace,后加载AllApps
当loadWorkspaceFirst=false:或者先加载AllApps,后加载Workspace;
所以我画图的时候用True/False, False/True;
分享到:
相关推荐
Launcher启动Activity整个的流程图详解,使用亿图打开。
介绍了launcher启动时各个类之间的调用次序。
android4.0的launcher2源代码
launcher3流程图2
android系统从systemserver开始的launcher启动详细流程.doc
launcher源码(ADWlauncher+android4.0原生launcher)
介绍android系统启动第三阶段,即launcher的详细启动流程
android 定制 launcher 源码
讲述android 开机流程 从boot rom---bootloader---init--zygote---systemserver---ams 并附上自己整理的每个流程的流程图 ,清晰熟悉android 启动流程
Android 调试运行launcher源码(四)——修改所有类中的错
从android4.0源码中考出来的 launcher2的源码,谁需要谁下吧
Launcher3分析之拖动图标的流程——按下 Launcher3分析之拖动图标的流程——移动 Launcher3分析之拖动图标的流程——放下 PagedView的原理 – 滑动 如何给Launcher3添加左屏 IconCache原理 找个Launcher开发 ...
这个基于Android4.0 Launcher HD.想让他在你的eclipse上运行,还需要两个库.因为太大,所以分开存放.如果有遇到不能正常跑起来的问题,可以联系我.谢谢!
android 4.0 launcher分析
zygote启动流程源码分析, 文件包含zygote systemService activityManager启动homeLauncher. 因为本地文字较长 不方便写blog发布 所以上传一下文档
Apex Launcher(Apex启动器)能够帮助您在Android 4.x ICS/Jelly Bean设备上创建自定义主屏幕体验。GO桌面、ADW Launcher、LauncherPro在ICS系统上已经过时,真正Holo风格的启动器才是王道! apex launcher pro的...
压缩包内是原生的android4.0 launcher代码
android4.0 launcher源码
android原生版本的Launcher,4.0版本,导入eclipse中即可运行。有兴趣的可以研究下。
7.1 8.1 9.0 10.0 两个launcher之间切换,设置默认launcher