Moves appID registration outside of scan commit

This refactoring moves us closer to an error-free call to commit
by allowing app ID to be acquired (and returned on failure) outside
of the actual commit call.

Bug: 109941548
Test: install still works
Change-Id: I6bbd50b9ce8aaf665abd6dd89172b667a1c9ee44
2 files changed