diff options
author | wangqi <wangqi@google.com> | 2018-06-11 12:45:26 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-11 14:33:18 -0700 |
commit | d637192b1956fb61a09e6ae92069a6b52d8394da (patch) | |
tree | 20154097db44ad23fea3afeebee021b5aeb252e4 /java | |
parent | 5ab679c561bb1a769cd9df3804011a95d5950910 (diff) |
Fix NPE issue when tapping speaker button on VT call ended screen
Null pointer exception occurred when tapping speaker button on
VT call ended screen. At the ending of VT call, the call is NULL and
issue caused by accessing the call.
To resolve this issue, disable speaker button on VT call ended screen
by updating button UI when button controller is disabled.
Bug: 109765937
Test: manual - Check that speaker button is disabled on the
VT call ended screen.
This is an upstream change:
https://android-review.googlesource.com/c/platform/packages/apps/Dialer/+/699606/
Bug: 109765937
Test: manual
PiperOrigin-RevId: 200096438
Change-Id: Ibecda05fe93edd0a5bbd3bcc29107fc51d3ae2cc
Diffstat (limited to 'java')
-rw-r--r-- | java/com/android/incallui/video/impl/SpeakerButtonController.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/com/android/incallui/video/impl/SpeakerButtonController.java b/java/com/android/incallui/video/impl/SpeakerButtonController.java index e17cf7b9f..4ae746b3c 100644 --- a/java/com/android/incallui/video/impl/SpeakerButtonController.java +++ b/java/com/android/incallui/video/impl/SpeakerButtonController.java @@ -43,7 +43,7 @@ public class SpeakerButtonController implements OnCheckedChangeListener, OnClick private boolean isEnabled; private CharSequence contentDescription; - public SpeakerButtonController( + SpeakerButtonController( @NonNull CheckableImageButton button, @NonNull InCallButtonUiDelegate inCallButtonUiDelegate, @NonNull VideoCallScreenDelegate videoCallScreenDelegate) { @@ -54,9 +54,10 @@ public class SpeakerButtonController implements OnCheckedChangeListener, OnClick public void setEnabled(boolean isEnabled) { this.isEnabled = isEnabled; + updateButtonState(); } - public void updateButtonState() { + void updateButtonState() { button.setVisibility(View.VISIBLE); button.setEnabled(isEnabled); button.setChecked(isChecked); |