OSDN Git Service

[ActivityManager] Fix the inconsistence between ProcessRecord and BroadcastQueues
authoryangzhenyu <yangzhenyu@xiaomi.com>
Wed, 31 Aug 2016 10:26:46 +0000 (18:26 +0800)
committeryangzhenyu <yangzhenyu@xiaomi.com>
Mon, 17 Oct 2016 05:58:17 +0000 (13:58 +0800)
commitd509bc93e6d13d46c45707d76ae95a6f735fc037
tree133343cad21f69f627c699d59fa5fa1e1b1c4edb
parent2fbf30d3fe63dc2cb1c5eb225f47091118baa1db
[ActivityManager] Fix the inconsistence between ProcessRecord and BroadcastQueues

Symptom:
Even though one process is executing one BroadcastReceiver,
it may be killed as one EMPTY process occasionally

Detail and sample:
https://code.google.com/p/android/issues/detail?id=221524

Root cause:
app.curReceiver can only remember the last running.
If an application is both receiving FG and BG broadcast,
when one is finished, app.curReceiver becomes null,
the state of application becomes EMPTY.

Solution:
save all running receivers at ProcessRecord

Change-Id: I01b8813af652a8c434be7de0678dc06f99831ae0
Signed-off-by: yangzhenyu <yangzhenyu@xiaomi.com>
services/core/java/com/android/server/am/ActivityManagerService.java
services/core/java/com/android/server/am/BroadcastQueue.java
services/core/java/com/android/server/am/ProcessRecord.java