diff options
| author | Android Build Merger (Role) <noreply-android-build-merger@google.com> | 2018-05-17 15:03:15 +0000 |
|---|---|---|
| committer | Ryan Longair <rlongair@google.com> | 2018-06-12 11:12:59 -0700 |
| commit | dc504e93b6a0c536f05f19469a480659259c8da6 (patch) | |
| tree | e8f21c5f8ef25935f0963fe9c8935c95023eed20 | |
| parent | 8fa8ce9f5ef3ed8288d5a3f7b260a81d83cfea0f (diff) | |
| download | platform_packages_services_Telephony-nougat-mr1.8-release.tar.gz platform_packages_services_Telephony-nougat-mr1.8-release.tar.bz2 platform_packages_services_Telephony-nougat-mr1.8-release.zip | |
[automerger] DO NOT MERGE Revise security requirements for TelephonyManager#endCall. am: 5ae9c95f56 am: 91971125ebandroid-7.1.1_r61android-7.1.1_r60android-7.1.1_r59nougat-mr1.8-releasenougat-mr1-security-release
Change-Id: Ib528da147242711fe88331db0dd0f1cddb03c93b
(cherry picked from commit e89a641900df35478302230d6693978093b58793)
| -rw-r--r-- | src/com/android/phone/PhoneInterfaceManager.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java index 7f4299edc..3c4a48101 100644 --- a/src/com/android/phone/PhoneInterfaceManager.java +++ b/src/com/android/phone/PhoneInterfaceManager.java @@ -1048,12 +1048,22 @@ public class PhoneInterfaceManager extends ITelephony.Stub { * @return true is a call was ended */ public boolean endCallForSubscriber(int subId) { - if (mApp.checkCallingOrSelfPermission(permission.MODIFY_PHONE_STATE) - != PackageManager.PERMISSION_GRANTED) { - Log.i(LOG_TAG, "endCall: called without modify phone state."); + Phone phone = getPhone(subId); + CallManager callManager = PhoneGlobals.getInstance().getCallManager(); + + // When device is in emergency callback mode or there is an active emergency call, do not + // allow the caller to end the call unless they hold modify phone state permission. + if (phone != null && callManager != null + && (phone.isInEcm() || PhoneUtils.isInEmergencyCall(callManager)) + && mApp.checkCallingOrSelfPermission(permission.MODIFY_PHONE_STATE) + != PackageManager.PERMISSION_GRANTED) { + + Log.i(LOG_TAG, "endCall: called without modify phone state for emergency call."); EventLog.writeEvent(0x534e4554, "67862398", -1, ""); - throw new SecurityException("MODIFY_PHONE_STATE permission required."); + throw new SecurityException( + "MODIFY_PHONE_STATE permission required to end an emergency call."); } + enforceCallPermission(); return (Boolean) sendRequest(CMD_END_CALL, null, new Integer(subId)); } |
