diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-04-17 23:36:15 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-17 23:36:15 +0000 |
commit | 2d87d76e2d4cde8279d08ca78c910ff0510f8f51 (patch) | |
tree | 609a884c07fa091bb7916484424b14bb63555dc4 /java/com/android/incallui | |
parent | e56213f480d3bd31cf0a7cf87579ce414da39483 (diff) | |
parent | 9dfd6a437098dbaae0f48a7e3ed5205dc41fefe0 (diff) |
Merge "Update in call button logic."
Diffstat (limited to 'java/com/android/incallui')
-rw-r--r-- | java/com/android/incallui/CallButtonPresenter.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java index 7e05badfe..a22a2581f 100644 --- a/java/com/android/incallui/CallButtonPresenter.java +++ b/java/com/android/incallui/CallButtonPresenter.java @@ -16,7 +16,9 @@ package com.android.incallui; +import android.annotation.TargetApi; import android.content.Context; +import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.os.Trace; import android.support.v4.app.Fragment; @@ -441,7 +443,8 @@ public class CallButtonPresenter * * @param call The active call. */ - @SuppressWarnings("MissingPermission") + @TargetApi(VERSION_CODES.N) + @SuppressWarnings(value = {"MissingPermission", "AndroidApiChecker"}) // Java 8 APIs. private void updateButtonsState(DialerCall call) { LogUtil.v("CallButtonPresenter.updateButtonsState", ""); final boolean isVideo = call.isVideoCall(); @@ -459,7 +462,15 @@ public class CallButtonPresenter final boolean showAddCall = TelecomAdapter.getInstance().canAddCall() && UserManagerCompat.isUserUnlocked(context); - final boolean showMerge = call.can(android.telecom.Call.Details.CAPABILITY_MERGE_CONFERENCE); + // There can only be two calls so don't show the ability to merge when one of them + // is a speak easy call. + final boolean showMerge = + InCallPresenter.getInstance() + .getCallList() + .getAllCalls() + .stream() + .noneMatch(c -> c != null && c.isSpeakEasyCall()) + && call.can(android.telecom.Call.Details.CAPABILITY_MERGE_CONFERENCE); final boolean showUpgradeToVideo = !isVideo && (hasVideoCallCapabilities(call)); final boolean showDowngradeToAudio = isVideo && isDowngradeToAudioSupported(call); final boolean showMute = call.can(android.telecom.Call.Details.CAPABILITY_MUTE); |