diff options
author | Wei Huang <wei.x.huang@sonymobile.com> | 2015-12-28 17:19:54 +0100 |
---|---|---|
committer | Zoran Jovanovic <zoran.jovanovic@sonymobile.com> | 2016-01-11 21:16:45 +0100 |
commit | 05beb3075be8dfad6fa4de6bf92b5b96d7a1fa98 (patch) | |
tree | 89ffd50433bb9b85be9ec71ec9b7f889ecba0e39 | |
parent | 3494fc290d8e1c9358e22cac58bba9b3f91274fb (diff) |
Fix InCallUI crash when post char dialog is shown
When user makes MO video call with post char, such as ";", post char
dialog is shown when call is established.
At this time if user rotate InCallUI screen, InCallUI will crash
because PostCharDialogFragment has no zero argument constructor.
Add zero argument constructor for PostCharDialogFragment, and save the
needed parameter to Bundle.
Change-Id: I3587ad2bc47d4397b78b32d1ec27b8c914e9fb2f
-rw-r--r-- | InCallUI/src/com/android/incallui/PostCharDialogFragment.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/PostCharDialogFragment.java b/InCallUI/src/com/android/incallui/PostCharDialogFragment.java index 09b626a92..400e8d762 100644 --- a/InCallUI/src/com/android/incallui/PostCharDialogFragment.java +++ b/InCallUI/src/com/android/incallui/PostCharDialogFragment.java @@ -29,9 +29,15 @@ import android.view.WindowManager; */ public class PostCharDialogFragment extends DialogFragment { + private static final String STATE_CALL_ID = "CALL_ID"; + private static final String STATE_POST_CHARS = "POST_CHARS"; + private String mCallId; private String mPostDialStr; + public PostCharDialogFragment() { + } + public PostCharDialogFragment(String callId, String postDialStr) { mCallId = callId; mPostDialStr = postDialStr; @@ -41,6 +47,11 @@ public class PostCharDialogFragment extends DialogFragment { public Dialog onCreateDialog(Bundle savedInstanceState) { super.onCreateDialog(savedInstanceState); + if (mPostDialStr == null && savedInstanceState != null) { + mCallId = savedInstanceState.getString(STATE_CALL_ID); + mPostDialStr = savedInstanceState.getString(STATE_POST_CHARS); + } + final StringBuilder buf = new StringBuilder(); buf.append(getResources().getText(R.string.wait_prompt_str)); buf.append(mPostDialStr); @@ -71,4 +82,12 @@ public class PostCharDialogFragment extends DialogFragment { TelecomAdapter.getInstance().postDialContinue(mCallId, false); } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + + outState.putString(STATE_CALL_ID, mCallId); + outState.putString(STATE_POST_CHARS, mPostDialStr); + } } |