diff options
author | Pranav Vashi <neobuddy89@gmail.com> | 2021-02-07 02:08:38 +0530 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2021-09-27 21:17:05 +0800 |
commit | d7e6289605bff749a419e28092574e815353f1fb (patch) | |
tree | c703cba97fc7ce8ae578bb61d4fae8253e89d0a2 | |
parent | 32d65de541206356628cea999482b0f509178bfe (diff) |
[crdroid][11.0] AlertSlider: Prevent crash in case of incomplete broadcast
* In intent extra EXTRA_SLIDER_POSITION_VALUE is not received and slider is changed,
SystemUI will crash "No resource found". This patch should prevent such ice-cold havoc.
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: Ifc21327f785959db2e7cb0d03e07c0b061dfd569
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/tristate/TriStateUiControllerImpl.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/tristate/TriStateUiControllerImpl.java b/packages/SystemUI/src/com/android/systemui/tristate/TriStateUiControllerImpl.java index 9419b673fc6e..bd885da30731 100644 --- a/packages/SystemUI/src/com/android/systemui/tristate/TriStateUiControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/tristate/TriStateUiControllerImpl.java @@ -369,10 +369,10 @@ public class TriStateUiControllerImpl implements ConfigurationListener, TriState break; } if (mTriStateMode != -1) { - if (mTriStateIcon != null) { + if (mTriStateIcon != null && iconId != 0) { mTriStateIcon.setImageResource(iconId); } - if (mTriStateText != null) { + if (mTriStateText != null && textId != 0) { String inputText = res.getString(textId); if (inputText != null && mTriStateText.length() == inputText.length()) { StringBuilder sb = new StringBuilder(); @@ -382,7 +382,7 @@ public class TriStateUiControllerImpl implements ConfigurationListener, TriState } mTriStateText.setText(inputText); } - if (mDialogView != null) { + if (mDialogView != null && bg != 0) { mDialogView.setBackgroundDrawable(res.getDrawable(bg)); } mDialogPosition = positionY2; |