summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-11-18 08:37:57 -0700
committerLinux Build Service Account <lnxbuild@localhost>2016-11-18 08:37:57 -0700
commite129ad665ac9743846b4a186cc705610789505ac (patch)
tree8d25f78e01711613f4066dc4a83fffe1c6eaeb6e
parentaff944dfed0e5d64043d5304a41d751e34ba802a (diff)
parent999766f7052b2b7bae82d6d90def4c6a7b640ba9 (diff)
downloadandroid_packages_apps_Stk-e129ad665ac9743846b4a186cc705610789505ac.tar.gz
android_packages_apps_Stk-e129ad665ac9743846b4a186cc705610789505ac.tar.bz2
android_packages_apps_Stk-e129ad665ac9743846b4a186cc705610789505ac.zip
Promotion of atel.lnx.2.0.c1-00005.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 1076380 If2073780f931bf1e797184af07958ca4702a2ed3 Stk: Operator specific sim icon customisation. Change-Id: Iec4c4bad83ec4b62360cb762ab3272c50e61bd2e CRs-Fixed: 1076380
-rw-r--r--src/com/android/stk/StkLauncherActivity.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/com/android/stk/StkLauncherActivity.java b/src/com/android/stk/StkLauncherActivity.java
index b9fb7de..7cb3c06 100644
--- a/src/com/android/stk/StkLauncherActivity.java
+++ b/src/com/android/stk/StkLauncherActivity.java
@@ -19,6 +19,8 @@ package com.android.stk;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.KeyEvent;
@@ -28,10 +30,14 @@ import android.widget.ListView;
import android.widget.TextView;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
+import android.text.TextUtils;
import com.android.internal.telephony.cat.Item;
import com.android.internal.telephony.cat.Menu;
import com.android.internal.telephony.cat.CatLog;
+import com.android.internal.telephony.OperatorSimInfo;
import com.android.internal.telephony.PhoneConstants;
import android.telephony.TelephonyManager;
@@ -178,6 +184,11 @@ public class StkLauncherActivity extends ListActivity {
mSingleSimId = i;
stkItemName = new StringBuilder(appName).append(" ")
.append(Integer.toString(i + 1)).toString();
+ //Sim Icon Customisation feature change
+ String operatorSimLabel = getOperatorSimLabel(i);
+ if (!TextUtils.isEmpty(operatorSimLabel)) {
+ stkItemName = operatorSimLabel;
+ }
Item item = new Item(i + 1, stkItemName, mBitMap);
item.id = i;
mStkMenuList.add(item);
@@ -207,4 +218,21 @@ public class StkLauncherActivity extends ListActivity {
startService(new Intent(this, StkAppService.class)
.putExtras(args));
}
+
+ private String getOperatorSimLabel(int slotIndex) {
+ String operatorSimLabel = "";
+ OperatorSimInfo operatorSimInfo = new OperatorSimInfo(mContext);
+ if (operatorSimInfo.isOperatorFeatureEnabled()) {
+ if (operatorSimInfo.isSimTypeOperator(slotIndex)) {
+ mBitMap = ((BitmapDrawable)operatorSimInfo.getOperatorDrawable()).getBitmap();
+ operatorSimLabel = operatorSimInfo.getOperatorDisplayName();
+ } else {
+ mBitMap = ((BitmapDrawable)operatorSimInfo.getGenericSimDrawable()).getBitmap();
+ operatorSimLabel = TelephonyManager.from(mContext).
+ getSimOperator(SubscriptionManager.getSubId(slotIndex)[0]);
+ }
+ }
+ return operatorSimLabel;
+ }
+
}