From 00623aa60a7908b0709df38632cfa576cb15e33e Mon Sep 17 00:00:00 2001 From: twyen Date: Tue, 10 Oct 2017 12:15:08 -0700 Subject: Implement SIM swapping When the call is still ringing, a new button is added to allow to user to call with the other SIM. A background worker will be created to hang up the phone and redial with the other SIM. The in call UI will be prevented from ending during the process. Video: https://drive.google.com/a/google.com/file/d/0B2eYBUUznfyTSl9MdXQ0V1ZzQkE/view?usp=sharing UX has not been finalized, the icon and position are just placeholder. Bug: 64215256 Test: SwapSimWorkerTest PiperOrigin-RevId: 171715715 Change-Id: Idb3f486e9fc9a45d4c5e244af2d7d91b075bf0f2 --- .../android/incallui/incall/impl/ButtonController.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'java/com/android/incallui/incall/impl/ButtonController.java') diff --git a/java/com/android/incallui/incall/impl/ButtonController.java b/java/com/android/incallui/incall/impl/ButtonController.java index b7a47f08e..cefbd723b 100644 --- a/java/com/android/incallui/incall/impl/ButtonController.java +++ b/java/com/android/incallui/incall/impl/ButtonController.java @@ -560,4 +560,21 @@ interface ButtonController { inCallScreenDelegate.onSecondaryInfoClicked(); } } + + class SwapSimButtonController extends SimpleNonCheckableButtonController { + + public SwapSimButtonController(InCallButtonUiDelegate delegate) { + super( + delegate, + InCallButtonIds.BUTTON_SWAP_SIM, + R.string.incall_content_description_swap_sim, + R.string.incall_label_swap_sim, + R.drawable.quantum_ic_swap_calls_white_36); + } + + @Override + public void onClick(View view) { + delegate.swapSimClicked(); + } + } } -- cgit v1.2.3