diff options
author | Vinit Deshpande <vinitd@google.com> | 2015-03-16 00:53:48 -0700 |
---|---|---|
committer | Vinit Deshpande <vinitd@google.com> | 2015-03-16 00:53:48 -0700 |
commit | df3be1ebad0d471c5c0ef8b11db457a1c5371a50 (patch) | |
tree | a9f7ce4252c3c1cf972d1fdc95017da8eee793a9 /InCallUI | |
parent | 082361476389bc5136fc3d97721b5a9997cde7dc (diff) | |
parent | c4fac46c65d20da815b37f3d1dbe2ff748fa1f00 (diff) |
Merge remote-tracking branch 'goog/mirror-m-wireless-internal-release'
Change-Id: I9f37386b36eeee2afffb20464265f92d5c5942d3
Diffstat (limited to 'InCallUI')
25 files changed, 163 insertions, 68 deletions
diff --git a/InCallUI/res/drawable-hdpi/ic_hd_18dp.png b/InCallUI/res/drawable-hdpi/ic_hd_18dp.png Binary files differnew file mode 100644 index 000000000..ade1788c1 --- /dev/null +++ b/InCallUI/res/drawable-hdpi/ic_hd_18dp.png diff --git a/InCallUI/res/drawable-hdpi/ic_hd_audio.png b/InCallUI/res/drawable-hdpi/ic_hd_audio.png Binary files differdeleted file mode 100644 index cccaf4949..000000000 --- a/InCallUI/res/drawable-hdpi/ic_hd_audio.png +++ /dev/null diff --git a/InCallUI/res/drawable-hdpi/ic_signal_wifi_4_bar_18dp.png b/InCallUI/res/drawable-hdpi/ic_signal_wifi_4_bar_18dp.png Binary files differnew file mode 100644 index 000000000..d7b98055e --- /dev/null +++ b/InCallUI/res/drawable-hdpi/ic_signal_wifi_4_bar_18dp.png diff --git a/InCallUI/res/drawable-mdpi/ic_hd_18dp.png b/InCallUI/res/drawable-mdpi/ic_hd_18dp.png Binary files differnew file mode 100644 index 000000000..82c972646 --- /dev/null +++ b/InCallUI/res/drawable-mdpi/ic_hd_18dp.png diff --git a/InCallUI/res/drawable-mdpi/ic_hd_audio.png b/InCallUI/res/drawable-mdpi/ic_hd_audio.png Binary files differdeleted file mode 100644 index 6353b7acf..000000000 --- a/InCallUI/res/drawable-mdpi/ic_hd_audio.png +++ /dev/null diff --git a/InCallUI/res/drawable-mdpi/ic_signal_wifi_4_bar_18dp.png b/InCallUI/res/drawable-mdpi/ic_signal_wifi_4_bar_18dp.png Binary files differnew file mode 100644 index 000000000..d537ab469 --- /dev/null +++ b/InCallUI/res/drawable-mdpi/ic_signal_wifi_4_bar_18dp.png diff --git a/InCallUI/res/drawable-xhdpi/ic_hd_18dp.png b/InCallUI/res/drawable-xhdpi/ic_hd_18dp.png Binary files differnew file mode 100644 index 000000000..35bf51a4f --- /dev/null +++ b/InCallUI/res/drawable-xhdpi/ic_hd_18dp.png diff --git a/InCallUI/res/drawable-xhdpi/ic_hd_audio.png b/InCallUI/res/drawable-xhdpi/ic_hd_audio.png Binary files differdeleted file mode 100644 index 6d05d45f5..000000000 --- a/InCallUI/res/drawable-xhdpi/ic_hd_audio.png +++ /dev/null diff --git a/InCallUI/res/drawable-xhdpi/ic_signal_wifi_4_bar_18dp.png b/InCallUI/res/drawable-xhdpi/ic_signal_wifi_4_bar_18dp.png Binary files differnew file mode 100644 index 000000000..5a5319212 --- /dev/null +++ b/InCallUI/res/drawable-xhdpi/ic_signal_wifi_4_bar_18dp.png diff --git a/InCallUI/res/drawable-xxhdpi/ic_hd_18dp.png b/InCallUI/res/drawable-xxhdpi/ic_hd_18dp.png Binary files differnew file mode 100644 index 000000000..510aa6e8b --- /dev/null +++ b/InCallUI/res/drawable-xxhdpi/ic_hd_18dp.png diff --git a/InCallUI/res/drawable-xxhdpi/ic_hd_audio.png b/InCallUI/res/drawable-xxhdpi/ic_hd_audio.png Binary files differdeleted file mode 100644 index 44294ba05..000000000 --- a/InCallUI/res/drawable-xxhdpi/ic_hd_audio.png +++ /dev/null diff --git a/InCallUI/res/drawable-xxhdpi/ic_signal_wifi_4_bar_18dp.png b/InCallUI/res/drawable-xxhdpi/ic_signal_wifi_4_bar_18dp.png Binary files differnew file mode 100644 index 000000000..b627198f5 --- /dev/null +++ b/InCallUI/res/drawable-xxhdpi/ic_signal_wifi_4_bar_18dp.png diff --git a/InCallUI/res/drawable-xxxhdpi/ic_hd_18dp.png b/InCallUI/res/drawable-xxxhdpi/ic_hd_18dp.png Binary files differnew file mode 100644 index 000000000..dd08bbbec --- /dev/null +++ b/InCallUI/res/drawable-xxxhdpi/ic_hd_18dp.png diff --git a/InCallUI/res/drawable-xxxhdpi/ic_hd_audio.png b/InCallUI/res/drawable-xxxhdpi/ic_hd_audio.png Binary files differdeleted file mode 100644 index 459cd8f46..000000000 --- a/InCallUI/res/drawable-xxxhdpi/ic_hd_audio.png +++ /dev/null diff --git a/InCallUI/res/drawable-xxxhdpi/ic_signal_wifi_4_bar_18dp.png b/InCallUI/res/drawable-xxxhdpi/ic_signal_wifi_4_bar_18dp.png Binary files differnew file mode 100644 index 000000000..f4105ec8d --- /dev/null +++ b/InCallUI/res/drawable-xxxhdpi/ic_signal_wifi_4_bar_18dp.png diff --git a/InCallUI/res/layout/primary_call_info.xml b/InCallUI/res/layout/primary_call_info.xml index cb9cc2498..9f92b07e7 100644 --- a/InCallUI/res/layout/primary_call_info.xml +++ b/InCallUI/res/layout/primary_call_info.xml @@ -43,22 +43,21 @@ <!-- Subscription provider or WiFi calling icon displayed to the left of the label --> <ImageView android:id="@+id/callStateIcon" android:layout_width="16dp" - android:layout_height="16dp" - android:layout_marginEnd="4dp" - android:baselineAlignBottom="true" + android:layout_height="match_parent" + android:layout_marginEnd="8dp" android:tint="@color/incall_accent_color" android:alpha="0.0" - android:scaleType="centerInside" + android:scaleType="center" android:visibility="gone" /> <ImageView android:id="@+id/videoCallIcon" android:src="@drawable/ic_toolbar_video" android:layout_width="16dp" - android:layout_height="16dp" - android:layout_marginEnd="4dp" + android:layout_height="match_parent" + android:layout_marginEnd="16dp" android:baselineAlignBottom="true" android:tint="@color/incall_accent_color" - android:scaleType="centerInside" + android:scaleType="center" android:visibility="gone" /> <TextView android:id="@+id/callStateLabel" @@ -96,31 +95,40 @@ android:clipChildren="false" android:clipToPadding="false"> + <ImageView android:id="@+id/hdAudioIcon" + android:src="@drawable/ic_hd_18dp" + android:layout_width="16dp" + android:layout_height="match_parent" + android:layout_marginEnd="8dp" + android:tint="@color/incall_call_banner_subtext_color" + android:scaleType="center" + android:visibility="gone" /> + <!-- Label (like "Mobile" or "Work", if present) and phone number, side by side --> <LinearLayout android:id="@+id/labelAndNumber" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> - <TextView android:id="@+id/label" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="@color/incall_call_banner_subtext_color" - android:textSize="@dimen/call_label_text_size" - android:singleLine="true" - android:textDirection="ltr" - android:visibility="gone" /> - - <TextView android:id="@+id/phoneNumber" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginStart="6dp" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="@color/incall_call_banner_subtext_color" - android:textSize="@dimen/call_label_text_size" - android:singleLine="true" - android:visibility="gone" /> + <TextView android:id="@+id/label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textColor="@color/incall_call_banner_subtext_color" + android:textSize="@dimen/call_label_text_size" + android:singleLine="true" + android:textDirection="ltr" + android:visibility="gone" /> + + <TextView android:id="@+id/phoneNumber" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="6dp" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textColor="@color/incall_call_banner_subtext_color" + android:textSize="@dimen/call_label_text_size" + android:singleLine="true" + android:visibility="gone" /> </LinearLayout> @@ -129,7 +137,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:layout_centerVertical="true" android:textAlignment="viewEnd" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/incall_call_banner_subtext_color" diff --git a/InCallUI/res/values-zh-rTW/strings.xml b/InCallUI/res/values-zh-rTW/strings.xml index 508a653f1..724fd9140 100644 --- a/InCallUI/res/values-zh-rTW/strings.xml +++ b/InCallUI/res/values-zh-rTW/strings.xml @@ -72,7 +72,7 @@ <string name="notification_action_answer_video" msgid="7809271910870211729">"視訊"</string> <string name="notification_action_answer_voice" msgid="1770796916369437773">"語音"</string> <string name="notification_action_accept" msgid="2898609801209468429">"接受"</string> - <string name="notification_action_dismiss" msgid="2679969397930852858">"拒絶"</string> + <string name="notification_action_dismiss" msgid="2679969397930852858">"關閉"</string> <string name="notification_missedCall_call_back" msgid="2684890353590890187">"回撥"</string> <string name="notification_missedCall_message" msgid="3049928912736917988">"簡訊"</string> <string name="incall_error_power_off" msgid="6550191216405193368">"撥號前,請先關閉飛航模式。"</string> diff --git a/InCallUI/res/values/strings.xml b/InCallUI/res/values/strings.xml index e8cc64c10..944eff6fc 100644 --- a/InCallUI/res/values/strings.xml +++ b/InCallUI/res/values/strings.xml @@ -141,13 +141,18 @@ <!-- Missed call notification message used for a single missed call, including the caller-id info from the missed call --> <string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string> - <!-- The "label" of the in-call Notification for an ongoing call, used - as the format string for a Chronometer widget. [CHAR LIMIT=60] --> + <!-- The "label" of the in-call Notification for an ongoing call. [CHAR LIMIT=60] --> <string name="notification_ongoing_call">Ongoing call</string> + <!-- The "label" of the in-call Notification for an ongoing call, which is being made over + Wi-Fi. [CHAR LIMIT=60] --> + <string name="notification_ongoing_call_wifi">Ongoing Wi-Fi call</string> <!-- The "label" of the in-call Notification for a call that's on hold --> <string name="notification_on_hold">On hold</string> - <!-- The "label" of the in-call Notification for an incoming ringing call --> + <!-- The "label" of the in-call Notification for an incoming ringing call. [CHAR LIMIT=60] --> <string name="notification_incoming_call">Incoming call</string> + <!-- The "label" of the in-call Notification for an incoming ringing call, + which is being made over Wi-Fi. [CHAR LIMIT=60] --> + <string name="notification_incoming_call_wifi">Incoming Wi-Fi call</string> <!-- The "label" of the in-call Notification for an incoming ringing video call. --> <string name="notification_incoming_video_call">Incoming video call</string> <!-- The "label" of the in-call Notification for upgrading an existing call to a video call. --> diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index 2060944cd..b6cfb9e7b 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -392,8 +392,12 @@ class Call { } public boolean isVideoCall(Context context) { - return CallUtil.isVideoEnabled(context) && - VideoProfile.VideoState.isBidirectional(getVideoState()); + // We want to show Video call buttons even if only one direction is enabled + // (That is what is happening when we receive a video call for example) + return CallUtil.isVideoEnabled(context) && ( + VideoProfile.VideoState.isBidirectional(getVideoState()) || + VideoProfile.VideoState.isReceptionEnabled(getVideoState()) || + VideoProfile.VideoState.isTransmissionEnabled(getVideoState())); } public void setSessionModificationState(int state) { diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 1b17d35d3..3080aacef 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -74,6 +74,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr private ImageView mCallStateVideoCallIcon; private TextView mCallStateLabel; private TextView mCallTypeLabel; + private ImageView mHdAudioIcon; private View mCallNumberAndLabel; private ImageView mPhoto; private TextView mElapsedTime; @@ -168,6 +169,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr mCallStateIcon = (ImageView) view.findViewById(R.id.callStateIcon); mCallStateVideoCallIcon = (ImageView) view.findViewById(R.id.videoCallIcon); mCallStateLabel = (TextView) view.findViewById(R.id.callStateLabel); + mHdAudioIcon = (ImageView) view.findViewById(R.id.hdAudioIcon); mCallNumberAndLabel = view.findViewById(R.id.labelAndNumber); mCallTypeLabel = (TextView) view.findViewById(R.id.callTypeLabel); mElapsedTime = (TextView) view.findViewById(R.id.elapsedTime); @@ -785,6 +787,16 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } /** + * Changes the visibility of the HD audio icon. + * + * @param visible {@code true} if the UI should show the HD audio icon. + */ + @Override + public void showHdAudioIndicator(boolean visible) { + mHdAudioIcon.setVisibility(visible ? View.VISIBLE : View.GONE); + } + + /** * Changes the visibility of the "manage conference call" button. * * @param visible Whether to set the button to be visible or not. diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index ab93c2d8e..3aecca4e8 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -25,7 +25,9 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.net.Uri; +import android.net.wifi.WifiManager; import android.os.Bundle; +import android.telecom.Call.Details; import android.telecom.DisconnectCause; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; @@ -67,7 +69,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> private ContactCacheEntry mPrimaryContactInfo; private ContactCacheEntry mSecondaryContactInfo; private CallTimer mCallTimer; + private Context mContext; + private WifiManager mWifiManager; public static class ContactLookupCallback implements ContactInfoCacheCallback { private final WeakReference<CallCardPresenter> mCallCardPresenter; @@ -108,6 +112,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> public void init(Context context, Call call) { mContext = Preconditions.checkNotNull(context); + mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); // Call may be null if disconnect happened already. if (call != null) { @@ -222,7 +227,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } // Start/stop timers. - if (mPrimary != null && mPrimary.getState() == Call.State.ACTIVE) { + if (isPrimaryCallActive()) { Log.d(this, "Starting the calltime timer"); mCallTimer.start(CALL_TIME_UPDATE_INTERVAL_MS); } else { @@ -245,6 +250,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> null, null, null); + getUi().showHdAudioIndicator(false); } // Hide/show the contact photo based on the video state. @@ -265,13 +271,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } @Override - public void onDetailsChanged(Call call, android.telecom.Call.Details details) { + public void onDetailsChanged(Call call, Details details) { updatePrimaryCallState(); - if (call.can(android.telecom.Call.Details.CAPABILITY_MANAGE_CONFERENCE) != - android.telecom.Call.Details.can( - details.getCallCapabilities(), - android.telecom.Call.Details.CAPABILITY_MANAGE_CONFERENCE)) { + if (call.can(Details.CAPABILITY_MANAGE_CONFERENCE) != + Details.can(details.getCallCapabilities(), Details.CAPABILITY_MANAGE_CONFERENCE)) { maybeShowManageConferenceCallButton(); } } @@ -301,6 +305,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> getConnectionLabel(), getCallStateIcon(), getGatewayNumber()); + + boolean showHdAudioIndicator = + isPrimaryCallActive() && primaryCallCan(Details.CAPABILITY_HIGH_DEF_AUDIO); + getUi().showHdAudioIndicator(showHdAudioIndicator); + setCallbackNumber(); } } @@ -323,15 +332,21 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return false; } - return mPrimary.can(android.telecom.Call.Details.CAPABILITY_MANAGE_CONFERENCE); + return mPrimary.can(Details.CAPABILITY_MANAGE_CONFERENCE); } private void setCallbackNumber() { String callbackNumber = null; + // Show the emergency callback number if either: + // 1. This is an emergency call. + // 2. The phone is in Emergency Callback Mode, which means we should show the callback + // number. boolean isEmergencyCall = PhoneNumberUtils.isEmergencyNumber( getNumberFromHandle(mPrimary.getHandle())); - if (isEmergencyCall) { + boolean showCallbackNumber = mPrimary.can(Details.CAPABILITY_SHOW_CALLBACK_NUMBER); + + if (isEmergencyCall || showCallbackNumber) { callbackNumber = getSubscriptionNumber(); } else { StatusHints statusHints = mPrimary.getTelecommCall().getDetails().getStatusHints(); @@ -345,21 +360,22 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> TelecomManager mgr = InCallPresenter.getInstance().getTelecomManager(); String simNumber = mgr.getLine1Number(mPrimary.getAccountHandle()); - if (PhoneNumberUtils.compare(callbackNumber, simNumber)) { - Log.d(this, "Numbers are the same; not showing the callback number"); + if (!showCallbackNumber && PhoneNumberUtils.compare(callbackNumber, simNumber)) { + Log.d(this, "Numbers are the same (and callback number is not being forced to show);" + + " not showing the callback number"); callbackNumber = null; } - getUi().setCallbackNumber(callbackNumber, isEmergencyCall); + getUi().setCallbackNumber(callbackNumber, isEmergencyCall || showCallbackNumber); } public void updateCallTime() { final CallCardUi ui = getUi(); - if (ui == null || mPrimary == null || mPrimary.getState() != Call.State.ACTIVE) { - if (ui != null) { - ui.setPrimaryCallElapsedTime(false, 0); - } + if (ui == null) { + mCallTimer.cancel(); + } else if (!isPrimaryCallActive()) { + ui.setPrimaryCallElapsedTime(false, 0); mCallTimer.cancel(); } else { final long callStart = mPrimary.getConnectTimeMillis(); @@ -594,6 +610,13 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return statusHints.getLabel().toString(); } + // Assume the SSID of the connection reported by the WifiManager is the name of the wifi + // network used for calling, since currently a phone only connects to a single wifi network. + if (isPrimaryCallActive() && primaryCallCan(Details.CAPABILITY_WIFI) + && mWifiManager.getConnectionInfo() != null) { + return formatWifiSSID(mWifiManager.getConnectionInfo().getSSID()); + } + if (hasOutgoingGatewayCall() && getUi() != null) { // Return the label for the gateway app on outgoing calls. final PackageManager pm = mContext.getPackageManager(); @@ -619,11 +642,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } } - // Return high definition audio icon if the capability is indicated. - if (mPrimary.getTelecommCall().getDetails().can( - android.telecom.Call.Details.CAPABILITY_HIGH_DEF_AUDIO) - && mPrimary.getState() == Call.State.ACTIVE) { - return mContext.getResources().getDrawable(R.drawable.ic_hd_audio); + if (primaryCallCan(Details.CAPABILITY_WIFI) && (isPrimaryCallActive() + || (mPrimary != null && mPrimary.getState() == Call.State.INCOMING))) { + return mContext.getResources().getDrawable(R.drawable.ic_signal_wifi_4_bar_18dp); } return null; @@ -703,9 +724,16 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> ui.setCallCardVisible(!isFullScreenVideo); } + private boolean isPrimaryCallActive() { + return mPrimary != null && mPrimary.getState() == Call.State.ACTIVE; + } + + private boolean primaryCallCan(int capability) { + return mPrimary.getTelecommCall().getDetails().can(capability); + } + private String getConferenceString(Call call) { - boolean isGenericConference = call.can( - android.telecom.Call.Details.CAPABILITY_GENERIC_CONFERENCE); + boolean isGenericConference = call.can(Details.CAPABILITY_GENERIC_CONFERENCE); Log.v(this, "getConferenceString: " + isGenericConference); final int resId = isGenericConference @@ -714,8 +742,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } private Drawable getConferencePhoto(Call call) { - boolean isGenericConference = call.can( - android.telecom.Call.Details.CAPABILITY_GENERIC_CONFERENCE); + boolean isGenericConference = call.can(Details.CAPABILITY_GENERIC_CONFERENCE); Log.v(this, "getConferencePhoto: " + isGenericConference); final int resId = isGenericConference @@ -725,6 +752,34 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return photo; } + /** + * Strip quotations off the outside of a Wifi SSID identifier. For example, \"GoogleGuest\" + * becomes GoogleGuest. + * + * TODO: Move into utility class. + * TODO: Add unit tests. + * + * @param ssid The ssid of the wifi network. + */ + private String formatWifiSSID(String ssid) { + if (TextUtils.isEmpty(ssid)) { + return ""; + } + + // Trim quotation if first character. + if (ssid.charAt(0) == '\"') { + ssid = ssid.substring(1); + } + + // Trim quotation if last character. + int lastIndex = ssid.length() - 1; + if (lastIndex >= 0 && ssid.charAt(lastIndex) == '\"') { + ssid = ssid.substring(0, lastIndex); + } + + return ssid; + } + public interface CallCardUi extends Ui { void setVisible(boolean on); void setCallCardVisible(boolean visible); @@ -744,6 +799,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> void setCallbackNumber(String number, boolean isEmergencyCalls); void setPhotoVisible(boolean isVisible); void setProgressSpinnerVisible(boolean visible); + void showHdAudioIndicator(boolean visible); void showManageConferenceCallButton(boolean visible); boolean isManageConferenceVisible(); void animateForNewOutgoingCall(); diff --git a/InCallUI/src/com/android/incallui/GlowPadWrapper.java b/InCallUI/src/com/android/incallui/GlowPadWrapper.java index 47547125b..b50fdd8c2 100644 --- a/InCallUI/src/com/android/incallui/GlowPadWrapper.java +++ b/InCallUI/src/com/android/incallui/GlowPadWrapper.java @@ -124,6 +124,7 @@ public class GlowPadWrapper extends GlowPadView implements GlowPadView.OnTrigger mTargetTriggered = true; break; case R.drawable.ic_videocam: + case R.drawable.ic_lockscreen_answer_video: mAnswerListener.onAnswer(VideoProfile.VideoState.BIDIRECTIONAL, getContext()); mTargetTriggered = true; break; diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 89192f882..bdc27691b 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -30,6 +30,7 @@ import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.os.Handler; import android.os.Message; +import android.telecom.Call.Details; import android.telecom.PhoneAccount; import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; @@ -388,8 +389,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener { * Returns the main string to use in the notification. */ private String getContentTitle(ContactCacheEntry contactInfo, Call call) { - if (call.isConferenceCall() - && !call.can(android.telecom.Call.Details.CAPABILITY_GENERIC_CONFERENCE)) { + if (call.isConferenceCall() && !call.can(Details.CAPABILITY_GENERIC_CONFERENCE)) { return mContext.getResources().getString(R.string.card_title_conf_call); } if (TextUtils.isEmpty(contactInfo.name)) { @@ -416,8 +416,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener { */ private Bitmap getLargeIconToDisplay(ContactCacheEntry contactInfo, Call call) { Bitmap largeIcon = null; - if (call.isConferenceCall() - && !call.can(android.telecom.Call.Details.CAPABILITY_GENERIC_CONFERENCE)) { + if (call.isConferenceCall() && !call.can(Details.CAPABILITY_GENERIC_CONFERENCE)) { largeIcon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.img_conference); } @@ -461,9 +460,16 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener { */ private int getContentString(Call call) { int resId = R.string.notification_ongoing_call; + if (call.can(Details.CAPABILITY_WIFI)) { + resId = R.string.notification_ongoing_call_wifi; + } if (call.getState() == Call.State.INCOMING || call.getState() == Call.State.CALL_WAITING) { - resId = R.string.notification_incoming_call; + if (call.can(Details.CAPABILITY_WIFI)) { + resId = R.string.notification_incoming_call_wifi; + } else { + resId = R.string.notification_incoming_call; + } } else if (call.getState() == Call.State.ONHOLD) { resId = R.string.notification_on_hold; } else if (Call.State.isDialing(call.getState())) { diff --git a/InCallUI/src/com/android/incallui/VideoCallFragment.java b/InCallUI/src/com/android/incallui/VideoCallFragment.java index 0b5bb4b23..7859a17bc 100644 --- a/InCallUI/src/com/android/incallui/VideoCallFragment.java +++ b/InCallUI/src/com/android/incallui/VideoCallFragment.java @@ -164,7 +164,7 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter, // orientation change. if (mSavedSurfaceTexture == null) { mSavedSurfaceTexture = surfaceTexture; - surfaceCreated = createSurface(); + surfaceCreated = createSurface(width, height); } else { // A saved SurfaceTexture was found. surfaceCreated = true; @@ -266,18 +266,20 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter, mHeight = height; if (mSavedSurfaceTexture != null) { - createSurface(); + createSurface(width, height); } } /** * Creates the {@link Surface}, adjusting the {@link SurfaceTexture} buffer size. + * @param width The width of the surface to create. + * @param height The height of the surface to create. */ - private boolean createSurface() { - if (mWidth != DIMENSIONS_NOT_SET && mHeight != DIMENSIONS_NOT_SET && - mSavedSurfaceTexture != null) { + private boolean createSurface(int width, int height) { + if (width != DIMENSIONS_NOT_SET && height != DIMENSIONS_NOT_SET + && mSavedSurfaceTexture != null) { - mSavedSurfaceTexture.setDefaultBufferSize(mWidth, mHeight); + mSavedSurfaceTexture.setDefaultBufferSize(width, height); mSavedSurface = new Surface(mSavedSurfaceTexture); return true; } diff --git a/InCallUI/src/com/android/incallui/VideoCallPresenter.java b/InCallUI/src/com/android/incallui/VideoCallPresenter.java index ed0024126..c566264c1 100644 --- a/InCallUI/src/com/android/incallui/VideoCallPresenter.java +++ b/InCallUI/src/com/android/incallui/VideoCallPresenter.java @@ -256,6 +256,8 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi mVideoCall.setDisplaySurface(null); } else if (surface == VideoCallFragment.SURFACE_PREVIEW) { mVideoCall.setPreviewSurface(null); + // Also disable camera as preview is closed + mVideoCall.setCamera(null); } } |