summaryrefslogtreecommitdiffstats
path: root/src/com/android/stk/StkDialogActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/stk/StkDialogActivity.java')
-rw-r--r--src/com/android/stk/StkDialogActivity.java31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/com/android/stk/StkDialogActivity.java b/src/com/android/stk/StkDialogActivity.java
index 1462480..43eb928 100644
--- a/src/com/android/stk/StkDialogActivity.java
+++ b/src/com/android/stk/StkDialogActivity.java
@@ -48,8 +48,6 @@ public class StkDialogActivity extends Activity {
private StkAppService appService = StkAppService.getInstance();
// Determines whether Terminal Response (TR) has been sent
private boolean mIsResponseSent = false;
- // Determines whether this is in the pending state.
- private boolean mIsPending = false;
// Utilize AlarmManager for real-time countdown
private static final String DIALOG_ALARM_TAG = LOG_TAG;
private static final long NO_DIALOG_ALARM = -1;
@@ -60,7 +58,6 @@ public class StkDialogActivity extends Activity {
private static final String ALARM_TIME_KEY = "alarm_time";
private static final String RESPONSE_SENT_KEY = "response_sent";
private static final String SLOT_ID_KEY = "slotid";
- private static final String PENDING = "pending";
private AlertDialog mAlertDialog;
@@ -124,6 +121,8 @@ public class StkDialogActivity extends Activity {
// command with an immediate response object should disappear when the terminal receives
// a subsequent proactive command containing display data.
appService.getStkContext(mSlotId).setImmediateDialogInstance(this);
+ } else {
+ appService.getStkContext(mSlotId).setPendingDialogInstance(this);
}
alertDialogBuilder.setTitle(mTextMsg.title);
@@ -158,9 +157,6 @@ public class StkDialogActivity extends Activity {
super.onResume();
CatLog.d(LOG_TAG, "onResume - mIsResponseSent[" + mIsResponseSent +
"], sim id: " + mSlotId);
- // The pending dialog is unregistered if this instance was registered as it before.
- setPendingState(false);
-
/*
* If the userClear flag is set and dialogduration is set to 0, the display Text
* should be displayed to user forever until some high priority event occurs
@@ -215,14 +211,6 @@ public class StkDialogActivity extends Activity {
super.onStop();
CatLog.d(LOG_TAG, "onStop - before Send CONFIRM false mIsResponseSent[" +
mIsResponseSent + "], sim id: " + mSlotId);
-
- // Nothing should be done here if this activity is being finished or restarted now.
- if (isFinishing() || isChangingConfigurations()) {
- return;
- }
-
- // This is registered as the pending dialog as this was sent to the background.
- setPendingState(true);
}
@Override
@@ -260,7 +248,6 @@ public class StkDialogActivity extends Activity {
outState.putBoolean(RESPONSE_SENT_KEY, mIsResponseSent);
outState.putLong(ALARM_TIME_KEY, mAlarmTime);
outState.putInt(SLOT_ID_KEY, mSlotId);
- outState.putBoolean(PENDING, mIsPending);
}
@Override
@@ -274,11 +261,6 @@ public class StkDialogActivity extends Activity {
mAlarmTime = savedInstanceState.getLong(ALARM_TIME_KEY, NO_DIALOG_ALARM);
mSlotId = savedInstanceState.getInt(SLOT_ID_KEY);
- // The pending dialog must be replaced if the previous instance was in the pending state.
- if (savedInstanceState.getBoolean(PENDING)) {
- setPendingState(true);
- }
-
if (mAlarmTime != NO_DIALOG_ALARM) {
startTimeOut();
}
@@ -303,15 +285,6 @@ public class StkDialogActivity extends Activity {
}
}
- private void setPendingState(boolean on) {
- if (mTextMsg.responseNeeded) {
- if (mIsPending != on) {
- appService.getStkContext(mSlotId).setPendingDialogInstance(on ? this : null);
- mIsPending = on;
- }
- }
- }
-
private void sendResponse(int resId, boolean confirmed) {
cancelTimeOut();