Clear calling identity before calling TelephonyManager

Clear calling identity, when calling TelephonyManager, because callerUid must
be the process, where TelephonyManager was instantiated. Otherwise AppOps
check will fail due to process UID mismatch.

We also need to enforce READ_PHONE_STATE permission and do the app op check,
before making calls under new identity.

Bug: 21726452
Bug: 21878243
Change-Id: I26ac122eb2c2940c89dfbf89d6260a938f829217
1 file changed