diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-08-03 19:20:31 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-08-03 19:20:31 +0000 |
commit | 72c9b177b106b9dcd8286d75dcc658d54d9b26ee (patch) | |
tree | 9a9a36050987bec6d6432907ed11a150de5b5e82 | |
parent | e9e5cb8c47e8ea304bf2c3402493f03ffd8bd826 (diff) | |
parent | 075a7105e2d5e6d7647e01c72811a5c6e03cb790 (diff) | |
download | Telephony-oreo-m8-release.tar.gz |
Merge cherrypicks of [4691111, 4689862, 4690575, 4690576, 4690577, 4690578, 4689866, 4689868, 4689869, 4689870, 4691132, 4689456, 4689963, 4691133, 4691134, 4691156, 4691157, 4691159, 4691161, 4690581, 4689964, 4689460, 4691112, 4690582, 4690583, 4691165, 4691166, 4691167, 4691168, 4691169, 4691170, 4691211, 4691212, 4691213, 4691214, 4691215, 4691216, 4691217, 4691218, 4691219, 4691232, 4691233, 4691234, 4691235, 4691236, 4691237, 4691238, 4691239, 4691240, 4691241, 4691243, 4691245, 4691247, 4691249, 4691250, 4691291, 4691292, 4691293, 4691294, 4691295, 4691296, 4691255, 4689476, 4689477, 4689478, 4691223, 4691224, 4691136, 4689479, 4689480, 4691137, 4691225, 4691226, 4691227, 4691371, 4691228, 4691328, 4689967, 4691138, 4691139, 4691140, 4691433, 4689968, 4689969, 4691395, 4691230, 4691297, 4691298, 4691299, 4691300, 4691396, 4691397, 4691398, 4691399, 4691400, 4691401, 4691402, 4691403, 4691404, 4691405, 4691406, 4691407, 4691408, 4691409, 4691410, 4691471, 4691472, 4691473, 4691474, 4691475, 4691476, 4691477, 4691478, 4691479, 4691480, 4691481, 4691482, 4691483, 4691484, 4691485, 4691486, 4691487, 4691488, 4691143, 4691144, 4691511, 4691113, 4689482, 4691533, 4691145, 4691146, 4691147, 4691148, 4691536] into sparse-4732991-L01200000196794104android-8.1.0_r67android-8.1.0_r65android-8.1.0_r64android-8.1.0_r63android-8.1.0_r62android-8.1.0_r61android-8.1.0_r60android-8.1.0_r53android-8.1.0_r51android-8.1.0_r48android-8.1.0_r45oreo-m8-releaseoreo-m4-s12-release
Change-Id: Id6293c7c0fc927ce66e4c955387a776295db6fe3
-rw-r--r-- | src/com/android/phone/EmergencyCallbackModeExitDialog.java | 8 | ||||
-rw-r--r-- | src/com/android/phone/PhoneInterfaceManager.java | 39 |
2 files changed, 37 insertions, 10 deletions
diff --git a/src/com/android/phone/EmergencyCallbackModeExitDialog.java b/src/com/android/phone/EmergencyCallbackModeExitDialog.java index f5509b932..07d518f22 100644 --- a/src/com/android/phone/EmergencyCallbackModeExitDialog.java +++ b/src/com/android/phone/EmergencyCallbackModeExitDialog.java @@ -80,9 +80,11 @@ public class EmergencyCallbackModeExitDialog extends Activity implements OnDismi mPhone = PhoneGlobals.getInstance().getPhoneInEcm(); // Check if phone is in Emergency Callback Mode. If not, exit. - final boolean isInEcm = mPhone.isInEcm(); - Log.i(TAG, "ECMModeExitDialog launched - isInEcm: " + isInEcm + " phone:" + mPhone); - if (mPhone == null || !isInEcm) { + if (mPhone == null || !mPhone.isInEcm()) { + if (mPhone == null) { + android.util.EventLog.writeEvent(0x534e4554, "79995313", -1, ""); + } + Log.i(TAG, "ECMModeExitDialog launched - isInEcm: false" + " phone:" + mPhone); finish(); return; } diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java index 616acda12..f5621e90f 100644 --- a/src/com/android/phone/PhoneInterfaceManager.java +++ b/src/com/android/phone/PhoneInterfaceManager.java @@ -1172,12 +1172,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)); } @@ -2468,9 +2478,24 @@ public class PhoneInterfaceManager extends ITelephony.Stub { * Get the forbidden PLMN List from the given app type (ex APPTYPE_USIM) * on a particular subscription */ - public String[] getForbiddenPlmns(int subId, int appType) { - mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE, - "Requires READ_PHONE_STATE"); + public String[] getForbiddenPlmns(int subId, int appType, String callingPackage) { + + if ((mApp.checkCallingOrSelfPermission( + android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + == PackageManager.PERMISSION_GRANTED + || mApp.checkCallingOrSelfPermission( + android.Manifest.permission.READ_PHONE_STATE) + == PackageManager.PERMISSION_GRANTED) + && mAppOps.noteOp( + AppOpsManager.OP_READ_PHONE_STATE, Binder.getCallingUid(), callingPackage) + != AppOpsManager.MODE_ALLOWED) { + EventLog.writeEvent(0x534e4554, "73884967", Binder.getCallingUid(), + "getForbiddenPlmns calllingPackage: " + callingPackage); + } + + if (!canReadPhoneState(callingPackage, "getForbiddenPlmns")) { + return null; + } if (appType != TelephonyManager.APPTYPE_USIM && appType != TelephonyManager.APPTYPE_SIM) { loge("getForbiddenPlmnList(): App Type must be USIM or SIM"); return null; |