Grant BAL privileges when starting for result

When an app starts an Activity for a result (e.g. using
Activity.startIntentSenderForResult) and passes in a valid (>=0)
resultCode, we consider this as an implicit opt-in to start that
Activity from the background using the the sender's privileges.

Test: atest BackgroundActivityLaunchTest
Bug: 314033453
Change-Id: I8593f13dc82a1d23b2ece7cf51fd8b7247dc1b48
4 files changed