已解决
android13(T) SystemUI 运营商显示 bug 修复
来自网友在路上 180880提问 提问时间:2023-09-28 00:09:46阅读次数: 80
最佳答案 问答题库808位专家为你答疑解惑
aosp 本身 bug,开启状态栏显示运营商时,会有 npe 问题
frameworks/base/packages/SystemUI/src/com/android/systemui/util/CarrierConfigTracker.java
@@ -213,6 +213,10 @@ public class CarrierConfigTracker* @param subId the subscription id for which to query the config*/public boolean getShowOperatorNameInStatusBarConfig(int subId) {
+ //add for show OperatorName
+ if (true) {
+ return true;
+ }//endif (mShowOperatorNameConfigs.indexOfKey(subId) >= 0) {return mShowOperatorNameConfigs.get(subId);} else {
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/OperatorNameViewController.java
@@ -93,9 +93,11 @@ public class OperatorNameViewController extends ViewController<OperatorNameView>private SubInfo getDefaultSubInfo() {int defaultSubId = SubscriptionManager.getDefaultDataSubscriptionId();SubscriptionInfo sI = mKeyguardUpdateMonitor.getSubscriptionInfoForSubId(defaultSubId);
+ //fix when show operator sim cardout npe return new SubInfo(
- sI.getSubscriptionId(),
- sI.getCarrierName(),
+ sI != null ? sI.getSubscriptionId() : 0,
+ sI != null ? sI.getDisplayName() : null,//中国电信
+ // sI.getCarrierName(),//CHN-CT — 中国电信mKeyguardUpdateMonitor.getSimState(defaultSubId),mKeyguardUpdateMonitor.getServiceState(defaultSubId));}
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
@@ -614,8 +614,12 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueueint subId = SubscriptionManager.getDefaultDataSubscriptionId();if (mCarrierConfigTracker.getShowOperatorNameInStatusBarConfig(subId)) {ViewStub stub = mStatusBar.findViewById(R.id.operator_name);
+ //add for fix aosp bug open operator show crash
+ View operatorFrameView = stub.inflate();
+ OperatorNameView operatorNameView = (OperatorNameView)operatorFrameView.findViewById(R.id.operator_name);mOperatorNameViewController =
- mOperatorNameViewControllerFactory.create((OperatorNameView) stub.inflate());
+ mOperatorNameViewControllerFactory.create(operatorNameView);//end
+ // mOperatorNameViewControllerFactory.create((OperatorNameView) stub.inflate());//aosp bugmOperatorNameViewController.init();// This view should not be visible on lock-screenif (mKeyguardStateController.isShowing()) {
查看全文
99%的人还看了
猜你感兴趣
版权申明
本文"android13(T) SystemUI 运营商显示 bug 修复":http://eshow365.cn/6-14919-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!
- 上一篇: 如何去开展软件测试工作
- 下一篇: 第二届全国高校计算机技能竞赛——Java赛道