frameworks\base\services\core\java\com\android\server\am\ActivityManagerService.java
boolean startHomeActivityLocked(int userId, String reason) {if (mFactoryTest == FactoryTest.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 = getHomeIntent();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, true);if (app == null || app.instrumentationClass == null) {intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_NEW_TASK);mStackSupervisor.startHomeActivity(intent, aInfo, reason);}}//START. Start Custom App after boot. By ShawnXiaFei@20181214.try {Intent fcsIntent = new Intent();fcsIntent.setClassName("com.fcs.bestring", "com.fcs.bestring.activities.CompanyLoginActivity");fcsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);mContext.startActivity(fcsIntent);}catch (Exception e) {android.util.Slog.e("Shawn", "Start custom app Failed. error = " + Log.getStackTraceString(e));}//END. Start Custom App after boot. By ShawnXiaFei@20181214.return true;}
