Android 在联系人相应界面显示运营商名称

  1. 在“要显示的联系人”界面显示运营商名称
    在这里插入图片描述
修改方法:ContactsCommon/src/com/android/contacts/common/list/ContactListFilterView.java

            case ContactListFilter.FILTER_TYPE_ACCOUNT: {
-                mAccountUserName.setVisibility(View.VISIBLE);
+                mAccountUserName.setVisibility(View.GONE);
                 mIcon.setVisibility(View.VISIBLE);
                 if (mFilter.icon != null) {
                     mIcon.setImageDrawable(mFilter.icon);
@@ -141,7 +141,7 @@ public class ContactListFilterView extends LinearLayout {
                 /// M: Add SIM Indicator feature for Android M. @{
                 if (SubInfoUtils.getActivatedSubInfoCount() == 1 &&
                         accountType.isIccCardAccount()) {
-                    mAccountType.setVisibility(View.GONE);
+                    mAccountType.setVisibility(View.VISIBLE);
                     mAccountUserName.setTextAppearance(mContext,
                             android.R.attr.textAppearanceMedium);
                     mAccountUserName.setTextSize(18);


  1. 在“导入/导出联系人”界面显示运营商名称
    在这里插入图片描述
修改方法:Contacts/src/com/mediatek/contacts/activities/ContactImportExportActivity.java

            if (accountType != null && accountType.isIccCardAccount()) {
                 icon = accountType.getDisplayIconBySubId(mContext, subId);
-                type = (String) accountType.getDisplayLabel(mContext);
+                               //DUT should show operator name instead of SIM in Import/Export
+                //type = (String) accountType.getDisplayLabel(mContext);
             } else if (accountType != null) {
                 icon = accountType.getDisplayIcon(mContext);
             }


3.在“保存联系人到”界面显示运营商名称
在这里插入图片描述

修改方法:ContactsCommon/src/com/mediatek/contacts/util/AccountsListAdapterUtils.java

         if (isLocalPhone || activtedSubInfoCount <= 1) {
-            text2.setVisibility(View.GONE);
+            text2.setVisibility(View.VISIBLE);
         } else {
             text2.setVisibility(View.VISIBLE);
         }


4.在“新增联系人”界面显示运营商名称。
在这里插入图片描述在这里插入图片描述

修改方法:Contacts/src/com/android/contacts/editor/CompactRawContactsEditorView.java

第一地方修改:

        vlog("activatedSubInfoCount = " + activatedSubInfoCount
                 + ",accountType = " + accountType.accountType);
         if (AccountTypeUtils.isAccountTypeIccCard(accountType.accountType)) {
-            if(activatedSubInfoCount <= 1){
+            /*if(activatedSubInfoCount <= 1){
             mAccountNameView.setVisibility(View.GONE);
-        } else {
+        } else {*/
             if (accountInfo.first != null) {
                 int subId = AccountTypeUtils.getSubIdBySimAccountName(getContext(),
                         accountInfo.first);
                 String account_name = SubInfoUtils.getDisplaynameUsingSubId(subId);
                 mAccountNameView.setText(account_name);
             }
-        }
+        //}
         }
         /// @}

 

第二个地方修改:

             /// M: Modify for SIM indicator feature. @{
             if (AccountTypeUtils.isAccountTypeIccCard(type.accountType)) {
-                if(activatedSubInfoCount <= 1){
+                /*if(activatedSubInfoCount <= 1){
                     mAccountHeaderNameTextView.setVisibility(View.GONE);
-                } else {
+                } else {*/
                 if (accountInfo.first != null) {
                     int subId = AccountTypeUtils.getSubIdBySimAccountName(getContext(),
                             accountInfo.first);
                     String account_name = SubInfoUtils.getDisplaynameUsingSubId(subId);
                     mAccountHeaderNameTextView.setText(account_name);
                 }
-            }
+            //}
             }
           /// @}

         /// M: Modify for SIM indicator feature. @{
         if (AccountTypeUtils.isAccountTypeIccCard(type.accountType)) {
-            if(activatedSubInfoCount <= 1){
+            /*if(activatedSubInfoCount <= 1){
             mAccountSelectorNameTextView.setVisibility(View.GONE);
         } else {
                 mAccountSelectorNameTextView.setVisibility(
                         mAccountHeaderNameTextView.getVisibility());
-            }
+            }*/
+            mAccountSelectorNameTextView.setVisibility(
+                        mAccountHeaderNameTextView.getVisibility());
         }
         /// @}


猜你喜欢

转载自blog.csdn.net/jydzm/article/details/85853780