Loading src/com/android/server/telecom/TelecomServiceImpl.java +23 −14 Original line number Diff line number Diff line Loading @@ -1537,15 +1537,21 @@ public class TelecomServiceImpl { int callingUid = Binder.getCallingUid(); int systemUiUid; if (mPackageManager != null && mSystemUiPackageName != null) { long whosCalling = Binder.clearCallingIdentity(); try { try { systemUiUid = mPackageManager.getPackageUid(mSystemUiPackageName, 0); Log.i(TAG, "isSysUiUid: callingUid = " + callingUid + "; systemUiUid = " + systemUiUid); return isSameApp(callingUid, systemUiUid); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "isSysUiUid: caught PackageManager NameNotFoundException = " + e); Log.w(TAG, "isSysUiUid: caught PackageManager NameNotFoundException = " + e); return false; } } finally { Binder.restoreCallingIdentity(whosCalling); } } else { Log.w(TAG, "isSysUiUid: caught null check and returned false; " + "mPackageManager = " + mPackageManager + "; mSystemUiPackageName = " Loading Loading @@ -3317,13 +3323,9 @@ public class TelecomServiceImpl { try { pm = mContext.createContextAsUser( UserHandle.getUserHandleForUid(callingUid), 0).getPackageManager(); } catch (Exception e) { Log.i(this, "callingUidMatchesPackageManagerRecords:" + " createContextAsUser hit exception=[%s]", e.toString()); return false; } finally { Binder.restoreCallingIdentity(token); } // This has to happen inside the scope of the `clearCallingIdentity` block // otherwise the caller may fail to call `TelecomManager#endCall`. if (pm != null) { try { packageUid = pm.getPackageUid(packageName, 0); Loading @@ -3331,6 +3333,13 @@ public class TelecomServiceImpl { // packageUid is -1. } } } catch (Exception e) { Log.i(this, "callingUidMatchesPackageManagerRecords:" + " createContextAsUser hit exception=[%s]", e.toString()); return false; } finally { Binder.restoreCallingIdentity(token); } if (packageUid != callingUid) { Log.i(this, "callingUidMatchesPackageManagerRecords: uid mismatch found for" Loading Loading
src/com/android/server/telecom/TelecomServiceImpl.java +23 −14 Original line number Diff line number Diff line Loading @@ -1537,15 +1537,21 @@ public class TelecomServiceImpl { int callingUid = Binder.getCallingUid(); int systemUiUid; if (mPackageManager != null && mSystemUiPackageName != null) { long whosCalling = Binder.clearCallingIdentity(); try { try { systemUiUid = mPackageManager.getPackageUid(mSystemUiPackageName, 0); Log.i(TAG, "isSysUiUid: callingUid = " + callingUid + "; systemUiUid = " + systemUiUid); return isSameApp(callingUid, systemUiUid); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "isSysUiUid: caught PackageManager NameNotFoundException = " + e); Log.w(TAG, "isSysUiUid: caught PackageManager NameNotFoundException = " + e); return false; } } finally { Binder.restoreCallingIdentity(whosCalling); } } else { Log.w(TAG, "isSysUiUid: caught null check and returned false; " + "mPackageManager = " + mPackageManager + "; mSystemUiPackageName = " Loading Loading @@ -3317,13 +3323,9 @@ public class TelecomServiceImpl { try { pm = mContext.createContextAsUser( UserHandle.getUserHandleForUid(callingUid), 0).getPackageManager(); } catch (Exception e) { Log.i(this, "callingUidMatchesPackageManagerRecords:" + " createContextAsUser hit exception=[%s]", e.toString()); return false; } finally { Binder.restoreCallingIdentity(token); } // This has to happen inside the scope of the `clearCallingIdentity` block // otherwise the caller may fail to call `TelecomManager#endCall`. if (pm != null) { try { packageUid = pm.getPackageUid(packageName, 0); Loading @@ -3331,6 +3333,13 @@ public class TelecomServiceImpl { // packageUid is -1. } } } catch (Exception e) { Log.i(this, "callingUidMatchesPackageManagerRecords:" + " createContextAsUser hit exception=[%s]", e.toString()); return false; } finally { Binder.restoreCallingIdentity(token); } if (packageUid != callingUid) { Log.i(this, "callingUidMatchesPackageManagerRecords: uid mismatch found for" Loading