refactor base code to support one frameworks/miui dev branch

N/A

Change-Id: I97cee7cd4b1b187e22d73ed1d5afc9546af495c9
Ref-Id: I5bdcbab5a64f0912a5b5c82b234466270041c4a3
Revert "Remove post-install processing of auto-start state."

This reverts commit 9e74f29c45d8fd0a383b8bab94c582519a113716.