diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2018-09-14 20:49:40 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-09-14 20:49:40 +0000 |
| commit | 577494a4c6408556af42f476ad02996ae4e9294d (patch) | |
| tree | 73392d3a946c6d4b1bb752885521dfe4ef486a4f | |
| parent | 9165199cf6b4830a0b8d4240627a35d93f5691e1 (diff) | |
| parent | e1f5b435c73fcff888712b8e15aa12f76cae4171 (diff) | |
| download | platform_packages_services_Telephony-nougat-mr0.5-release.tar.gz platform_packages_services_Telephony-nougat-mr0.5-release.tar.bz2 platform_packages_services_Telephony-nougat-mr0.5-release.zip | |
Merge cherrypicks of [5027797, 5027798, 5029209, 5030032, 5023135, 5028893, 5028915, 5028916, 5028917, 5028948, 5028949, 5028950, 5030131, 5030132, 5030133, 5030134, 5030135, 5028894, 5028918, 5030033, 5023136, 5030136, 5029210, 5030171, 5030172, 5030173, 5030174, 5030175, 5030176, 5030177, 5030178, 5030179, 5030180, 5029076, 5029077, 5029078, 5029079, 5029080, 5029081, 5029082, 5029083, 5029084, 5029085, 5029086, 5029087, 5029088, 5029089, 5029090, 5030211, 5030212, 5030213, 5030214, 5030215, 5030216, 5030217, 5020440, 5020441, 5020442, 5030137, 5030034, 5020443, 5030138, 5029124, 5027799, 5029125, 5029126, 5029127, 5023137, 5030139, 5030140, 5029132, 5030141, 5030142, 5030143, 5030181, 5030182, 5030183, 5030184, 5030185, 5030186, 5030187, 5030188, 5030189, 5030190, 5030231, 5030232, 5030233, 5030234, 5030235, 5030236, 5030237, 5030238, 5030239, 5030240, 5030241, 5030242, 5030243, 5030244, 5030245, 5030246, 5030247, 5030248, 5030249, 5030250, 5030271, 5030272, 5030273, 5030274, 5030275, 5030276, 5030277, 5030278, 5030279, 5030280, 5030281, 5020444, 5027800, 5030144] into nyc-bugfix-releaseandroid-7.0.0_r36nougat-mr0.5-release
Change-Id: Ibbac7ed2844ecc92b7c3b50b6a694dbb6e10286e
| -rw-r--r-- | src/com/android/phone/PhoneInterfaceManager.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java index 73822f12b..89dfde2b8 100644 --- a/src/com/android/phone/PhoneInterfaceManager.java +++ b/src/com/android/phone/PhoneInterfaceManager.java @@ -16,6 +16,7 @@ package com.android.phone; +import android.Manifest.permission; import android.app.ActivityManager; import android.app.AppOpsManager; import android.content.ComponentName; @@ -53,6 +54,7 @@ import android.telephony.TelephonyManager; import android.telephony.ModemActivityInfo; import android.text.TextUtils; import android.util.ArraySet; +import android.util.EventLog; import android.util.Log; import android.util.Pair; import android.util.Slog; @@ -975,6 +977,21 @@ public class PhoneInterfaceManager extends ITelephony.Stub { * @return true is a call was ended */ public boolean endCallForSubscriber(int subId) { + 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 to end an emergency call."); + } enforceCallPermission(); return (Boolean) sendRequest(CMD_END_CALL, null, new Integer(subId)); } |
