• android13(T) SystemUI 运营商显示 bug 修复


    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;
    +        }//end
             if (mShowOperatorNameConfigs.indexOfKey(subId) >= 0) {
                 return mShowOperatorNameConfigs.get(subId);
             } else {
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    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));
         }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java

    @@ -614,8 +614,12 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
             int 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 bug
                 mOperatorNameViewController.init();
                 // This view should not be visible on lock-screen
                 if (mKeyguardStateController.isShowing()) {
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
  • 相关阅读:
    插值查找算法(思路分析) [数据结构][Java]
    javaSE- 方法的使用
    超声波清洗机靠谱吗?实用性比较高的超声波清洗机推荐
    MySQL8.0忘记密码
    面向气象灾害预警信息的5G网络切片技术研究
    vim 自动添加脚本信息
    R语言使用epiDisplay包的dotplot函数通过点图的形式可视化不同区间数据点的频率、使用pch参数自定义指定点图数据点的形状
    java毕业设计人才招聘网源码+lw文档+mybatis+系统+mysql数据库+调试
    [MAUI 项目实战] 手势控制音乐播放器(一): 概述与架构
    deepstream python yolov5使用记录
  • 原文地址:https://blog.csdn.net/u012932409/article/details/133066043