summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorriddle_hsu <riddle_hsu@htc.com>2014-11-15 18:07:26 +0800
committerriddle hsu <riddle_hsu@htc.com>2014-11-15 10:11:37 +0000
commit5ed21bd9aca01f01e2b27e2bfa031d31c775eec7 (patch)
treef5462d6d0932153502c514ea6e4d65d0304d93ab /tools/aapt2/java/JavaClassGenerator_test.cpp
parent5e6cf24213c5eacc9d3e3c8da5826be4a23f22af (diff)
[ActivityManager] Avoid orphan ContentProviderRecord.
<Symptom> Binder threads wait forever results ANR/system hang. <Root cause> When X is accessing Y's provider. Before Y publishing its provider to notify X, someone invokes killBackgroundProcesses to kill Y. In removeProcessLocked, it will pass restarting=true and allowRestart=true to handleAppDiedLocked. When the clean flow going to removeDyingProviderLocked. The variable will be inLaunching=true always=false. Then it will not notify the ContentProviderRecord. And also due to the ContentProviderConnection waiting=true, it will do nothing and just return true to cleanUpApplicationRecordLocked to set restart as true. But due to restarting=true, the restart flow will not execute, then the waiting ContentProviderRecord for X will be orphan and keep waiting. <Reproduce step> Service X query provider Y when X's oom adj is SERVICE_ADJ, before Y's publish provider, invoke killBackgroundProcesses to Y's package. Then use command "adb shell dumpsys activity prov" Y will always in "Launching content providers". <Solution> For not restarting case, pass restarting=false to handleAppDiedLocked to let the provider process can be restarted. A more simple way maybe just change to keep below 2 lines: app.kill(reason, true); handleAppDiedLocked(app, callerWillRestart, allowRestart); Change-Id: I8992cb851fce4dbe6255da71d60390e1a33cb9c7
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions