summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <ricardo@cyngn.com>2015-08-31 16:02:12 +0100
committerRicardo Cerqueira <ricardo@cyngn.com>2015-09-02 12:01:24 +0100
commit547e58943c941931561f44b9c2627fa13906e15d (patch)
treedba9d65e8fea4c5b7d176e32ecc58c7df2d16c25
parentc1f4123488dceae1daa725d48875588848e86b0e (diff)
downloadandroid_packages_apps_Trebuchet-547e58943c941931561f44b9c2627fa13906e15d.tar.gz
android_packages_apps_Trebuchet-547e58943c941931561f44b9c2627fa13906e15d.tar.bz2
android_packages_apps_Trebuchet-547e58943c941931561f44b9c2627fa13906e15d.zip
Support STK app rename on MSIM
Companion change to If64b278360a0b8433e23e6678f04cdf30fe2cef1 Change-Id: I36c74301c7813e6c118faed9fa5b31a36233db1e
-rw-r--r--src/com/android/launcher3/IconCache.java8
-rw-r--r--src/com/android/launcher3/LauncherApplication.java11
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