ActivityTaskManagerService 是 Android 系统中的核心服务之一,它负责管理应用程序的活动(Activity)和任务栈(Task Stack)。这里我们接上一篇内容继续分析 APP 启动流程, startActivity() 方法,调用了 ATMS,我们继续往下看。
源码位置:/frameworks/base/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
- @Override
- public final int startActivity(IApplicationThread caller, String callingPackage,
- String callingFeatureId, Intent intent, String resolvedType, IBinder resultTo,
- String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo,
- Bundle bOptions) {
- return startActivityAsUser(caller, callingPackage, callingFeatureId, intent, resolvedType,
- resultTo, resultWho, requestCode, startFlags, profilerInfo, bOptions,
- UserHandle.getCallingUserId());
- }