android 修改默认Launcher
来源:互联网 发布:查看windows系统版本 编辑:程序博客网 时间:2024/05/22 07:54
系统启动后, 会查找并运行Launcher,
有源码的情况下,可以通过修改Intent-filter中的android:priorty="N" N >=1; 一般我会设置 N=100;
没有源码的情况下, 要将第三方Launcher默认启动, 则需要在些过程做点修改.
frameworks/base/services/java/com/android/server/am/ActivityManagerService.java
boolean startHomeActivityLocked(int userId) { if (mHeadless) { // Added because none of the other calls to ensureBootCompleted seem to fire // when running headless. ensureBootCompleted(); return false; } if (mFactoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL && mTopAction == null) { // We are running in factory test mode, but unable to find // the factory test app, so just sit around displaying the // error message and don't try to start anything. return false; } Intent intent = new Intent( mTopAction, mTopData != null ? Uri.parse(mTopData) : null); intent.setComponent(mTopComponent); if (mFactoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) { intent.addCategory(Intent.CATEGORY_HOME); } /** AnsonCode 2013.8.5 add Code**/try{final String specialPkg = "com.android.launcherX";mContext.getPackageManager().getApplicationEnabledSetting(specialPkg);intent.setPackage(specialPkg);}catch(Exception e){e.printStackTrace();} /** AnsonCode End **/ ActivityInfo aInfo = resolveActivityInfo(intent, STOCK_PM_FLAGS, userId); if (aInfo != null) { intent.setComponent(new ComponentName( aInfo.applicationInfo.packageName, aInfo.name)); // Don't do this if the home app is currently being // instrumented. aInfo = new ActivityInfo(aInfo); aInfo.applicationInfo = getAppInfoForUser(aInfo.applicationInfo, userId); ProcessRecord app = getProcessRecordLocked(aInfo.processName, aInfo.applicationInfo.uid); if (app == null || app.instrumentationClass == null) { intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_NEW_TASK); mMainStack.startActivityLocked(null, intent, null, aInfo, null, null, 0, 0, 0, 0, null, false, null); } } return true; }
0 0
- android 修改默认Launcher
- Android Launcher 一些默认修改(一)
- Android 设置默认Launcher
- Android设置默认Launcher
- Android设置默认Launcher
- Android 设置默认Launcher
- Android设置默认Launcher
- Android 设置默认Launcher
- android 设置默认launcher
- Android Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- Android Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- Android Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- Android Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- Android Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- Android Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- Android Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- Android Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- Android Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- android 修改输入法中拼写检测默认值
- 数据结构——哈希
- android PackageManager.setApplicationEnabledSetting()
- android 添加系统服务
- spoj 694 DISUBSTR - Distinct Substrings (后缀数组)
- android 修改默认Launcher
- 17、Spring Boot普通类调用bean【从零开始学Spring Boot】
- 深度學習 Keras MNIST 正確率可視化 (Cambridge Coding Academy 補充二)
- Shell重定向
- android4.2 修改设置背景
- java多线程编程
- android 修改默认APN
- android 模拟发送多点触摸事件
- 51单片机 HC05蓝牙模块