summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-09-12 18:44:49 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-12 18:44:49 +0000
commit1035e45fb9c45e191e0eef3cdef6cd33a2a672a7 (patch)
treed7782141ae52916faf0c84df5cfbaf307283b8ad /InCallUI
parent488dd2c863d45ee52bf56b78d8da409697af12ce (diff)
parent6861dc525e2caa9ced087e1c11ad0274e6e6ea12 (diff)
am 74ec7d3b: Disable respond via message option if lockscreen is active
* commit '74ec7d3bde2e536684852eafcaa932d83ef75898': Disable respond via message option if lockscreen is active
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/AnswerPresenter.java12
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 {