diff options
author | Evan Charlton <evanc@google.com> | 2014-05-14 10:25:57 -0700 |
---|---|---|
committer | Evan Charlton <evanc@google.com> | 2014-05-14 10:42:43 -0700 |
commit | 29d9d6b63209d273a109315b9e31a675151d4333 (patch) | |
tree | 96831dd882c0307bc0a3b4c3ed9abdbe7334e7f7 /InCallUI | |
parent | ff9f30dd166b7aae8e5cc5bbac57beeed6e2389c (diff) | |
parent | e14843e2ce456ffca91ae83d0ccff722ca222e5d (diff) |
resolved conflicts for merge of 36b5e5f9 to master
Change-Id: I66befab929f19a53e3466f55f78c99f9afda047e
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/res/drawable-hdpi/ic_in_call_video_handoff.png | bin | 0 -> 1857 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-hdpi/ic_in_call_wifi.png | bin | 0 -> 1789 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-mdpi/ic_in_call_video_handoff.png | bin | 0 -> 1508 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-mdpi/ic_in_call_wifi.png | bin | 0 -> 1487 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-xhdpi/ic_in_call_video_handoff.png | bin | 0 -> 2180 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-xhdpi/ic_in_call_wifi.png | bin | 0 -> 2283 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-xxhdpi/ic_in_call_video_handoff.png | bin | 0 -> 2244 bytes | |||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonFragment.java | 3 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonPresenter.java | 3 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardFragment.java | 15 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 19 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCommandClient.java | 25 |
12 files changed, 55 insertions, 10 deletions
diff --git a/InCallUI/res/drawable-hdpi/ic_in_call_video_handoff.png b/InCallUI/res/drawable-hdpi/ic_in_call_video_handoff.png Binary files differnew file mode 100644 index 000000000..fb76e3c69 --- /dev/null +++ b/InCallUI/res/drawable-hdpi/ic_in_call_video_handoff.png diff --git a/InCallUI/res/drawable-hdpi/ic_in_call_wifi.png b/InCallUI/res/drawable-hdpi/ic_in_call_wifi.png Binary files differnew file mode 100644 index 000000000..93e086dab --- /dev/null +++ b/InCallUI/res/drawable-hdpi/ic_in_call_wifi.png diff --git a/InCallUI/res/drawable-mdpi/ic_in_call_video_handoff.png b/InCallUI/res/drawable-mdpi/ic_in_call_video_handoff.png Binary files differnew file mode 100644 index 000000000..8b1ff4e02 --- /dev/null +++ b/InCallUI/res/drawable-mdpi/ic_in_call_video_handoff.png diff --git a/InCallUI/res/drawable-mdpi/ic_in_call_wifi.png b/InCallUI/res/drawable-mdpi/ic_in_call_wifi.png Binary files differnew file mode 100644 index 000000000..339d4ed27 --- /dev/null +++ b/InCallUI/res/drawable-mdpi/ic_in_call_wifi.png diff --git a/InCallUI/res/drawable-xhdpi/ic_in_call_video_handoff.png b/InCallUI/res/drawable-xhdpi/ic_in_call_video_handoff.png Binary files differnew file mode 100644 index 000000000..38d6220b1 --- /dev/null +++ b/InCallUI/res/drawable-xhdpi/ic_in_call_video_handoff.png diff --git a/InCallUI/res/drawable-xhdpi/ic_in_call_wifi.png b/InCallUI/res/drawable-xhdpi/ic_in_call_wifi.png Binary files differnew file mode 100644 index 000000000..692726fbe --- /dev/null +++ b/InCallUI/res/drawable-xhdpi/ic_in_call_wifi.png diff --git a/InCallUI/res/drawable-xxhdpi/ic_in_call_video_handoff.png b/InCallUI/res/drawable-xxhdpi/ic_in_call_video_handoff.png Binary files differnew file mode 100644 index 000000000..4cbdbbb57 --- /dev/null +++ b/InCallUI/res/drawable-xxhdpi/ic_in_call_video_handoff.png diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index d9fc68de3..38e8f5eab 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -183,6 +183,9 @@ public class CallButtonFragment case R.id.auxiliaryActionButton: getPresenter().auxiliaryActionButtonClicked(); break; + case R.id.videoHandoffButton: + getPresenter().videoHandoffClicked(); + break; default: Log.wtf(this, "onClick: unexpected"); break; diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index dc5eda1c3..6cf05d099 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -257,12 +257,12 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto Log.v(this, "Show swap ", call.can(Capabilities.SWAP_CALLS)); Log.v(this, "Show add call ", call.can(Capabilities.ADD_CALL)); Log.v(this, "Show mute ", call.can(Capabilities.MUTE)); + Log.v(this, "Show video handoff ", call.can(Capabilities.VIDEO_HANDOFF)); final boolean canMerge = call.can(Capabilities.MERGE_CALLS); final boolean canAdd = call.can(Capabilities.ADD_CALL); final boolean isGenericConference = call.can(Capabilities.GENERIC_CONFERENCE); - final boolean showMerge = !isGenericConference && canMerge; if (showMerge) { @@ -309,6 +309,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto } ui.enableMute(call.can(Capabilities.MUTE)); + ui.showVideoHandoff(call.can(Capabilities.VIDEO_HANDOFF)); // Finally, update the "extra button row": It's displayed above the // "End" button, but only if necessary. Also, it's never displayed diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 9f14e265d..bc4fb1196 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -28,6 +28,7 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewStub; import android.view.accessibility.AccessibilityEvent; +import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; @@ -50,6 +51,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr private TextView mCallTypeLabel; private ImageView mPhoto; private TextView mElapsedTime; + private Button mConnectionHandoffButton; // Secondary caller info private ViewStub mSecondaryCallInfo; @@ -118,6 +120,14 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } }); ViewUtil.setupFloatingActionButton(mEndCallButton, getResources()); + + mConnectionHandoffButton = (Button) view.findViewById(R.id.connectionHandoffButton); + mConnectionHandoffButton.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + getPresenter().connectionHandoffClicked(); + } + }); } @Override @@ -177,6 +187,11 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } @Override + public void setShowConnectionHandoff(boolean showConnectionHandoff) { + mConnectionHandoffButton.setVisibility(showConnectionHandoff ? View.VISIBLE : View.GONE); + } + + @Override public void setPrimary(String number, String name, boolean nameIsNumber, String label, Drawable photo, boolean isConference, boolean isGeneric, boolean isSipCall) { Log.d(this, "Setting primary call"); diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 25520e4ea..e8c88c7bf 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -194,12 +194,14 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> ui.setCallState(mPrimary.getState(), mPrimary.getDisconnectCause(), bluetoothOn, getGatewayLabel(), getGatewayNumber(), getWifiConnection()); } else { - ui.setCallState(Call.State.IDLE, DisconnectCause.NOT_VALID, false, null, null); + ui.setCallState(Call.State.IDLE, DisconnectCause.NOT_VALID, false, null, null, null); } final boolean enableEndCallButton = state.isConnectingOrConnected() && !state.isIncoming() && mPrimary != null; ui.setEndCallButtonEnabled(enableEndCallButton); + ui.setShowConnectionHandoff(mPrimary != null && mPrimary.can( + Capabilities.CONNECTION_HANDOFF)); } @Override @@ -213,14 +215,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } private String getWifiConnection() { - if (mPrimary.isWifiCall()) { - final WifiManager wifiManager = (WifiManager) mContext.getSystemService( - Context.WIFI_SERVICE); - final WifiInfo info = wifiManager.getConnectionInfo(); - if (info != null) { - return info.getSSID(); - } - } return null; } @@ -482,6 +476,12 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> CallCommandClient.getInstance().disconnectCall(mPrimary.getCallId()); } + public void connectionHandoffClicked() { + if (mPrimary != null) { + CallCommandClient.getInstance().connectionHandoff(mPrimary.getCallId()); + } + } + public interface CallCardUi extends Ui { void setVisible(boolean on); void setPrimary(String number, String name, boolean nameIsNumber, String label, @@ -497,5 +497,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> void setPrimaryPhoneNumber(String phoneNumber); void setPrimaryLabel(String label); void setEndCallButtonEnabled(boolean enabled); + void setShowConnectionHandoff(boolean showConnectionHandoff); } } diff --git a/InCallUI/src/com/android/incallui/CallCommandClient.java b/InCallUI/src/com/android/incallui/CallCommandClient.java index 52d2100c8..234c518de 100644 --- a/InCallUI/src/com/android/incallui/CallCommandClient.java +++ b/InCallUI/src/com/android/incallui/CallCommandClient.java @@ -243,4 +243,29 @@ public class CallCommandClient { } } + public void videoHandoff(int callId) { + Log.i(this, "video handoff"); + if (mCommandService == null) { + Log.e(this, "Cannot perform video handoff; CallCommandService == null"); + return; + } + try { + mCommandService.videoHandoff(callId); + } catch (RemoteException e) { + Log.e(this, "Error performing video handoff.", e); + } + } + + public void connectionHandoff(int callId) { + Log.i(this, "connection handoff"); + if (mCommandService == null) { + Log.e(this, "Cannot perform connection handoff; CallCommandService == null"); + return; + } + try { + mCommandService.connectionHandoff(callId); + } catch (RemoteException e) { + Log.e(this, "Error performing connection handoff.", e); + } + } } |