Show the menu title instead of the application name if it is available
Show the menu title on the launcher activity if it is provided by
SET-UP MENU command. This change improves the usability of MSIM
products as requested by operators.
Bug: 29030384
Change-Id: Ida2de5204df4575ecab95cc5533c66785e6e597c
diff --git a/src/com/android/stk/StkLauncherActivity.java b/src/com/android/stk/StkLauncherActivity.java
index 73529e9..6c5b88c 100644
--- a/src/com/android/stk/StkLauncherActivity.java
+++ b/src/com/android/stk/StkLauncherActivity.java
@@ -161,6 +161,8 @@
private int addStkMenuListItems() {
String appName = mContext.getResources().getString(R.string.app_name);
+ StkAppService appService = StkAppService.getInstance();
+ String stkMenuTitle = null;
String stkItemName = null;
int simCount = TelephonyManager.from(mContext).getSimCount();
mStkMenuList = new ArrayList<Item>();
@@ -171,8 +173,9 @@
if (mTm.hasIccCard(i)) {
CatLog.d(LOG_TAG, "SIM " + i + " add to menu.");
mSingleSimId = i;
- stkItemName = new StringBuilder(appName).append(" ")
- .append(Integer.toString(i + 1)).toString();
+ stkMenuTitle = appService.getMainMenu(i).title;
+ stkItemName = new StringBuilder(stkMenuTitle == null ? appName : stkMenuTitle)
+ .append(" ").append(Integer.toString(i + 1)).toString();
Item item = new Item(i + 1, stkItemName, mBitMap);
item.id = i;
mStkMenuList.add(item);