一.组件学习思路
1.组件
2.组件的生命周期
3.组件的调度
Activity
1.最近重温了Activity的启动过程,Activity启动过程是非常复杂的,其中涉及跨进程的交互,Activity的调度,生命周期的调度,binder机制等等,值得细细深究。
AMS:AMS是安卓中非常http://www.jianshu.com/p/792997b4d7d7重要的服务,它的主要职责包括进程的调度,四大组件的管理,内存回收等等非常重要的功能。
AMS通过IApplicationThread服务代理对象控制应用进程,应用进程通过AMS的代理对象启动activity,service等等。。。
2.Activity是一个抽象的活动,每个Activity都关联着一个window对象(PhoneWindow),window中有承载布局的DectorView,有管理窗口的WindowManager
二. Activity的生命周期
1.问题
1.Android之什么时候调用onSaveInstance方法的时候
http://blog.csdn.net/u011068702/article/details/70217576
2. 如何判断activity渲染完毕
activity整个启动过程http://www.jianshu.com/p/792997b4d7d7
三.Activity调度
adb shell dumpsys activity activities观察AMS是如何调度activity的
手机中可以有多个栈,栈中有若干个task,每个task对应一个TaskRecord
每个task中有若干个activity,每个activity对应一个ActivityRecord
Stack #0:中的task元素是桌面进程的activity集合,多用户的情况下所有桌面进程的task都按照顺序进入Stack #0这个栈,这个栈也只维护桌面进程的task
Stack #x:中的task元素是其它应用进程的activity集合,多用户的情况下其它所有用户中的活动task按照顺序入栈,这个栈维护所有用户的所有活动task
活动调度:
1.当用户从其它应用回到桌面,Stack #0会调度到前台,展示当前处于栈顶的activity,当前activity肯定是当前用户的桌面了
2.栈中调度activity是以task为单位的,task可以理解为一个用户活动集合,一个用户活动集合一般情况下主要发生在一个应用中,当然也存在多个应用之间
一个普通应用场景下的调度过程:
eg: 用户打开了A应用,然后home回到桌面,打开B应用,然后home回到桌面,再次进入A应用
step1: 用户打开了A应用:taskA进入stack #x,stack #0进入后台
step2: 然后home回到桌面:stack #0进入前台 stack #x进入后台
step3: 打开B应用:stack #0进入后台,stack #X进入前台,taskB入栈且处于栈顶
step4: 然后home回到桌面:stack #0进入前台 stack #x进入后台
step5: 再次进入A应用:stack #0进入后台,stack #X进入前台,stack #X中taskA调度到栈顶
msy@msy-OptiPlex-7040:~/src/m-alpha-code/packages/apps/SecurityCenter$ adb shell dumpsys activity activities
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom)://所有的activities
Stack #2:处于前台的栈
Task id #522
* TaskRecord{e20d722 #522 A=com.miui.securitycenter U=0 sz=2}//U:表示用户id sz:表示当前task中的activity数量
userId=0 effectiveUid=1000 mCallingUid=u0a19 mCallingPackage=com.miui.home
affinity=com.miui.securitycenter
intent={act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.miui.securitycenter/com.miui.securityscan.MainActivity}
realActivity=com.miui.securitycenter/com.miui.securityscan.MainActivity
autoRemoveRecents=false isPersistable=true numFullscreen=2 taskType=0 mTaskToReturnTo=1
rootWasReset=true mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{3c881d9 u0 com.miui.securitycenter/com.miui.securityscan.MainActivity t522}, ActivityRecord{ed3b00 u0 com.miui.securitycenter/com.miui.antivirus.activity.MainActivity t522}]
askedCompatMode=false inRecents=true isAvailable=true
lastThumbnail=null lastThumbnailFile=/data/system/recent_images/522_task_thumbnail.png
stackId=2
hasBeenVisible=true mResizeable=false firstActiveTime=1506562716684 lastActiveTime=1506562716684 (inactive for 8s)
* Hist #1: ActivityRecord{ed3b00 u0 com.miui.securitycenter/com.miui.antivirus.activity.MainActivity t522}//处于task顶部的activity
packageName=com.miui.securitycenter processName=com.miui.securitycenter
launchedFromUid=1000 launchedFromPackage=com.miui.securitycenter userId=0
app=ProcessRecord{173ef13 14776:com.miui.securitycenter/1000}
Intent { act=miui.intent.action.ANTI_VIRUS cmp=com.miui.securitycenter/com.miui.antivirus.activity.MainActivity (has extras) }
frontOfTask=false task=TaskRecord{e20d722 #522 A=com.miui.securitycenter U=0 sz=2}
taskAffinity=com.miui.securitycenter
realActivity=com.miui.securitycenter/com.miui.antivirus.activity.MainActivity
baseDir=/data/app/com.miui.securitycenter-2/base.apk
dataDir=/data/user/0/com.miui.securitycenter
stateNotNeeded=false componentSpecified=false mActivityType=0
compat={480dpi} labelRes=0x7f070529 icon=0x7f02019d theme=0x7f090021
config={1.0 ?mcc?mnc zh_CN ldltr sw360dp w360dp h620dp 480dpi nrml long port finger -keyb/v/h -nav/h s.6 themeChanged=0 themeChangedFlags=0}
stackConfigOverride={1.0 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? themeChanged=0 themeChangedFlags=0}
taskDescription: iconFilename=null label="null" color=ffe6e6e6
launchFailed=false launchCount=1 lastLaunchTime=-8s92ms
haveState=false icicle=null
state=RESUMED stopped=false delayedResume=false finishing=false
keysPaused=false inHistory=true visible=true sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=1
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=APPLICATION_ACTIVITY_TYPE
waitingVisible=false nowVisible=true lastVisibleTime=-7s760ms
realComponentName=com.miui.securitycenter/com.miui.antivirus.activity.MainActivity
* Hist #0: ActivityRecord{3c881d9 u0 com.miui.securitycenter/com.miui.securityscan.MainActivity t522}
packageName=com.miui.securitycenter processName=com.miui.securitycenter
launchedFromUid=10019 launchedFromPackage=com.miui.home userId=0
app=ProcessRecord{173ef13 14776:com.miui.securitycenter/1000}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.miui.securitycenter/com.miui.securityscan.MainActivity bnds=[572,1277][754,1459] (has extras) }
frontOfTask=true task=TaskRecord{e20d722 #522 A=com.miui.securitycenter U=0 sz=2}
taskAffinity=com.miui.securitycenter
realActivity=com.miui.securitycenter/com.miui.securityscan.MainActivity
baseDir=/data/app/com.miui.securitycenter-2/base.apk
dataDir=/data/user/0/com.miui.securitycenter
stateNotNeeded=false componentSpecified=true mActivityType=0
compat={480dpi} labelRes=0x7f070507 icon=0x7f020050 theme=0x7f090024
config={1.0 ?mcc?mnc zh_CN ldltr sw360dp w360dp h620dp 480dpi nrml long port finger -keyb/v/h -nav/h s.6 themeChanged=0 themeChangedFlags=0}
stackConfigOverride={1.0 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? themeChanged=0 themeChangedFlags=0}
taskDescription: iconFilename=null label="null" color=ffe6e6e6
launchFailed=false launchCount=0 lastLaunchTime=-10h14m48s354ms
haveState=true icicle=Bundle[mParcelledData.dataSize=4840]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=1
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=APPLICATION_ACTIVITY_TYPE
waitingVisible=false nowVisible=false lastVisibleTime=-11s45ms
realComponentName=com.miui.securitycenter/com.miui.securityscan.MainActivity
Task id #482
* TaskRecord{52e270a #482 A=com.android.settings U=0 sz=1}
userId=0 effectiveUid=1000 mCallingUid=u0a19 mCallingPackage=com.miui.home
affinity=com.android.settings
intent={act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.MiuiSettings}
origActivity=com.android.settings/.MainSettings
realActivity=com.android.settings/.MiuiSettings
autoRemoveRecents=false isPersistable=true numFullscreen=1 taskType=0 mTaskToReturnTo=1
rootWasReset=true mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{238fe2a u0 com.android.settings/.MainSettings t482}]
askedCompatMode=false inRecents=true isAvailable=true
lastThumbnail=null lastThumbnailFile=/data/system/recent_images/482_task_thumbnail.png
stackId=2
hasBeenVisible=true mResizeable=false firstActiveTime=1506503310726 lastActiveTime=1506503310726 (inactive for 59414s)
* Hist #0: ActivityRecord{238fe2a u0 com.android.settings/.MainSettings t482}
packageName=com.android.settings processName=com.android.settings
launchedFromUid=10019 launchedFromPackage=com.miui.home userId=0
app=ProcessRecord{6cf8664 8059:com.android.settings/1000}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.MainSettings bnds=[76,1277][258,1459] (has extras) }
frontOfTask=true task=TaskRecord{52e270a #482 A=com.android.settings U=0 sz=1}
taskAffinity=com.android.settings
realActivity=com.android.settings/.MiuiSettings
baseDir=/system/priv-app/Settings/Settings.apk
dataDir=/data/user/0/com.android.settings
stateNotNeeded=false componentSpecified=true mActivityType=0
compat={480dpi} labelRes=0x7f0a018c icon=0x7f030000 theme=0x7f0f0082
config={1.0 ?mcc?mnc zh_CN ldltr sw360dp w360dp h620dp 480dpi nrml long port finger -keyb/v/h -nav/h s.6 themeChanged=0 themeChangedFlags=0}
stackConfigOverride={1.0 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? themeChanged=0 themeChangedFlags=0}
taskDescription: iconFilename=null label="null" color=ffe6e6e6
launchFailed=false launchCount=0 lastLaunchTime=-13h54m31s586ms
haveState=true icicle=Bundle[mParcelledData.dataSize=2944]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=2
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=APPLICATION_ACTIVITY_TYPE
waitingVisible=false nowVisible=false lastVisibleTime=-13h51m32s413ms
realComponentName=com.android.settings/.MainSettings
Task id #492
* TaskRecord{bd425b3 #492 A=com.miui.gallery.home U=16 sz=1}
userId=16 effectiveUid=u16a22 mCallingUid=u16a19 mCallingPackage=com.miui.home
affinity=com.miui.gallery.home
intent={act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.miui.gallery/.activity.HomePageActivity}
realActivity=com.miui.gallery/.activity.HomePageActivity
autoRemoveRecents=false isPersistable=true numFullscreen=1 taskType=0 mTaskToReturnTo=1
rootWasReset=true mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{aeeeb29 u16 com.miui.gallery/.activity.HomePageActivity t492}]
askedCompatMode=false inRecents=true isAvailable=true
lastThumbnail=null lastThumbnailFile=/data/system/recent_images/492_task_thumbnail.png
stackId=2
hasBeenVisible=true mResizeable=false firstActiveTime=1506517260940 lastActiveTime=1506517260940 (inactive for 45463s)
* Hist #0: ActivityRecord{aeeeb29 u16 com.miui.gallery/.activity.HomePageActivity t492}
packageName=com.miui.gallery processName=com.miui.gallery
launchedFromUid=1610019 launchedFromPackage=com.miui.home userId=16
app=ProcessRecord{842c770 12823:com.miui.gallery/u16a22}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.miui.gallery/.activity.HomePageActivity bnds=[820,983][1002,1165] (has extras) }
frontOfTask=true task=TaskRecord{bd425b3 #492 A=com.miui.gallery.home U=16 sz=1}
taskAffinity=com.miui.gallery.home
realActivity=com.miui.gallery/.activity.HomePageActivity
baseDir=/system/priv-app/MiuiGallery/MiuiGallery.apk
dataDir=/data/user/16/com.miui.gallery
stateNotNeeded=false componentSpecified=true mActivityType=0
compat={480dpi} labelRes=0x7f0d004b icon=0x7f030000 theme=0x7f0e0005
config={1.0 ?mcc?mnc zh_CN ldltr sw360dp w360dp h620dp 480dpi nrml long port finger -keyb/v/h -nav/h s.6 themeChanged=0 themeChangedFlags=0}
stackConfigOverride={1.0 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? themeChanged=0 themeChangedFlags=0}
taskDescription: iconFilename=null label="null" color=ffe6e6e6
launchFailed=false launchCount=0 lastLaunchTime=-12h27m37s339ms
haveState=true icicle=Bundle[mParcelledData.dataSize=3316]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=0
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=APPLICATION_ACTIVITY_TYPE
waitingVisible=false nowVisible=false lastVisibleTime=-12h27m36s599ms
realComponentName=com.miui.gallery/.activity.HomePageActivity
Task id #491
* TaskRecord{dd33ae9 #491 A=com.android.camera U=16 sz=1}
userId=16 effectiveUid=u16a17 mCallingUid=u16a19 mCallingPackage=com.miui.home
affinity=com.android.camera
intent={act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.camera/.Camera}
realActivity=com.android.camera/.Camera
autoRemoveRecents=false isPersistable=true numFullscreen=1 taskType=0 mTaskToReturnTo=1
rootWasReset=true mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{c5b0cf5 u16 com.android.camera/.Camera t491}]
askedCompatMode=false inRecents=true isAvailable=true
lastThumbnail=null lastThumbnailFile=/data/system/recent_images/491_task_thumbnail.png
stackId=2
hasBeenVisible=true mResizeable=false firstActiveTime=1506507576521 lastActiveTime=1506507576521 (inactive for 55148s)
* Hist #0: ActivityRecord{c5b0cf5 u16 com.android.camera/.Camera t491}
packageName=com.android.camera processName=com.android.camera
launchedFromUid=1610019 launchedFromPackage=com.miui.home userId=16
app=ProcessRecord{f2df65c 12723:com.android.camera/u16a17}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.camera/.Camera bnds=[821,1683][1003,1865] (has extras) }
frontOfTask=true task=TaskRecord{dd33ae9 #491 A=com.android.camera U=16 sz=1}
taskAffinity=com.android.camera
realActivity=com.android.camera/.Camera
baseDir=/system/priv-app/MiuiCamera/MiuiCamera.apk
dataDir=/data/user/16/com.android.camera
stateNotNeeded=false componentSpecified=true mActivityType=0
compat={480dpi} labelRes=0x7f0e0008 icon=0x7f030000 theme=0x7f0f0000
config={1.0 ?mcc?mnc zh_CN ldltr sw360dp w360dp h620dp 480dpi nrml long port finger -keyb/v/h -nav/h s.6 themeChanged=0 themeChangedFlags=0}
stackConfigOverride={1.0 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? themeChanged=0 themeChangedFlags=0}
taskDescription: iconFilename=null label="null" color=ffe6e6e6
launchFailed=false launchCount=0 lastLaunchTime=-12h28m2s122ms
haveState=true icicle=Bundle[mParcelledData.dataSize=6364]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=1
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=APPLICATION_ACTIVITY_TYPE
waitingVisible=false nowVisible=false lastVisibleTime=-12h27m53s609ms
realComponentName=com.android.camera/.Camera
Task id #487
* TaskRecord{a94b3c9 #487 A=com.miui.securityspace.ui.activity.PrivateSpaceMainActivity U=16 sz=1}
userId=16 effectiveUid=u16s1000 mCallingUid=u16a19 mCallingPackage=com.miui.home
affinity=com.miui.securityspace.ui.activity.PrivateSpaceMainActivity
intent={act=android.intent.action.VIEW cat=[android.intent.category.DEFAULT] flg=0x10a00000 cmp=com.miui.securitycore/com.miui.securityspace.ui.activity.PrivateSpaceMainActivity}
realActivity=com.miui.securitycore/com.miui.securityspace.ui.activity.PrivateSpaceMainActivity
autoRemoveRecents=false isPersistable=false numFullscreen=1 taskType=0 mTaskToReturnTo=1
rootWasReset=true mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{1eac077 u16 com.miui.securitycore/com.miui.securityspace.ui.activity.PrivateSpaceMainActivity t487}]
askedCompatMode=false inRecents=true isAvailable=true
lastThumbnail=null lastThumbnailFile=/data/system/recent_images/487_task_thumbnail.png
stackId=2
hasBeenVisible=true mResizeable=false firstActiveTime=1506507551898 lastActiveTime=1506507551898 (inactive for 55172s)
* Hist #0: ActivityRecord{1eac077 u16 com.miui.securitycore/com.miui.securityspace.ui.activity.PrivateSpaceMainActivity t487}
packageName=com.miui.securitycore processName=com.miui.securitycore
launchedFromUid=1610019 launchedFromPackage=com.miui.home userId=16
app=ProcessRecord{dcdcd7b 8884:com.miui.securitycore/u16s1000}
Intent { act=android.intent.action.VIEW cat=[android.intent.category.DEFAULT] flg=0x10a00000 cmp=com.miui.securitycore/com.miui.securityspace.ui.activity.PrivateSpaceMainActivity bnds=[324,983][506,1165] (has extras) }
frontOfTask=true task=TaskRecord{a94b3c9 #487 A=com.miui.securityspace.ui.activity.PrivateSpaceMainActivity U=16 sz=1}
taskAffinity=com.miui.securityspace.ui.activity.PrivateSpaceMainActivity
realActivity=com.miui.securitycore/com.miui.securityspace.ui.activity.PrivateSpaceMainActivity
baseDir=/data/app/com.miui.securitycore-1/base.apk
dataDir=/data/user/16/com.miui.securitycore
stateNotNeeded=false componentSpecified=true mActivityType=0
compat={480dpi} labelRes=0x7f080086 icon=0x7f020017 theme=0x100d0051
config={1.0 ?mcc?mnc zh_CN ldltr sw360dp w360dp h620dp 480dpi nrml long port finger -keyb/v/h -nav/h s.6 themeChanged=0 themeChangedFlags=0}
stackConfigOverride={1.0 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? themeChanged=0 themeChangedFlags=0}
taskDescription: iconFilename=null label="null" color=ffe6e6e6
launchFailed=false launchCount=0 lastLaunchTime=-13h54m33s386ms
haveState=true icicle=Bundle[mParcelledData.dataSize=2824]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=0
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=APPLICATION_ACTIVITY_TYPE
waitingVisible=false nowVisible=false lastVisibleTime=-12h29m50s491ms
realComponentName=com.miui.securitycore/com.miui.securityspace.ui.activity.PrivateSpaceMainActivity
Task id #486
* TaskRecord{3705aa7 #486 A=com.xiaomi.market U=16 sz=1}
userId=16 effectiveUid=u16a73 mCallingUid=u16a19 mCallingPackage=com.miui.home
affinity=com.xiaomi.market
intent={act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.xiaomi.market/.ui.MarketTabActivity}
realActivity=com.xiaomi.market/.ui.MarketTabActivity
autoRemoveRecents=false isPersistable=true numFullscreen=1 taskType=0 mTaskToReturnTo=1
rootWasReset=true mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{256782 u16 com.xiaomi.market/.ui.MarketTabActivity t486}]
askedCompatMode=false inRecents=true isAvailable=true
lastThumbnail=null lastThumbnailFile=/data/system/recent_images/486_task_thumbnail.png
stackId=2
hasBeenVisible=true mResizeable=false firstActiveTime=1506495342832 lastActiveTime=1506495342832 (inactive for 67381s)
* Hist #0: ActivityRecord{256782 u16 com.xiaomi.market/.ui.MarketTabActivity t486}
packageName=com.xiaomi.market processName=com.xiaomi.market
launchedFromUid=1610019 launchedFromPackage=com.miui.home userId=16
app=null
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.xiaomi.market/.ui.MarketTabActivity bnds=[324,1277][506,1459] (has extras) }
frontOfTask=true task=TaskRecord{3705aa7 #486 A=com.xiaomi.market U=16 sz=1}
taskAffinity=com.xiaomi.market
realActivity=com.xiaomi.market/.ui.MarketTabActivity
baseDir=/system/app/MiuiSuperMarket/MiuiSuperMarket.apk
dataDir=/data/user/16/com.xiaomi.market
stateNotNeeded=false componentSpecified=true mActivityType=0
compat={480dpi} labelRes=0x7f090011 icon=0x7f020065 theme=0x7f0a00b7
config={1.0 ?mcc?mnc zh_CN ldltr sw360dp w360dp h620dp 480dpi nrml long port finger -keyb/v/h -nav/h s.6 themeChanged=0 themeChangedFlags=0}
stackConfigOverride={1.0 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? themeChanged=0 themeChangedFlags=0}
taskDescription: iconFilename=null label="null" color=ffe6e6e6
launchFailed=false launchCount=0 lastLaunchTime=-14h12m54s460ms
haveState=true icicle=Bundle[mParcelledData.dataSize=1704]
state=DESTROYED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=true idle=true
fullscreen=true noDisplay=false immersive=false launchMode=0
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=APPLICATION_ACTIVITY_TYPE
waitingVisible=false nowVisible=false lastVisibleTime=-14h12m54s42ms
realComponentName=com.xiaomi.market/.ui.MarketTabActivity
Running activities (most recent first):
TaskRecord{e20d722 #522 A=com.miui.securitycenter U=0 sz=2}
Run #5: ActivityRecord{ed3b00 u0 com.miui.securitycenter/com.miui.antivirus.activity.MainActivity t522}
Run #4: ActivityRecord{3c881d9 u0 com.miui.securitycenter/com.miui.securityscan.MainActivity t522}
TaskRecord{bd425b3 #492 A=com.miui.gallery.home U=16 sz=1}
Run #3: ActivityRecord{aeeeb29 u16 com.miui.gallery/.activity.HomePageActivity t492}
TaskRecord{dd33ae9 #491 A=com.android.camera U=16 sz=1}
Run #2: ActivityRecord{c5b0cf5 u16 com.android.camera/.Camera t491}
TaskRecord{a94b3c9 #487 A=com.miui.securityspace.ui.activity.PrivateSpaceMainActivity U=16 sz=1}
Run #1: ActivityRecord{1eac077 u16 com.miui.securitycore/com.miui.securityspace.ui.activity.PrivateSpaceMainActivity t487}
TaskRecord{52e270a #482 A=com.android.settings U=0 sz=1}
Run #0: ActivityRecord{238fe2a u0 com.android.settings/.MainSettings t482}
mResumedActivity: ActivityRecord{ed3b00 u0 com.miui.securitycenter/com.miui.antivirus.activity.MainActivity t522}
mLastPausedActivity: ActivityRecord{3c881d9 u0 com.miui.securitycenter/com.miui.securityscan.MainActivity t522}
Stack #0://该栈目前处于后台,该栈中只维护桌面进程的activity
Task id #447
* TaskRecord{bc634f8 #447 A=com.miui.home U=0 sz=1}
userId=0 effectiveUid=u0a19 mCallingUid=1000 mCallingPackage=android
affinity=com.miui.home
intent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800000 cmp=com.miui.home/.launcher.Launcher}
realActivity=com.miui.home/.launcher.Launcher
autoRemoveRecents=false isPersistable=false numFullscreen=1 taskType=1 mTaskToReturnTo=0
rootWasReset=false mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{ddaeff1 u0 com.miui.home/.launcher.Launcher t447}]
askedCompatMode=false inRecents=true isAvailable=true
lastThumbnail=null lastThumbnailFile=/data/system/recent_images/447_task_thumbnail.png
stackId=0
hasBeenVisible=true mResizeable=false firstActiveTime=1506525836343 lastActiveTime=1506525836343 (inactive for 36888s)
* Hist #0: ActivityRecord{ddaeff1 u0 com.miui.home/.launcher.Launcher t447}
packageName=com.miui.home processName=com.miui.home
launchedFromUid=0 launchedFromPackage=null userId=0
app=ProcessRecord{6785271 3582:com.miui.home/u0a19}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800000 cmp=com.miui.home/.launcher.Launcher }
frontOfTask=true task=TaskRecord{bc634f8 #447 A=com.miui.home U=0 sz=1}
taskAffinity=com.miui.home
realActivity=com.miui.home/.launcher.Launcher
baseDir=/system/priv-app/MiuiHome/MiuiHome.apk
dataDir=/data/user/0/com.miui.home
stateNotNeeded=true componentSpecified=false mActivityType=1
compat={480dpi} labelRes=0x7f0d0004 icon=0x7f02009d theme=0x7f070000
config={1.0 ?mcc?mnc zh_CN ldltr sw360dp w360dp h620dp 480dpi nrml long port finger -keyb/v/h -nav/h s.6 themeChanged=0 themeChangedFlags=0}
stackConfigOverride={1.0 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? themeChanged=0 themeChangedFlags=0}
taskDescription: iconFilename=null label="null" color=ffe6e6e6
launchFailed=false launchCount=0 lastLaunchTime=-1d13h38m40s173ms
haveState=true icicle=Bundle[mParcelledData.dataSize=7684]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=2
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=HOME_ACTIVITY_TYPE
waitingVisible=false nowVisible=false lastVisibleTime=-10h15m5s833ms
realComponentName=com.miui.home/.launcher.Launcher
Task id #483
* TaskRecord{dada6bf #483 A=com.miui.home U=16 sz=1}
userId=16 effectiveUid=u16a19 mCallingUid=1000 mCallingPackage=android
affinity=com.miui.home
intent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800000 cmp=com.miui.home/.launcher.Launcher}
realActivity=com.miui.home/.launcher.Launcher
autoRemoveRecents=false isPersistable=false numFullscreen=1 taskType=1 mTaskToReturnTo=0
rootWasReset=false mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLE
Activities=[ActivityRecord{9b42ac0 u16 com.miui.home/.launcher.Launcher t483}]
askedCompatMode=false inRecents=true isAvailable=true
lastThumbnail=null lastThumbnailFile=/data/system/recent_images/483_task_thumbnail.png
stackId=0
hasBeenVisible=true mResizeable=false firstActiveTime=1506517264072 lastActiveTime=1506517264072 (inactive for 45460s)
* Hist #0: ActivityRecord{9b42ac0 u16 com.miui.home/.launcher.Launcher t483}
packageName=com.miui.home processName=com.miui.home
launchedFromUid=0 launchedFromPackage=null userId=16
app=ProcessRecord{278618c 1695:com.miui.home/u16a19}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800000 cmp=com.miui.home/.launcher.Launcher }
frontOfTask=true task=TaskRecord{dada6bf #483 A=com.miui.home U=16 sz=1}
taskAffinity=com.miui.home
realActivity=com.miui.home/.launcher.Launcher
baseDir=/system/priv-app/MiuiHome/MiuiHome.apk
dataDir=/data/user/16/com.miui.home
stateNotNeeded=true componentSpecified=false mActivityType=1
compat={480dpi} labelRes=0x7f0d0004 icon=0x7f02009d theme=0x7f070000
config={1.0 ?mcc?mnc zh_CN ldltr sw360dp w360dp h620dp 480dpi nrml long port finger -keyb/v/h -nav/h s.6 themeChanged=0 themeChangedFlags=0}
stackConfigOverride={1.0 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? themeChanged=0 themeChangedFlags=0}
taskDescription: iconFilename=null label="null" color=ffe6e6e6
launchFailed=false launchCount=0 lastLaunchTime=-14h36m31s466ms
haveState=true icicle=Bundle[mParcelledData.dataSize=7676]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true visible=false sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=2
frozenBeforeDestroy=false forceNewConfig=false
mActivityType=HOME_ACTIVITY_TYPE
waitingVisible=false nowVisible=false lastVisibleTime=-12h24m19s957ms
realComponentName=com.miui.home/.launcher.Launcher
Running activities (most recent first):
TaskRecord{bc634f8 #447 A=com.miui.home U=0 sz=1}
Run #1: ActivityRecord{ddaeff1 u0 com.miui.home/.launcher.Launcher t447}
TaskRecord{dada6bf #483 A=com.miui.home U=16 sz=1}
Run #0: ActivityRecord{9b42ac0 u16 com.miui.home/.launcher.Launcher t483}
mLastPausedActivity: ActivityRecord{ddaeff1 u0 com.miui.home/.launcher.Launcher t447}
mFocusedActivity: ActivityRecord{ed3b00 u0 com.miui.securitycenter/com.miui.antivirus.activity.MainActivity t522}
mFocusedStack=ActivityStack{47db7b stackId=2, 6 tasks} mLastFocusedStack=ActivityStack{47db7b stackId=2, 6 tasks}
mSleepTimeout=false
mCurTaskId=522
mUserStackInFront={0=0, 16=0}
mActivityContainers={0=ActivtyContainer{0}A, 2=ActivtyContainer{2}A}
mLockTaskModeState=NONE mLockTaskPackages (userId:packages)=
0:[]
10:[]
11:[]
12:[]
13:[]
14:[]
15:[]
16:[]
99:[]
mLockTaskModeTasks[]
msy@msy-OptiPlex-7040:~/src/m-alpha-code/packages/apps/SecurityCenter$