Merge "Enhanced permission checks for TelephonyManager#endCall() API."
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index f03ad35..3fcd6ee 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -77,6 +77,7 @@
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.text.TextUtils;
import android.util.ArraySet;
+import android.util.EventLog;
import android.util.Log;
import android.util.Pair;
import android.util.Slog;
@@ -1185,7 +1186,12 @@
* @return true is a call was ended
*/
public boolean endCallForSubscriber(int subId) {
- enforceCallPermission();
+ if (mApp.checkCallingOrSelfPermission(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, new Integer(subId));
}