MTK 7.0 下拉状态栏左上角添加运营商显示
来源:互联网 发布:贪玩游戏 知乎 编辑:程序博客网 时间:2024/06/08 10:36
MTK 7.0 下拉状态栏左上角添加运营商显示
diff --git a/frameworks/base/packages/Keyguard/src/com/android/keyguard/CarrierText.java b/frameworks/base/packages/Keyguard/src/com/android/keyguard/CarrierText.javaindex 7cf27fb..93555ac 100755--- a/frameworks/base/packages/Keyguard/src/com/android/keyguard/CarrierText.java+++ b/frameworks/base/packages/Keyguard/src/com/android/keyguard/CarrierText.java@@ -45,6 +45,11 @@ import com.mediatek.keyguard.ext.ICarrierTextExt; import com.mediatek.keyguard.ext.IOperatorSIMString; import com.mediatek.keyguard.ext.IOperatorSIMString.SIMChangedTag; import com.mediatek.keyguard.Plugin.KeyguardPluginFactory;+/*gxk@Revo add operator name 20170809*/+import android.provider.Settings;+import android.os.Handler;+import com.android.featureoption.FeatureOption;+/*End og by gxk*/ public class CarrierText extends TextView { private static final boolean DEBUG = KeyguardConstants.DEBUG;@@ -57,6 +62,10 @@ public class CarrierText extends TextView { private KeyguardUpdateMonitor mKeyguardUpdateMonitor; private WifiManager mWifiManager;+/*gxk@Revo add operator name 20170809*/+ private static final String ACTION_OPERATOR_NAME = "revo_change_operator_name";+ private Handler revoHandler;+/*End of by gxk*/ ///M: added for multi-sim project private Context mContext ;@@ -134,6 +143,9 @@ public class CarrierText extends TextView { for (int i = 0; i < mNumOfPhone ; i++) { mStatusMode[i] = StatusMode.Normal; }+/*gxk@Revo add operator name 20170809*/+ revoHandler = new Handler();+/*End of by gxk*/ } public CarrierText(Context context) {@@ -313,7 +325,9 @@ public class CarrierText extends TextView { } // find all need-to-show carrier text, combine, and set text. String carrierFinalContent = null;- String divider = mCarrierTextExt.customizeCarrierTextDivider(mSeparator.toString());+/*gxk@Revo add operator name 20170809*/+ String divider = mCarrierTextExt.customizeCarrierTextDivider(CARRIER_DIVIDER.toString());+/*End of by gxk*/ for (int i = 0 ; i < mNumOfPhone ; i++) { ///M: fix ALPS01963660, do not show "null" string. if (mCarrierNeedToShow[i] && (mCarrier[i] != null)) {@@ -336,7 +350,21 @@ public class CarrierText extends TextView { Log.d(TAG, "updateCarrierText() - after combination, carrierFinalContent = " + carrierFinalContent) ;-+/*gxk@Revo add operator name 20170809*/+ if (FeatureOption.PRJ_FEATURE_REVO_B_ADD_OPERATOR_NAME && carrierFinalContent != null) {+ final String operatorLable = carrierFinalContent;+ Log.i("opera_name","carrier_label setCarrierLabel ="+operatorLable);+ Settings.System.putString(mContext.getContentResolver(),"revo_opera_name",operatorLable);+ revoHandler.postDelayed(new Runnable(){+ @Override+ public void run(){+ Intent intent = new Intent(ACTION_OPERATOR_NAME);+ intent.putExtra("revo_msg", operatorLable);+ mContext.sendBroadcast(intent);+ }+ },100);+ }+/*End of by gxk*/ setText(carrierFinalContent); }diff --git a/frameworks/base/packages/SystemUI/res/layout/status_bar_alarm_group.xml b/frameworks/base/packages/SystemUI/res/layout/status_bar_alarm_group.xmlold mode 100644new mode 100755index f94b727..d435770--- a/frameworks/base/packages/SystemUI/res/layout/status_bar_alarm_group.xml+++ b/frameworks/base/packages/SystemUI/res/layout/status_bar_alarm_group.xml@@ -24,6 +24,23 @@ android:layout_marginStart="16dp" android:gravity="start" android:orientation="vertical">+<!-- gxk@Revo add operator name 20170809 -->+ <TextView+ android:id="@+id/showcdma"+ android:layout_height="wrap_content"+ android:layout_width="match_parent"+ android:layout_marginLeft="-1dp"+ android:paddingBottom="5dp"+ android:textSize="10dp"+ android:textColor="#ffffff"+ android:ellipsize="marquee"+ android:marqueeRepeatLimit="marquee_forever"+ android:singleLine="true"+ android:focusable="true"+ android:focusableInTouchMode="true"+ android:visibility="gone"+ />+<!-- End of by gxk --> <LinearLayout android:id="@+id/date_time_group" android:layout_width="wrap_content"diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.javaindex 01f3185..540e3a4 100755--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java@@ -47,6 +47,13 @@ import com.android.systemui.statusbar.policy.NextAlarmController.NextAlarmChange import com.android.systemui.statusbar.policy.UserInfoController; import com.android.systemui.statusbar.policy.UserInfoController.OnUserInfoChangedListener; import com.android.systemui.tuner.TunerService;+/*gxk@Revo add operator name 20170809*/+import android.provider.Settings;+import android.content.Intent;+import android.content.IntentFilter;+import android.content.BroadcastReceiver;+import com.android.featureoption.FeatureOption;+/*End of by gxk*/ public class QuickStatusBarHeader extends BaseStatusBarHeader implements NextAlarmChangeCallback, OnClickListener, OnUserInfoChangedListener {@@ -71,7 +78,11 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements private ViewGroup mDateTimeGroup; private ViewGroup mDateTimeAlarmGroup; private TextView mEmergencyOnly;-+/*gxk@Revo add operator name 20170809*/+ private static final String ACTION_OPERATOR_NAME = "revo_change_operator_name";+ private TextView mShowOperaName;+ private String mName;+/*End of by gxk*/ protected ExpandableIndicator mExpandIndicator; private boolean mListening;@@ -95,6 +106,24 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements private float mExpansionAmount; private QSTileHost mHost; private boolean mShowFullAlarm;+/*gxk@Revo add operator name 20170809*/+ private final BroadcastReceiver mOperaReceiver = new BroadcastReceiver() {+ @Override+ public void onReceive(Context context, Intent intent) {+ final String action = intent.getAction();+ String revoName = intent.getStringExtra("revo_msg");+ if (ACTION_OPERATOR_NAME.equals(action)) {+ android.util.Log.i("opera_name", " ACTION_OPERATOR_NAME " + mExpanded);+ if(revoName != null && mExpanded) {+ android.util.Log.i("opera_name", " OPERATOR_NAME " + revoName);+ if (!revoName.equals(mShowOperaName.getText())) {+ mShowOperaName.setText(revoName);+ }+ }+ }+ }+ };+/*End of by gxk*/ public QuickStatusBarHeader(Context context, AttributeSet attrs) { super(context, attrs);@@ -107,6 +136,14 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements mEmergencyOnly = (TextView) findViewById(R.id.header_emergency_calls_only); mDateTimeAlarmGroup = (ViewGroup) findViewById(R.id.date_time_alarm_group);+/*gxk@Revo add operator name 20170809*/+ mShowOperaName = (TextView) findViewById(R.id.showcdma);+ if (FeatureOption.PRJ_FEATURE_REVO_B_ADD_OPERATOR_NAME) {+ IntentFilter iFilter = new IntentFilter();+ iFilter.addAction(ACTION_OPERATOR_NAME);+ mContext.registerReceiver(mOperaReceiver, iFilter);+ }+/*End of by gxk*/ mDateTimeAlarmGroup.findViewById(R.id.empty_time_view).setVisibility(View.GONE); mDateTimeGroup = (ViewGroup) findViewById(R.id.date_time_group); mDateTimeGroup.setPivotX(0);@@ -265,6 +302,11 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements setListening(false); mHost.getUserInfoController().remListener(this); mHost.getNetworkController().removeEmergencyListener(this);+/*gxk@Revo add operator name 20170809*/+ if (FeatureOption.PRJ_FEATURE_REVO_B_ADD_OPERATOR_NAME) {+ mContext.unregisterReceiver(mOperaReceiver);+ }+/*End of by gxk*/ super.onDetachedFromWindow(); }@@ -293,15 +335,32 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements @Override public void updateEverything() {+/*gxk@Revo add operator name 20170809*/+ mName = Settings.System.getString(mContext.getContentResolver(),"revo_opera_name");+/*End of by gxk*/ updateDateTimePosition(); updateVisibilities(); setClickable(false); } protected void updateVisibilities() {+/*gxk@Revo add operator name 20170809*/+ // String imsi = mTelephonyManager.getSubscriberId();+ // if (imsi == null || imsi.length() <= 0) {+ // mName = mContext.getResources().getString(+ // R.string.no_simcard_label);+ // }+ android.util.Log.i("opera_name","updateVisibilities = " + mExpanded + " opera_name = " + mName+ + " mShowEmergencyCallsOnly = " + mShowEmergencyCallsOnly); updateAlarmVisibilities(); mEmergencyOnly.setVisibility(mExpanded && mShowEmergencyCallsOnly ? View.VISIBLE : View.INVISIBLE);+ if (FeatureOption.PRJ_FEATURE_REVO_B_ADD_OPERATOR_NAME) {+ mShowOperaName.setVisibility(mExpanded && !mShowEmergencyCallsOnly+ ? View.VISIBLE : View.GONE);+ if (mExpanded && mName != null) mShowOperaName.setText(mName);+ }+/*End of by gxk*/ mSettingsContainer.setVisibility(mExpanded ? View.VISIBLE : View.INVISIBLE); mSettingsContainer.findViewById(R.id.tuner_icon).setVisibility( TunerService.isTunerEnabled(mContext) ? View.VISIBLE : View.INVISIBLE);
阅读全文
0 0
- MTK 7.0 下拉状态栏左上角添加运营商显示
- 安卓4.2原生rom状态栏显示运营商
- 在状态栏添加时间显示
- Android下拉状态栏快捷开关的添加
- Android下拉状态栏快捷开关的添加
- Android开发:屏蔽,显示系统下拉状态栏
- MTK 如何修改使得运营商名称显示随系统语言变化而变化
- android 5.1 中添加显示运营商的控制
- mtk获取运营商名称过程
- STM32开发板显示界面添加状态栏
- iOS状态栏获取网络类型,运营商,电池电量,显示的系统时间等信息
- MTK 状态栏相关(转)
- MTK 状态栏相关
- MTK状态栏相关资料
- MTK状态栏相关资料
- MTK 状态栏相关(转)
- MTK 状态栏总结
- ComBoBox添加到状态栏,添加的数据无法显示
- jquery validate required 无法验证空问题
- Js用Canvas实现简单时钟
- python初步实现word2vec
- 腾讯前端十天小白训练营<DAY 3>---css常用属性及行内&块级元素
- 面向对象的编程---创建对象
- MTK 7.0 下拉状态栏左上角添加运营商显示
- 云计算全球首推峰谷价,为企业节约49%成本
- axios全攻略
- (转载)mysql 启动错误(InnoDB: Operating system error number 13 )
- Linux环境下配置java
- 简单实现react.js语言国际化
- Java 匿名内部类 概述
- nyoj1000&&hdu4549 M斐波那契数列 递推公式+矩阵
- 179. Largest Number