Fixed crash with decline with SMS.
If a user declined a call with SMS while the answer fragment wasn't attached,
they would get a crash. This change checks to see if the fragment has been
attached or detached before attempting to show the menu. This crash was added
by cl/154094855 which fixed another issue that had been around since v6.
Bug: 64380468
Test: none
PiperOrigin-RevId: 164670788
Change-Id: I37f9c28ab0bb24da630f7f7897ecff55ae859837
diff --git a/java/com/android/incallui/answer/impl/AnswerFragment.java b/java/com/android/incallui/answer/impl/AnswerFragment.java
index b5dd117..db6d43d 100644
--- a/java/com/android/incallui/answer/impl/AnswerFragment.java
+++ b/java/com/android/incallui/answer/impl/AnswerFragment.java
@@ -954,7 +954,7 @@
private void showMessageMenu() {
LogUtil.i("AnswerFragment.showMessageMenu", "Show sms menu.");
- if (getChildFragmentManager().isDestroyed()) {
+ if (getContext() == null || isDetached() || getChildFragmentManager().isDestroyed()) {
return;
}