Android Process
2020-11-16 17:32:23 0 举报
Android相关流程图
作者其他创作
大纲/内容
1. 判断权限:Settings.canWrite(this);2. 申请权限: 发送ACTION_MANAGE_WRITE_SETTINGS广播
2
VSync信号触发mTraversalRunnable
B
PhoneWindow
Activity 窗口添加过程
true
addWindow
一个稍微复杂一点的Activity跳转情况
FrameLayoutid/content
false
ActionMenuView
A->B->C
A
CLENDAR (日历)CAMERA (相机)CONTACTS (通讯录)LOCATION (定位)MICROPHONE (麦克风)PHONE (电话)SMS (短信)SENSORS (传感器)STORAGE (存储卡)
arm64-v8a
Activity
press Back
dispatchTouchEvent
WindowManagerImpl
Binder通信
requestLayout
StartForResultManager
callback
NULL回到桌面
onTouchEvent
IWindowSession
setContentView
31........16 15 ....... 8 7 ...... 0
onCreate
onActivityResult
ViewRootImpl
+ callback
子ViewGroup(可能多层)
A->B->C->A->B
armeabi
已废弃
x86_64
View 事件分发流程
onResult
RelativeLayout
System Permissions
Viewid/statusBarBackground
Session
Activity布局
ActionBarOverlayLayout id/decor_content_parent
事件未消费
Login Modes
SystemServer进程
addView
Instrumentation
DecorView(extends FrameLayout)
ActivityThread
Pwd Reset Modes
WindowManagerGlobal
startForResult
onInterceptEvent
WRITE_SETTINGS
WMS
startActivityForResult
Permissions
installDecor
事件被消费
Client Activity
Activity A : standardActivity B: singleTask TaskAffinity: com.sameActivity C: singleTask TaskAffinity: com.same
Viewid/navigationBarBackground
ActionBarContainer id/action_bar_container
Activity View层级
ViewRootImpl$TraversalRunnable#run-> doTraversal() ->performTraversals()
ToolBarid/action_bar
mContentRoot
启动Activity回调
1. WMS为添加的window分配Surface,并确定 Window显示次序2. 将Surface交给SurfaceFlinger处理3. SurfaceFlinger将Surface混合并绘制到屏幕
setView
addToDisplay
PhoneWindow#DecorView
scheduleTraversals
mContentParent
int 4 bytes
A->B->C->A
handleLaunchActivity
armeabi-v7a
1
mips
1. 判断权限:Settings.canDrawOverlays(this);2. 申请权限: 发送ACTION_MANAGE_OVERLAY_PERSSION广播
Decorview是WindowManagerMangerImpl#addView的参数
C
new Fragment
Android M 运行时权限
为Choreographer增加回调
主流手机
TextView
Special Grant
x86
UnicomLoginActivity
performLaunchActivity
SYSTEM_ALERT_WINDOW
每个应用程序进程对应一个Session
View
Register Modes
Android 模拟器
channelConfig
handleResumeActivity
Normal安装时授权
Fragment
Dangerous运行时授权
mips 64
callActivityOnCreate
ActionBarContextViewid/action_context_bar
本地进程
mDecor
收藏
收藏
0 条评论
下一页