diff options
author | Yorke Lee <yorkelee@google.com> | 2014-09-08 14:24:23 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-09-12 10:23:29 -0700 |
commit | 6861dc525e2caa9ced087e1c11ad0274e6e6ea12 (patch) | |
tree | 1d969a82a7e200dea020090ba2c7d1052c3753f6 /InCallUI/src/com/android | |
parent | bf169911874596e7f9757fd186250a9c43af347e (diff) |
Disable respond via message option if lockscreen is active
Bug: 17399771
Change-Id: I54cdbd41df05c932ed8c5a61a9bc7f8eba9c8153
Diffstat (limited to 'InCallUI/src/com/android')
-rw-r--r-- | InCallUI/src/com/android/incallui/AnswerPresenter.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/AnswerPresenter.java b/InCallUI/src/com/android/incallui/AnswerPresenter.java index 4022bb49d..aeb0bc3c5 100644 --- a/InCallUI/src/com/android/incallui/AnswerPresenter.java +++ b/InCallUI/src/com/android/incallui/AnswerPresenter.java @@ -17,6 +17,7 @@ package com.android.incallui; import android.telecomm.PhoneCapabilities; +import android.app.KeyguardManager; import android.content.Context; import java.util.List; @@ -98,16 +99,21 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> final List<String> textMsgs = CallList.getInstance().getTextResponses(call.getId()); getUi().showAnswerUi(true); + final Context context = getUi().getContext(); + final KeyguardManager km = + (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); + final boolean isLockScreenShowing = km.inKeyguardRestrictedInputMode(); + boolean withSms = call.can(PhoneCapabilities.RESPOND_VIA_TEXT) && textMsgs != null; - if (call.isVideoCall(getUi().getContext())) { - if (withSms) { + if (call.isVideoCall(context)) { + if (withSms && !isLockScreenShowing) { getUi().showTargets(AnswerFragment.TARGET_SET_FOR_VIDEO_WITH_SMS); getUi().configureMessageDialog(textMsgs); } else { getUi().showTargets(AnswerFragment.TARGET_SET_FOR_VIDEO_WITHOUT_SMS); } } else { - if (withSms) { + if (withSms && !isLockScreenShowing) { getUi().showTargets(AnswerFragment.TARGET_SET_FOR_AUDIO_WITH_SMS); getUi().configureMessageDialog(textMsgs); } else { |