diff options
author | Johannes Carlsson <johannes.carlsson.x@sonyericsson.com> | 2011-10-25 10:37:24 +0200 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2014-05-01 15:42:37 +0000 |
commit | ef243a24eb9b919a6c315bffb53fcb557195489a (patch) | |
tree | be193168a5ba1ae4800d627077d99d6a93a18d7b /src | |
parent | 3848d4deb9c159b5ab9e7f629f92aa31276f53ec (diff) | |
download | Stk-ef243a24eb9b919a6c315bffb53fcb557195489a.tar.gz |
DISPLAY TEXT clr msg after delay, expects result code OK
Send RES_ID_TIMEOUT response if StkDialogActivity is sent to the
background due to another acitivty has replaced it as forground
activity. When a callback call interferes and closes the
StkDialogActivity, the session still needs to be ended. If the
session is not ended in a controlled way, STK will end up in a
wrong state. If STK is in wrong state it will be unable to
process subsequent callbacks.
The sendResponse call is now moved to onStop() since it showed
that the system will not call onDestroy() in some scenarios.
This happened while repeating the test for 20 or more times.
Change-Id: Ib6519ce15225b1c7be83251c6461fb14a4680200
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/stk/StkDialogActivity.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/stk/StkDialogActivity.java b/src/com/android/stk/StkDialogActivity.java index b15e8df..cf81f03 100644 --- a/src/com/android/stk/StkDialogActivity.java +++ b/src/com/android/stk/StkDialogActivity.java @@ -39,6 +39,7 @@ public class StkDialogActivity extends Activity implements View.OnClickListener // members TextMessage mTextMsg; + private boolean mIsResponseSent = false; Handler mTimeoutHandler = new Handler() { @Override public void handleMessage(Message msg) { @@ -155,6 +156,20 @@ public class StkDialogActivity extends Activity implements View.OnClickListener } @Override + protected void onStart() { + super.onStart(); + mIsResponseSent = false; + } + + @Override + public void onStop() { + super.onStop(); + if (!mIsResponseSent) { + sendResponse(StkAppService.RES_ID_TIMEOUT); + } + } + + @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); @@ -174,6 +189,7 @@ public class StkDialogActivity extends Activity implements View.OnClickListener args.putInt(StkAppService.RES_ID, resId); args.putBoolean(StkAppService.CONFIRMATION, confirmed); startService(new Intent(this, StkAppService.class).putExtras(args)); + mIsResponseSent = true; } private void sendResponse(int resId) { |