Grant app visibility if launching app opts in to sharing identity

Android V introduced new ComponentCaller APIs that allow a launching app
to opt-in to sharing its identity with a launched activity if it goes
into onNewIntent. These APIs (getUid/getPackage) are supposed to
function the same way as the existing
getLaunchedFromUid/getLaunchedFromPackage APIs. Hence, similar to
Change-Id I2b4b2acbd127b01f231c4852704ba69e31c4aaed, this change grants
app visibility if the new intent caller opts in to sharing their
identity. This allows the launched activity to access the details and
signing the identity of the launching app.

The existing CTS in ShareIdentityTest already verify such behaviour.

Bug: 325695307
Test: atest CtsAndroidAppTestCases:android.app.cts.ShareIdentityTest
Test: atest CtsAndroidAppTestCases:android.app.cts.ShareIdentityTest#testActivityNewIntentGetCurrentCallerShareIdentity_explicitIdentityShared_identityAvailableToActivity
Test: atest CtsAndroidAppTestCases:android.app.cts.ShareIdentityTest#testActivityNewIntentOverloadCallerShareIdentity_explicitIdentityShared_identityAvailableToActivity
Test: atest WmTests:ActivityTaskSupervisorTests
Change-Id: I221eef008506c2c7af16e2fb771bd7870b3bbcbe
3 files changed