diff options
author | Michael W <baddaemon87@gmail.com> | 2016-06-04 16:44:23 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-06-07 03:49:40 -0700 |
commit | 919274abeb189a33e35533825aa0071b1c7e2bc1 (patch) | |
tree | 4a87019c9c54ffa497f57321773f4b70130513da /src | |
parent | 8ce4db214a55c44413b6a2e57024a96da9533677 (diff) | |
download | packages_apps_InCallUI-919274abeb189a33e35533825aa0071b1c7e2bc1.tar.gz packages_apps_InCallUI-919274abeb189a33e35533825aa0071b1c7e2bc1.tar.bz2 packages_apps_InCallUI-919274abeb189a33e35533825aa0071b1c7e2bc1.zip |
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
Diffstat (limited to 'src')
-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(); |