diff options
author | Legler Wu <legler.wu@mediatek.com> | 2014-10-27 00:57:18 +0800 |
---|---|---|
committer | Amit Mahajan <amitmahajan@google.com> | 2014-12-17 01:11:13 +0000 |
commit | aeefef5980a88d0dff10f4c81300789dca4aa1a5 (patch) | |
tree | a8d6fffe2287ea3e59eff42fce729a22492f1805 /src/com/android/stk/StkLauncherActivity.java | |
parent | b2eec4f28ef152df475169ce11641d0775cc61a6 (diff) | |
download | Stk-aeefef5980a88d0dff10f4c81300789dca4aa1a5.tar.gz |
Stk App bug fix and code refine.
Major changes:
1. StkAppService.java :
line272~279: use getInstance(slotId)@CatService to get instance of cat service instead.
line303~307: remove redundant codes
line457~485: remove redundant codes
line693~695: fix the NPE if the first proactive command is not SET_UP_MENU.
line1109~1116: remove redundant codes.
2. StkMain.java (new file, is the launcher of Stk without UI(No_Display theme) :
To fix a short flash problem when entering Stk app for one SIM inserted case.
If inserted one SIM, it starts StkMenuActivity for showing main menu of the SIM.
If inserted two SIMs, it starts StkLauncherActivity which shows a list for inserted SIMs.
Bug: 18705342
Change-Id: If777f1cc0a16df38d1b534cd60ed7850b6072b22
Diffstat (limited to 'src/com/android/stk/StkLauncherActivity.java')
-rw-r--r--[-rwxr-xr-x] | src/com/android/stk/StkLauncherActivity.java | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/src/com/android/stk/StkLauncherActivity.java b/src/com/android/stk/StkLauncherActivity.java index 9066c3e..73529e9 100755..100644 --- a/src/com/android/stk/StkLauncherActivity.java +++ b/src/com/android/stk/StkLauncherActivity.java @@ -62,21 +62,13 @@ public class StkLauncherActivity extends ListActivity { mContext = getBaseContext(); mTm = (TelephonyManager) mContext.getSystemService( Context.TELEPHONY_SERVICE); - //Check if needs to show the menu list. - if (isShowSTKListMenu()) { - requestWindowFeature(Window.FEATURE_NO_TITLE); - setContentView(R.layout.stk_menu_list); - mTitleTextView = (TextView) findViewById(R.id.title_text); - mTitleIconView = (ImageView) findViewById(R.id.title_icon); - mTitleTextView.setText(R.string.app_name); - mBitMap = BitmapFactory.decodeResource(getResources(), - R.drawable.ic_launcher_sim_toolkit); - } else { - //launch stk menu activity for the SIM. - if (mSingleSimId < 0) { - finish(); - } - } + requestWindowFeature(Window.FEATURE_NO_TITLE); + setContentView(R.layout.stk_menu_list); + mTitleTextView = (TextView) findViewById(R.id.title_text); + mTitleIconView = (ImageView) findViewById(R.id.title_icon); + mTitleTextView.setText(R.string.app_name); + mBitMap = BitmapFactory.decodeResource(getResources(), + R.drawable.ic_launcher_sim_toolkit); } @Override @@ -201,30 +193,6 @@ public class StkLauncherActivity extends ListActivity { return 0; } } - private boolean isShowSTKListMenu() { - int simCount = TelephonyManager.from(mContext).getSimCount(); - int simInsertedCount = 0; - int insertedSlotId = -1; - - CatLog.d(LOG_TAG, "simCount: " + simCount); - for (int i = 0; i < simCount; i++) { - //Check if the card is inserted. - if (mTm.hasIccCard(i)) { - CatLog.d(LOG_TAG, "SIM " + i + " is inserted."); - mSingleSimId = i; - simInsertedCount++; - } else { - CatLog.d(LOG_TAG, "SIM " + i + " is not inserted."); - } - } - if (simInsertedCount > 1) { - return true; - } else { - //No card or only one card. - CatLog.d(LOG_TAG, "do not show stk list menu."); - return false; - } - } private void launchSTKMainMenu(int slodId) { Bundle args = new Bundle(); CatLog.d(LOG_TAG, "launchSTKMainMenu."); |