diff options
author | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-08-31 16:02:12 +0100 |
---|---|---|
committer | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-09-02 12:03:18 +0100 |
commit | 312f7361e72b39e79f3745d2a9d22cd82bbf444c (patch) | |
tree | afbc26ef05d9ca40f1074c4e70e092c07c251df3 | |
parent | 983850727da542115c1a549c4657683288a892d7 (diff) | |
download | android_packages_apps_Trebuchet-312f7361e72b39e79f3745d2a9d22cd82bbf444c.tar.gz android_packages_apps_Trebuchet-312f7361e72b39e79f3745d2a9d22cd82bbf444c.tar.bz2 android_packages_apps_Trebuchet-312f7361e72b39e79f3745d2a9d22cd82bbf444c.zip |
Support STK app rename on MSIM
Companion change to If64b278360a0b8433e23e6678f04cdf30fe2cef1
Change-Id: I36c74301c7813e6c118faed9fa5b31a36233db1e
Ref: CYNGNOS-850
-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 |