diff options
| author | Guobin Zhang <guobin.zhang@intel.com> | 2014-03-07 17:47:10 +0800 |
|---|---|---|
| committer | Craig Mautner <cmautner@google.com> | 2014-12-04 12:26:53 -0800 |
| commit | 53964dac4b841ca549eeea33d2d0fd4a0105e67c (patch) | |
| tree | 745bf3989596c1b7008198cac3bc3e7a0546a8f0 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java | |
| parent | 932c33214729fe2d2b09f82ef60a72871f182654 (diff) | |
ANR caused by incorrect cleanup in BroadcastQueue.
Pulled from aosp.
Fixes bug 18593454.
Two broadcasts could be sent to the same app simultaneously:
one foreground, one background. For example, LOCALE_CHANGED
and PACKAGE_CHANGED are delievered to com.android.vending
at the same time.
1. AMS started new vending process to handle LOCALE_CHANGED.
And set app.curReceiver = LOCALE_CHANGED.
2. Before LOCALE_CHANGED is handled by vending process,
PACKAGE_CHANGED was delievered to vending process too.
AMS set app.curReceiver = PACKAGE_CHANGED. Bad!
3. Vending process finished handling LOCALE_CHANGED.
AMS clear app.curReceiver = NULL. Bad!
And Vending process killed itself without handling
PACKAGE_CHANGED.
4. AMS known vending process has died, but didn't know that
BgBroadcastQueue was still waiting for finish message
for PACKAGE_CHANGED.
At last, BgBroadcastQueue reported ANR for PACKAGE_CHANGED.
This patch adds protection before clearing app.curReceiver,
only set to NULL if the finishing receiver = app.curReceiver
So handleAppDied would know that PACKAGE_CHANGED was not
finished yet, it will abort the broadcast and continue.
Change-Id: Ic4f31b35e21823d4a3c27712391ecbede213a494
Signed-off-by: Guobin Zhang <guobin.zhang@intel.com>
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions
