diff options
Diffstat (limited to 'InCallUI')
9 files changed, 32 insertions, 58 deletions
diff --git a/InCallUI/res/values/strings.xml b/InCallUI/res/values/strings.xml index fc2ee20c8..06b76055f 100644 --- a/InCallUI/res/values/strings.xml +++ b/InCallUI/res/values/strings.xml @@ -589,54 +589,4 @@ <!-- Title for Select Account Dialog [CHAR LIMIT=30] --> <string name="select_account_dialog_title">Select Account</string> - - <!-- The digit to be displayed on the 0 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_0_number">0</string> - <!-- The digit to be displayed on the 1 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_1_number">1</string> - <!-- The digit to be displayed on the 2 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_2_number">2</string> - <!-- The digit to be displayed on the 3 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_3_number">3</string> - <!-- The digit to be displayed on the 4 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_4_number">4</string> - <!-- The digit to be displayed on the 5 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_5_number">5</string> - <!-- The digit to be displayed on the 6 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_6_number">6</string> - <!-- The digit to be displayed on the 7 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_7_number">7</string> - <!-- The digit to be displayed on the 8 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_8_number">8</string> - <!-- The digit to be displayed on the 9 key of the dialpad [CHAR LIMIT=1]--> - <string name="dialpad_9_number">9</string> - <!-- Do not translate. --> - <string name="dialpad_star_number">*</string> - <!-- Do not translate. --> - <string name="dialpad_pound_number">#</string> - - <!-- Do not translate. --> - <string name="dialpad_0_letters">+</string> - <!-- Do not translate. --> - <string name="dialpad_1_letters"></string> - <!-- Do not translate. --> - <string name="dialpad_2_letters">ABC</string> - <!-- Do not translate. --> - <string name="dialpad_3_letters">DEF</string> - <!-- Do not translate. --> - <string name="dialpad_4_letters">GHI</string> - <!-- Do not translate. --> - <string name="dialpad_5_letters">JKL</string> - <!-- Do not translate. --> - <string name="dialpad_6_letters">MNO</string> - <!-- Do not translate. --> - <string name="dialpad_7_letters">PQRS</string> - <!-- Do not translate. --> - <string name="dialpad_8_letters">TUV</string> - <!-- Do not translate. --> - <string name="dialpad_9_letters">WXYZ</string> - <!-- Do not translate. --> - <string name="dialpad_star_letters"></string> - <!-- Do not translate. --> - <string name="dialpad_pound_letters"></string> </resources> diff --git a/InCallUI/src/com/android/incallui/AnswerFragment.java b/InCallUI/src/com/android/incallui/AnswerFragment.java index 4fb79ac06..29747dabd 100644 --- a/InCallUI/src/com/android/incallui/AnswerFragment.java +++ b/InCallUI/src/com/android/incallui/AnswerFragment.java @@ -332,6 +332,11 @@ public class AnswerFragment extends BaseFragment<AnswerPresenter, AnswerPresente } @Override + public Context getContext() { + return getActivity(); + } + + @Override public void onAnswer(int videoState, Context context) { getPresenter().onAnswer(videoState, context); } diff --git a/InCallUI/src/com/android/incallui/AnswerPresenter.java b/InCallUI/src/com/android/incallui/AnswerPresenter.java index 5b4e39abd..4022bb49d 100644 --- a/InCallUI/src/com/android/incallui/AnswerPresenter.java +++ b/InCallUI/src/com/android/incallui/AnswerPresenter.java @@ -99,7 +99,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> getUi().showAnswerUi(true); boolean withSms = call.can(PhoneCapabilities.RESPOND_VIA_TEXT) && textMsgs != null; - if (call.isVideoCall()) { + if (call.isVideoCall(getUi().getContext())) { if (withSms) { getUi().showTargets(AnswerFragment.TARGET_SET_FOR_VIDEO_WITH_SMS); getUi().configureMessageDialog(textMsgs); @@ -187,5 +187,6 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> public void showTargets(int targetSet); public void showMessageDialog(); public void configureMessageDialog(List<String> textResponses); + public Context getContext(); } } diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index 6bd3d0b9d..9948c2172 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -16,6 +16,9 @@ package com.android.incallui; +import com.android.contacts.common.CallUtil; + +import android.content.Context; import android.net.Uri; import android.telecomm.PhoneCapabilities; import android.telecomm.GatewayInfo; @@ -349,8 +352,9 @@ public final class Call { return mTelecommCall.getDetails().getVideoState(); } - public boolean isVideoCall() { - return VideoProfile.VideoState.isBidirectional(getVideoState()); + public boolean isVideoCall(Context context) { + return CallUtil.isVideoEnabled(context) && + VideoProfile.VideoState.isBidirectional(getVideoState()); } public void setSessionModificationState(int state) { diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index b58278bd9..5744cc5a1 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -667,6 +667,11 @@ public class CallButtonFragment } @Override + public Context getContext() { + return getActivity(); + } + + @Override public void showManageConferenceCallButton() { mExtraRowButton.setVisibility(View.VISIBLE); mManageConferenceButton.setVisibility(View.VISIBLE); diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index 6a2419b35..393c0f6ac 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -16,6 +16,7 @@ package com.android.incallui; +import android.content.Context; import android.telecomm.AudioState; import android.telecomm.InCallService.VideoCall; import android.telecomm.PhoneCapabilities; @@ -296,7 +297,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto return; } - if (call.isVideoCall()) { + if (call.isVideoCall(ui.getContext())) { updateVideoCallButtons(); } else { updateVoiceCallButtons(call); @@ -470,5 +471,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto void showManageConferenceCallButton(); void hideExtraRow(); void displayManageConferencePanel(boolean on); + Context getContext(); } } diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 2dc4274c4..5f98aa9df 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -245,7 +245,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> // If the primary call is a video call on hold, still show the contact photo. // If the primary call is an active video call, hide the contact photo. if (mPrimary != null) { - getUi().setPhotoVisible(!(mPrimary.isVideoCall() && callState != Call.State.ONHOLD)); + getUi().setPhotoVisible(!(mPrimary.isVideoCall(mContext) && + callState != Call.State.ONHOLD)); } final boolean enableEndCallButton = Call.State.isConnectingOrConnected(callState) && diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 809d294a7..35f266d9e 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -328,7 +328,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener { addHangupAction(builder); } else if (state == Call.State.INCOMING || state == Call.State.CALL_WAITING) { addDismissAction(builder); - if (call.isVideoCall()) { + if (call.isVideoCall(mContext)) { addVoiceAction(builder); addVideoCallAction(builder); } else { diff --git a/InCallUI/src/com/android/incallui/VideoCallPresenter.java b/InCallUI/src/com/android/incallui/VideoCallPresenter.java index dbbf0387d..f218de265 100644 --- a/InCallUI/src/com/android/incallui/VideoCallPresenter.java +++ b/InCallUI/src/com/android/incallui/VideoCallPresenter.java @@ -24,6 +24,7 @@ import android.telecomm.CameraCapabilities; import android.telecomm.InCallService.VideoCall; import android.view.Surface; +import com.android.contacts.common.CallUtil; import com.android.incallui.InCallPresenter.InCallDetailsListener; import com.android.incallui.InCallPresenter.InCallOrientationListener; import com.android.incallui.InCallPresenter.InCallStateListener; @@ -302,6 +303,11 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi @Override public void onStateChange(InCallPresenter.InCallState oldState, InCallPresenter.InCallState newState, CallList callList) { + // Bail if video calling is disabled for the device. + if (!CallUtil.isVideoEnabled(mContext)) { + return; + } + if (newState == InCallPresenter.InCallState.NO_CALLS) { exitVideoMode(); } @@ -322,7 +328,7 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi if (primary != null) { checkForVideoCallChange(); - mIsVideoCall = mPrimaryCall.isVideoCall(); + mIsVideoCall = mPrimaryCall.isVideoCall(mContext); if (mIsVideoCall) { enterVideoMode(); } else { @@ -366,7 +372,7 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi * Checks to see if the current video state has changed and updates the UI if required. */ private void checkForVideoStateChange() { - boolean newVideoState = mPrimaryCall.isVideoCall(); + boolean newVideoState = mPrimaryCall.isVideoCall(mContext); // Check if video state changed if (mIsVideoCall != newVideoState) { |