diff options
| author | Michael W <baddaemon87@gmail.com> | 2016-06-04 16:44:23 +0200 |
|---|---|---|
| committer | LorDClockaN <lordclockan@gmail.com> | 2016-06-07 15:04:06 +0200 |
| commit | b54d921bf5507b8a3aa9d43624fc5c78b59b1835 (patch) | |
| tree | 3aeeda2a809390e588d9bc5ae2bb56bf5ab15ee5 | |
| parent | bce765af1099942e5fccd901d700afd47a484669 (diff) | |
InCallUI: Fix possible OOBs
At least rejectCallWithMessage seems to get called with
phoneId being -1, resulting in an OOB
Fix that case on other places as well
Reference:
BugDump 20160527-0602 L#163
Change-Id: I65ae5bc439ef9a4d4f435369e1c41abe110e02b6
| -rw-r--r-- | src/com/android/incallui/AnswerPresenter.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/incallui/AnswerPresenter.java b/src/com/android/incallui/AnswerPresenter.java index 020d075d..d69d7c7d 100644 --- a/src/com/android/incallui/AnswerPresenter.java +++ b/src/com/android/incallui/AnswerPresenter.java @@ -446,6 +446,10 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> public void onDecline(Context context) { int phoneId = getActivePhoneId(); Log.d(this, "onDecline mCallId:" + mCallId + "phoneId:" + phoneId); + if (phoneId == -1) { + return; + } + if (mCall[phoneId].getSessionModificationState() == Call.SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST) { InCallPresenter.getInstance().declineUpgradeRequest(context); @@ -476,6 +480,10 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> public void onBlockDialogInitialize() { int phoneId = getActivePhoneId(); Log.d(this, "onBlock mCallId:" + mCallId + "phoneId:" + phoneId); + if (phoneId == -1) { + return; + } + Call call = mCall[phoneId]; final String number = call.getNumber(); final Context context = getUi().getContext(); @@ -517,7 +525,11 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> public void rejectCallWithMessage(String message) { int phoneId = getActivePhoneId(); - Log.i(this, "sendTextToDefaultActivity()...phoneId:" + phoneId); + Log.i(this, "rejectCallWithMessage phoneId:" + phoneId); + if (phoneId == -1) { + return; + } + TelecomAdapter.getInstance().rejectCall(mCall[phoneId].getId(), true, message); onDismissDialog(); |
