summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2018-02-14 14:19:42 -0800
committerTim Schumacher <timschumi@gmx.de>2018-05-13 22:09:18 +0200
commitac64083ad3270c88576c9867f4445bebd9b3e12e (patch)
treef98b0f8c42be8beafa9d42d8e76ca09244ae097b
parent80b47582404a6ca7b76e678b9414ee7213ccfed0 (diff)
downloadandroid_packages_services_Telephony-cm-11.0.tar.gz
android_packages_services_Telephony-cm-11.0.tar.bz2
android_packages_services_Telephony-cm-11.0.zip
Enhanced permission checks for TelephonyManager#endCall() API.cm-11.0
The existing permission checks require CALL permission in order to end an ongoing call or reject an incoming call. The Telecom equivalent of this API requires MODIFY_PHONE_STATE. Since this API IS in fact a system API, modifying the permission requirements to require the same MODIFY_PHONE_STATE permission. Test: Manual testing per bug reproduction steps. Bug: 67862398 Change-Id: I8f15f6afd00466f6b861079a83e9fa03b962f63f (cherry picked from commit 6707357c6e198287046e76c1d6fc5edf1fcb3fee) (cherry picked from commit ee1901e859ed4624723d18497b70c59b0b658747)
-rw-r--r--src/com/android/phone/PhoneInterfaceManager.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index e9279ad85..8ae732166 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -26,6 +26,7 @@ import android.bluetooth.IBluetoothHeadsetPhone;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.AsyncResult;
@@ -46,6 +47,7 @@ import android.telephony.NeighboringCellInfo;
import android.telephony.CellInfo;
import android.telephony.ServiceState;
import android.text.TextUtils;
+import android.util.EventLog;
import android.util.Log;
import com.android.internal.telephony.CallManager;
@@ -645,7 +647,12 @@ public class PhoneInterfaceManager extends ITelephony.Stub implements CallModele
* @return true is a call was ended
*/
public boolean endCall() {
- enforceCallPermission();
+ if (mApp.checkCallingOrSelfPermission(Manifest.permission.MODIFY_PHONE_STATE)
+ != PackageManager.PERMISSION_GRANTED) {
+ Log.i(LOG_TAG, "endCall: called without modify phone state.");
+ EventLog.writeEvent(0x534e4554, "67862398", -1, "");
+ throw new SecurityException("MODIFY_PHONE_STATE permission required.");
+ }
return (Boolean) sendRequest(CMD_END_CALL, null);
}