Clear calling identity before calling createContextAsUser.
In TelecomServiceImpl#callingUidMatchesPackageManagerRecords, we need to
clear the calling identity before invoking mContext.createContextAsUser.
The issue is that createContextUser is trying to enforce NETWORK_STACK
permissions. Clearing the identity beforehand should prevent this issue.
Bug: 278889696
Test: atest TelecomUnitTests
Test: Manual (verified no regressions in basic call flow when calling into TelecomServiceImpl#enforceCallingPackage, which enforces callingUidMatchesPackageManagerRecords under the hood)
Test: Manual (verified invocations to TM#getCallState are not resulting in exceptions when clearing the calling identity
Change-Id: I5d11b564a2afcbf4e3d9371aa5b1fd53189bc118
1 file changed