improved handling event from downloadManager
Description
Improved logic when DownloadManager triggers any download event. Along with this, an edge case of the installation process is handled, the edge case is if the device is rebooted when the download is completed but reboot happens just before handling the download completed event.
An broadcast receiver is introduced to get logs about current state of the installation process. It will help to debug install-related issues. This is the adb command to trigger the broadcast.
adb shell am broadcast -a foundation.e.apps.action.APP_INSTALL_STATE --receiver-include-background