我是靠谱客的博主 辛勤雪糕,最近开发中收集的这篇文章主要介绍[RK3326]Android 8.1开机4G无信号但能上网,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

4G加载较晚,状态栏未监听TelephonyIntents.ACTION_SERVICE_STATE_CHANGED广播,导致状态未更新

diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index 34a03bf..9786363 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -371,6 +371,13 @@ public class MobileSignalController extends SignalController<
         } else if (action.equals(TelephonyIntents.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED)) {
             updateDataSim();
             notifyListenersIfNecessary();
+        } else if(action.equals(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED)) {
+            ServiceState mLastServiceState = ServiceState.newFromBundle(intent.getExtras());
+
+            if(mLastServiceState != null && (mServiceState == null || mServiceState.getVoiceRegState() != mLastServiceState.getVoiceRegState())) {
+                mServiceState = mLastServiceState;
+                updateTelephony();
+            }
         }
     }
 
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index bb3e09f..78ec503 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -433,6 +433,12 @@ public class NetworkControllerImpl extends BroadcastReceiver
                 // emergency state.
                 recalculateEmergency();
             }
+           
+            for (int i = 0; i < mMobileSignalControllers.size(); i++) {
+                MobileSignalController controller = mMobileSignalControllers.valueAt(i);
+                controller.handleBroadcast(intent);
+            }
+
         } else {
             int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
                     SubscriptionManager.INVALID_SUBSCRIPTION_ID);

最后

以上就是辛勤雪糕为你收集整理的[RK3326]Android 8.1开机4G无信号但能上网的全部内容,希望文章能够帮你解决[RK3326]Android 8.1开机4G无信号但能上网所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(35)

评论列表共有 0 条评论

立即
投稿
返回
顶部