diff options
author | Jordan Liu <jminjie@google.com> | 2017-12-11 20:52:49 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-12-11 20:52:49 +0000 |
commit | 0a4f6135ea3993e4afe91ed47ac00bed5ce8a79b (patch) | |
tree | 96160a77e008eae95c6ac4eca2093ecf7139e686 | |
parent | 9719f84b0de32bde4c7ff02fe3bb3596cab7aad0 (diff) | |
parent | 056ae69a55a62e7725ffd801dd475c42aeb3407a (diff) | |
download | Stk-0a4f6135ea3993e4afe91ed47ac00bed5ce8a79b.tar.gz |
Merge "The main menu shall not be launched when the current session ends"
am: 056ae69a55
Change-Id: Ifeefba56ea1068ad0186c34aaa439ebc35563a77
-rw-r--r-- | src/com/android/stk/StkAppService.java | 39 | ||||
-rw-r--r-- | src/com/android/stk/StkMenuActivity.java | 15 |
2 files changed, 5 insertions, 49 deletions
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java index daccad2..dc551a6 100644 --- a/src/com/android/stk/StkAppService.java +++ b/src/com/android/stk/StkAppService.java @@ -119,7 +119,6 @@ public class StkAppService extends Service implements Runnable { protected int mOpCode = -1; private Activity mActivityInstance = null; private Activity mDialogInstance = null; - private Activity mMainActivityInstance = null; private int mSlotId = 0; private SetupEventListSettings mSetupEventListSettings = null; private boolean mClearSelectItem = false; @@ -145,15 +144,6 @@ public class StkAppService extends Service implements Runnable { mDialogInstance); return mDialogInstance; } - final synchronized void setMainActivityInstance(Activity act) { - CatLog.d(this, "setMainActivityInstance act : " + mSlotId + ", " + act); - callSetActivityInstMsg(OP_SET_MAINACT_INST, mSlotId, act); - } - final synchronized Activity getMainActivityInstance() { - CatLog.d(this, "getMainActivityInstance act : " + mSlotId + ", " + - mMainActivityInstance); - return mMainActivityInstance; - } } private volatile Looper mServiceLooper; @@ -207,10 +197,9 @@ public class StkAppService extends Service implements Runnable { static final int OP_CARD_STATUS_CHANGED = 7; static final int OP_SET_ACT_INST = 8; static final int OP_SET_DAL_INST = 9; - static final int OP_SET_MAINACT_INST = 10; - static final int OP_LOCALE_CHANGED = 11; - static final int OP_ALPHA_NOTIFY = 12; - static final int OP_IDLE_SCREEN = 13; + static final int OP_LOCALE_CHANGED = 10; + static final int OP_ALPHA_NOTIFY = 11; + static final int OP_IDLE_SCREEN = 12; //Invalid SetupEvent static final int INVALID_SETUP_EVENT = 0xFF; @@ -628,12 +617,6 @@ public class StkAppService extends Service implements Runnable { dal = (Activity) msg.obj; mStkContext[slotId].mDialogInstance = dal; break; - case OP_SET_MAINACT_INST: - Activity mainAct = new Activity(); - mainAct = (Activity) msg.obj; - CatLog.d(LOG_TAG, "Set activity instance. " + mainAct); - mStkContext[slotId].mMainActivityInstance = mainAct; - break; case OP_LOCALE_CHANGED: CatLog.d(this, "Locale Changed"); for (int slot = PhoneConstants.SIM_ID_1; slot < mSimCount; slot++) { @@ -860,12 +843,9 @@ public class StkAppService extends Service implements Runnable { mStkContext[slotId].mCurrentMenu = mStkContext[slotId].mMainCmd.getMenu(); } CatLog.d(LOG_TAG, "[handleSessionEnd][mMenuState]" + mStkContext[slotId].mMenuIsVisible); - // In mutiple instance architecture, the main menu for slotId will be finished when user - // goes to the Stk menu of the other SIM. So, we should launch a new instance for the - // main menu if the main menu instance has been finished. - // If the current menu is secondary menu, we should launch main menu. + if (StkMenuActivity.STATE_SECONDARY == mStkContext[slotId].mMenuState) { - launchMenuActivity(null, slotId); + mStkContext[slotId].mMenuState = StkMenuActivity.STATE_MAIN; } // Send a local broadcast as a notice that this service handled the session end event. @@ -1385,15 +1365,6 @@ public class StkAppService extends Service implements Runnable { if (menu == null) { // We assume this was initiated by the user pressing the tool kit icon intentFlags |= getFlagActivityNoUserAction(InitiatedByUserAction.yes, slotId); - if (mStkContext[slotId].mOpCode == OP_END_SESSION) { - CatLog.d(LOG_TAG, "launchMenuActivity, return OP_END_SESSION"); - mStkContext[slotId].mMenuState = StkMenuActivity.STATE_MAIN; - if (mStkContext[slotId].mMainActivityInstance != null) { - CatLog.d(LOG_TAG, "launchMenuActivity, mMainActivityInstance is not null"); - return; - } - } - //If the last pending menu is secondary menu, "STATE" should be "STATE_SECONDARY". //Otherwise, it should be "STATE_MAIN". if (mStkContext[slotId].mOpCode == OP_LAUNCH_APP && diff --git a/src/com/android/stk/StkMenuActivity.java b/src/com/android/stk/StkMenuActivity.java index 8dab6fd..9f268d1 100644 --- a/src/com/android/stk/StkMenuActivity.java +++ b/src/com/android/stk/StkMenuActivity.java @@ -178,7 +178,6 @@ public class StkMenuActivity extends ListActivity implements View.OnCreateContex return true; case STATE_MAIN: CatLog.d(LOG_TAG, "STATE_MAIN"); - appService.getStkContext(mSlotId).setMainActivityInstance(null); cancelTimeOut(); finish(); return true; @@ -211,12 +210,6 @@ public class StkMenuActivity extends ListActivity implements View.OnCreateContex finish(); return; } - //Set main menu instance here for clean up stack by other SIMs - //when receiving OP_LAUNCH_APP. - if (mState == STATE_MAIN) { - CatLog.d(LOG_TAG, "set main menu instance."); - appService.getStkContext(mSlotId).setMainActivityInstance(this); - } displayMenu(); startTimeOut(); invalidateOptionsMenu(); @@ -290,14 +283,6 @@ public class StkMenuActivity extends ListActivity implements View.OnCreateContex CatLog.d(LOG_TAG, "handleDestroy - Send End Session"); sendResponse(StkAppService.RES_ID_END_SESSION); } - if (mState == STATE_MAIN) { - if (appService != null) { - appService.getStkContext(mSlotId).setMainActivityInstance(null); - } else { - CatLog.d(LOG_TAG, "onDestroy: null appService."); - } - } - LocalBroadcastManager.getInstance(this).unregisterReceiver(mLocalBroadcastReceiver); } |