diff options
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 8 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherApplication.java | 11 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index 417314e78..de53b9718 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -336,10 +336,12 @@ public class IconCache { getBoolean(R.bool.config_launcher_stkAppRename)) && info.getComponentName().getPackageName().toString() .equalsIgnoreCase(STK_PACKAGE_NAME); + String activity = info.getComponentName().getClassName().toString(); + boolean isCustomTitle = false; if (condition && !TextUtils.isEmpty(((LauncherApplication) mContext) - .getStkAppName())) { + .getStkAppName(activity))) { isCustomTitle = true; } if (entry == null || unreadNum >= 0) { @@ -352,14 +354,14 @@ public class IconCache { if (labelCache != null && labelCache.containsKey(labelKey)) { if (isCustomTitle) { entry.title = ((LauncherApplication) mContext) - .getStkAppName(); + .getStkAppName(activity); } else { entry.title = labelCache.get(labelKey).toString(); } } else { if (isCustomTitle) { entry.title = ((LauncherApplication) mContext) - .getStkAppName(); + .getStkAppName(activity); } else { entry.title = info.getLabel().toString(); } diff --git a/src/com/android/launcher3/LauncherApplication.java b/src/com/android/launcher3/LauncherApplication.java index d5a4f2891..eab9861bd 100644 --- a/src/com/android/launcher3/LauncherApplication.java +++ b/src/com/android/launcher3/LauncherApplication.java @@ -22,6 +22,9 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import java.util.HashMap; +import java.util.Map; + import com.android.launcher3.stats.LauncherStats; import com.android.launcher3.stats.internal.service.AggregationIntentService; @@ -32,9 +35,11 @@ public class LauncherApplication extends Application { public static String PACKAGE_NAME = ""; private String mStkAppName = new String(); + Map<String,String> mStkMsimNames = new HashMap<String, String>(); private final String STK_PACKAGE_INTENT_ACTION_NAME = "org.codeaurora.carrier.ACTION_TELEPHONY_SEND_STK_TITLE"; private final String STK_APP_NAME = "StkTitle"; + private final String STK_ACTIVITY_NAME = "StkActivity"; private static LauncherStats sLauncherStats = null; @@ -77,11 +82,13 @@ public class LauncherApplication extends Application { @Override public void onReceive(Context context, Intent intent) { mStkAppName = intent.getStringExtra(STK_APP_NAME); + if (intent.getStringExtra(STK_ACTIVITY_NAME) != null) + mStkMsimNames.put(intent.getStringExtra(STK_ACTIVITY_NAME),mStkAppName); } }; - public String getStkAppName(){ - return mStkAppName; + public String getStkAppName(String activityName){ + return mStkMsimNames.get(activityName) != null ? mStkMsimNames.get(activityName) : mStkAppName; } @Override |