diff options
author | calderwoodra <calderwoodra@google.com> | 2017-09-20 16:30:41 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-09-22 15:58:42 +0000 |
commit | 1dc2ceac680da86d2be40f4ac9f5639bd1d113a3 (patch) | |
tree | b116e8052183984a79571b8f46a19893842dddc8 | |
parent | 13221d724c9f26b8ff94c38d0911bbdcabdcb169 (diff) |
Updated ongoing call notification to reflect video call state.
screenshots:
ongoing: http://screen/FkAM9hOU5Rq
paused: http://screen/mrp6UJCoWAu
Bug: 63274792,63271690
Test: StatusBarNotifierTest
PiperOrigin-RevId: 169469414
Change-Id: I442e21d93b7e11dea191311acd28846ea257c156
5 files changed, 30 insertions, 1 deletions
diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java index a2fa7e492..becfad4ab 100644 --- a/java/com/android/incallui/StatusBarNotifier.java +++ b/java/com/android/incallui/StatusBarNotifier.java @@ -678,7 +678,8 @@ public class StatusBarNotifier if (call.getState() == DialerCall.State.ONHOLD) { return R.drawable.ic_phone_paused_white_24dp; } else if (call.getVideoTech().getSessionModificationState() - == SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST) { + == SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST + || call.isVideoCall()) { return R.drawable.quantum_ic_videocam_white_24; } else if (call.hasProperty(PROPERTY_HIGH_DEF_AUDIO) && MotorolaUtils.shouldShowHdIconInNotification(mContext)) { @@ -730,6 +731,11 @@ public class StatusBarNotifier } } else if (call.getState() == DialerCall.State.ONHOLD) { resId = R.string.notification_on_hold; + } else if (call.isVideoCall()) { + resId = + call.getVideoTech().isPaused() + ? R.string.notification_ongoing_paused_video_call + : R.string.notification_ongoing_video_call; } else if (DialerCall.State.isDialing(call.getState())) { resId = R.string.notification_dialing; } else if (call.getVideoTech().getSessionModificationState() diff --git a/java/com/android/incallui/videotech/VideoTech.java b/java/com/android/incallui/videotech/VideoTech.java index e3753bc65..410c35762 100644 --- a/java/com/android/incallui/videotech/VideoTech.java +++ b/java/com/android/incallui/videotech/VideoTech.java @@ -39,6 +39,14 @@ public interface VideoTech { boolean shouldUseSurfaceView(); + /** + * Returns true if the video is paused. This is different than if the video stream has been turned + * off. + * + * <p>See {@link #isTransmitting()} + */ + boolean isPaused(); + VideoCallScreenDelegate createVideoCallScreenDelegate( Context context, VideoCallScreen videoCallScreen); diff --git a/java/com/android/incallui/videotech/empty/EmptyVideoTech.java b/java/com/android/incallui/videotech/empty/EmptyVideoTech.java index 76766dfe8..f156a14ad 100644 --- a/java/com/android/incallui/videotech/empty/EmptyVideoTech.java +++ b/java/com/android/incallui/videotech/empty/EmptyVideoTech.java @@ -49,6 +49,11 @@ public class EmptyVideoTech implements VideoTech { } @Override + public boolean isPaused() { + return false; + } + + @Override public VideoCallScreenDelegate createVideoCallScreenDelegate( Context context, VideoCallScreen videoCallScreen) { throw Assert.createUnsupportedOperationFailException(); diff --git a/java/com/android/incallui/videotech/ims/ImsVideoTech.java b/java/com/android/incallui/videotech/ims/ImsVideoTech.java index c12474dc3..0ef07d667 100644 --- a/java/com/android/incallui/videotech/ims/ImsVideoTech.java +++ b/java/com/android/incallui/videotech/ims/ImsVideoTech.java @@ -108,6 +108,11 @@ public class ImsVideoTech implements VideoTech { } @Override + public boolean isPaused() { + return paused; + } + + @Override public VideoCallScreenDelegate createVideoCallScreenDelegate( Context context, VideoCallScreen videoCallScreen) { // TODO move creating VideoCallPresenter here diff --git a/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java b/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java index 4b6f5ec5a..1ddf3716e 100644 --- a/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java +++ b/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java @@ -104,6 +104,11 @@ public class LightbringerTech implements VideoTech, LightbringerListener { } @Override + public boolean isPaused() { + return false; + } + + @Override public VideoCallScreenDelegate createVideoCallScreenDelegate( Context context, VideoCallScreen videoCallScreen) { throw Assert.createUnsupportedOperationFailException(); |