diff options
author | Tyler Gunn <tgunn@google.com> | 2016-01-13 18:44:55 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-01-13 18:44:55 +0000 |
commit | 7eae0b1c73eb3a942e923e9407e1e754dcb563a4 (patch) | |
tree | a4b949df4a83b279260368ff6e37ac4ced48e004 | |
parent | 9608876ac96beea111a610989bca6c178103b832 (diff) | |
parent | 8c0482de6030f3ac36de2cc9a633104d4e1fe7db (diff) |
Merge "Fix InCallUI crash when post char dialog is shown" am: 86a8382274
am: ede2f7e1f7
* commit 'ede2f7e1f790a97db95f6d34f54e2839005b88ef':
Fix InCallUI crash when post char dialog is shown
-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); + } } |