Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a66eb18 authored by Grace Jia's avatar Grace Jia Committed by Automerger Merge Worker
Browse files

Fix security vulnerability of TelecomManager#getPhoneAccountsForPackage am:...

Fix security vulnerability of TelecomManager#getPhoneAccountsForPackage am: f3f2d7c2 am: 21bc22a0 am: 0b9f87a4 am: 094c1569 am: 1aadaf8e am: a6a9176d am: 8a0643b5 am: da46dd4e

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/12141784

Change-Id: I03fb2292f53270c3f9c6e76f02d1ac21ee2e4c48
parents f497b48f da46dd4e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -279,6 +279,23 @@ public class TelecomServiceImpl {

        @Override
        public List<PhoneAccountHandle> getPhoneAccountsForPackage(String packageName) {
            //TODO: Deprecate this in S
            try {
                enforceCallingPackage(packageName);
            } catch (SecurityException se1) {
                EventLog.writeEvent(0x534e4554, "153995334", Binder.getCallingUid(),
                        "getPhoneAccountsForPackage: invalid calling package");
                throw se1;
            }

            try {
                enforcePermission(READ_PRIVILEGED_PHONE_STATE);
            } catch (SecurityException se2) {
                EventLog.writeEvent(0x534e4554, "153995334", Binder.getCallingUid(),
                        "getPhoneAccountsForPackage: no permission");
                throw se2;
            }

            synchronized (mLock) {
                final UserHandle callingUserHandle = Binder.getCallingUserHandle();
                long token = Binder.clearCallingIdentity();