Deferred BOOT_COMPLETED broadcast does not mean queue is not idle.
"adb shell am wait-for-broadcast-idle" calls BroadcastDispatcher's isEmpty() method, which return false if there is any deferred BOOT_COMPLETED broadcast. This is wrong because deferred BOOT_COMPLETED is deferred until first time the uid's process is started, this can be indefinitely.
The fix is to create a BroadcastDispatcher.isIdle() method which does not count deferred BOOT_COMPLETED broadcast.
Bug: 229426300
Test: restart device, unlock screen, issue "adb shell am wait-for-broadcast-idle"
Change-Id: Ic660982e0d6daa0728b9eabfd4808f137677e037
3 files changed