diff options
author | Yorke Lee <yorkelee@google.com> | 2014-09-12 18:45:35 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-12 18:45:35 +0000 |
commit | 1f27f3404bd58fc203e1dcec6315fa3f0c12dd5b (patch) | |
tree | 77d6ce59aac3e9d23b96b0c8b292c7db0517899b | |
parent | c1fff9c63eb6cce3658c8f1f131ae0ea9847b79a (diff) | |
parent | 6861dc525e2caa9ced087e1c11ad0274e6e6ea12 (diff) |
am 74ec7d3b: Disable respond via message option if lockscreen is active
* commit '74ec7d3bde2e536684852eafcaa932d83ef75898':
Disable respond via message option if lockscreen is active
-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 { |