bluetooth: upgrade the apt-clone system update process

To better handle the exception caused by apt-clone, the following
changes have been implemented to the apt-clone restore process:

1. Before archive the apt-clone folder, the trusted.gpg permission is
   updated to ensure its accessibility by apt-key during the restore
2. Stop the apt-related processes after the update fails to avoid
   potential lock of the frontend.
3. Set the dpkg always to use the old configuration file when the
   updated package comes with a newer configuration file to prevent
   user interaction requests.
4. apt-clone now run with DEBIAN_FRONTEND=noninteractive to prevent
   prompt window asking user interaction.
5. No longer suppress the stdout for the process to help debug.
6. Try to fix the setups and configures installed/updated packages if
   uprev failed.
7. Overwrite bundle commit hash to empty to trigger a re-update when
8. Reboot the device when uprev succeeds to have all changes take

TEST=make remote-install CHAMELEON_HOST=

Change-Id: I8ed6a3a9e7c76e8ab1c000972e37f024f0c94014
Tested-by: Michael Sun <>
Reviewed-by: Shijin Abraham <>
Commit-Queue: Michael Sun <>
1 file changed