summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-06-23 12:31:23 +0800
committeremancebo <emancebo@cyngn.com>2014-09-04 15:20:00 -0700
commit37621fae82dcad13eec91816174a597ac6bef3a4 (patch)
treefae7cdcb4886a4f1bb8c8d7129053c627190e88f
parent3a155baaefd6c75b7dc5fab954329952ce3e5054 (diff)
downloadpackages_apps_InCallUI-37621fae82dcad13eec91816174a597ac6bef3a4.tar.gz
packages_apps_InCallUI-37621fae82dcad13eec91816174a597ac6bef3a4.tar.bz2
packages_apps_InCallUI-37621fae82dcad13eec91816174a597ac6bef3a4.zip
InCallUI: Hide sim label when when calling sub is absent
When make emergency call without sim card, the sim card index 0 will be used. If the state of calling sub is absent, hide the sim label. CRs-Fixed: 683248 Change-Id: Ib912ec0751c0d7942e08e04c34c32df0f2a21bb7
-rw-r--r--src/com/android/incallui/CallCardFragment.java5
-rw-r--r--src/com/android/incallui/MSimInCallActivity.java21
2 files changed, 18 insertions, 8 deletions
diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java
index c6ae73f1..ce8173a5 100644
--- a/src/com/android/incallui/CallCardFragment.java
+++ b/src/com/android/incallui/CallCardFragment.java
@@ -29,6 +29,7 @@ import android.media.AudioManager;
import android.os.Bundle;
import static android.telephony.TelephonyManager.SIM_STATE_ABSENT;
import android.telephony.MSimTelephonyManager;
+import android.telephony.TelephonyManager;
import android.os.SystemProperties;
import android.provider.Settings;
import android.text.TextUtils;
@@ -334,7 +335,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
final String multiSimName = "perferred_name_sub";
int subscription = getPresenter().getActiveSubscription();
- if ((subscription != -1) && (!isSipCall)){
+ if ((subscription != -1) && (!isSipCall)
+ && MSimTelephonyManager.getDefault().getSimState(subscription)
+ != TelephonyManager.SIM_STATE_ABSENT) {
final String simName = Settings.System.getString(getActivity()
.getContentResolver(), multiSimName + (subscription + 1));
showSubscriptionInfo(simName);
diff --git a/src/com/android/incallui/MSimInCallActivity.java b/src/com/android/incallui/MSimInCallActivity.java
index df7c1dae..a8350af2 100644
--- a/src/com/android/incallui/MSimInCallActivity.java
+++ b/src/com/android/incallui/MSimInCallActivity.java
@@ -26,6 +26,7 @@ import android.content.res.TypedArray;
import android.os.Bundle;
import android.provider.Settings;
import android.telephony.MSimTelephonyManager;
+import android.telephony.TelephonyManager;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
@@ -148,14 +149,20 @@ public class MSimInCallActivity extends InCallActivity {
for (int i = 0; i < phoneCount; i++) {
mDsdaTabLayout[i] = getLayoutInflater()
.inflate(R.layout.msim_tab_sub_info, null);
+ if (MSimTelephonyManager.getDefault().getSimState(i)
+ == TelephonyManager.SIM_STATE_ABSENT) {
+ ((ImageView)mDsdaTabLayout[i].findViewById(R.id.tabSubIcon))
+ .setVisibility(View.INVISIBLE);
+ ((TextView)mDsdaTabLayout[i].findViewById(R.id.tabSubText))
+ .setVisibility(View.INVISIBLE);
+ } else {
+ ((ImageView)mDsdaTabLayout[i].findViewById(R.id.tabSubIcon))
+ .setBackground(icons.getDrawable(i));
- ((ImageView)mDsdaTabLayout[i].findViewById(R.id.tabSubIcon))
- .setBackground(icons.getDrawable(i));
-
- ((TextView)mDsdaTabLayout[i].findViewById(R.id.tabSubText))
- .setText(Settings.System.getString(getContentResolver(),
- MULTI_SIM_NAME[i]));
-
+ ((TextView)mDsdaTabLayout[i].findViewById(R.id.tabSubText))
+ .setText(Settings.System.getString(getContentResolver(),
+ MULTI_SIM_NAME[i]));
+ }
mDsdaTab[i] = bar.newTab().setCustomView(mDsdaTabLayout[i])
.setTabListener(new TabListener(i));
}