Reject inconsistent rollback/staged settings ASAP (1/n)

Inspired by
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/12343143/1/services/core/java/com/android/server/pm/PackageInstallerSession.java#1555

Since the rollback/staged settings won't change after a session
is created, we can reject such invalid cases in addChildSessionId()
without waiting for it to fail until commit.

This also simplify the error handling in later stages how to fail
and clean up properly when some of the children fail.

Bug: 163976510
Test: N/A, will be added in next CL
Change-Id: I1f41355fa6fce5dd1487378c4b8b396c52915e61
1 file changed