Don't kill for REQUEST_INSTALL_PACKAGES on default/error mode
transition.

When handling unknown sources, PackageManager transitions from
MODE_DEFAULT to MODE_ERRORED, causing us to kill the app before the user
has even decided whether to allow external sources or not.

Since MODE_DEFAULT and MODE_ERRORED are the same from a storage point of
view, ignore transitions between the two.

This required some AppOps changes to store the previous mode and pass it
in.

Bug: 162849988
Test: run Epic installer
Change-Id: Ic866216f877e9b727fe70556f66dd998966fe0a2
Merged-In: Ic866216f877e9b727fe70556f66dd998966fe0a2
3 files changed