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

Commit 4eb22a9d authored by Ayush Sharma's avatar Ayush Sharma Committed by Android (Google) Code Review
Browse files

Merge "Check caller perm before clearing binder identity" into udc-dev

parents e484ee0e 4485726c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -368,12 +368,13 @@ public class TelecomServiceImpl {
                }
                synchronized (mLock) {
                    final UserHandle callingUserHandle = Binder.getCallingUserHandle();
                    boolean crossUserAccess = hasInAppCrossUserPermission();
                    long token = Binder.clearCallingIdentity();
                    try {
                        return new ParceledListSlice<>(
                                mPhoneAccountRegistrar.getCallCapablePhoneAccounts(null,
                                        includeDisabledAccounts, callingUserHandle,
                                        hasInAppCrossUserPermission()));
                                        crossUserAccess));
                    } catch (Exception e) {
                        Log.e(this, e, "getCallCapablePhoneAccounts");
                        mAnomalyReporter.reportAnomaly(GET_CALL_CAPABLE_ACCOUNTS_ERROR_UUID,
@@ -646,11 +647,12 @@ public class TelecomServiceImpl {

                synchronized (mLock) {
                    final UserHandle callingUserHandle = Binder.getCallingUserHandle();
                    boolean crossUserAccess = hasInAppCrossUserPermission();
                    long token = Binder.clearCallingIdentity();
                    try {
                        return new ParceledListSlice<>(mPhoneAccountRegistrar
                                .getAllPhoneAccountHandles(callingUserHandle,
                                        hasInAppCrossUserPermission()));
                                        crossUserAccess));
                    } catch (Exception e) {
                        Log.e(this, e, "getAllPhoneAccounts");
                        throw e;
@@ -957,12 +959,13 @@ public class TelecomServiceImpl {
                synchronized (mLock) {
                    enforcePermissionOrPrivilegedDialer(MODIFY_PHONE_STATE, callingPackage);
                    UserHandle callingUserHandle = Binder.getCallingUserHandle();
                    boolean crossUserAccess = hasInAppCrossUserPermission();
                    long token = Binder.clearCallingIdentity();
                    try {
                        Log.i(this, "Silence Ringer requested by %s", callingPackage);
                        Set<UserHandle> userHandles = mCallsManager.getCallAudioManager().
                                silenceRingers(mContext, callingUserHandle,
                                        hasInAppCrossUserPermission());
                                        crossUserAccess);
                        mCallsManager.getInCallController().silenceRinger(userHandles);
                    } finally {
                        Binder.restoreCallingIdentity(token);