Android系统 屏蔽“您的设备内部出现了问题,请联系您的设备制造商了解详情“弹窗

问题现象:

客户反馈在使用安卓系统机器时有时桌面会弹出“您的设备内部出现了问题,请联系您的设备制造商了解详情”,其实机器使用并没有问题,但是突然跳出这个界面,太影响使用体验,我们要做的就是在Android源码中屏蔽掉这段,使用中就不会跳出这个弹窗。


Android 5.1 - 9.0

注释显示弹窗的线程.
frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java,关键字SHOW_FINGERPRINT_ERROR_UI_MSG.

diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 6d87e940b6b..69a138f72bd 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -13643,7 +13643,7 @@ public final class ActivityManagerService extends ActivityManagerNative

             if (!Build.isBuildConsistent()) {
                 Slog.e(TAG, "Build fingerprint is not consistent, warning user");
-                mUiHandler.obtainMessage(SHOW_FINGERPRINT_ERROR_UI_MSG).sendToTarget();
+                //mUiHandler.obtainMessage(SHOW_FINGERPRINT_ERROR_UI_MSG).sendToTarget();
             }

             long ident = Binder.clearCallingIdentity();

Android11 - 12

出现警告框的原因有两种:

  1. 固件不匹配,system/boot/vendor三个fingerprint不一致,不是同一套固件。
  2. 机器打开支持了IO调试功能的config,编译时,使用文档前面所说的内核编译命令即可关闭。
  3. 对于需要使用IO调试功能的项目,可以直接不管上述两种原因,直接合入frameworks/base下的patch去掉弹窗:
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 9b33b56e9f8f..a1c3d60dcaff 100755
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -6485,7 +6485,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                 } catch (RemoteException e) {
                 }

-                if (!Build.isBuildConsistent()) {
+                if (0 && !Build.isBuildConsistent()) {
                     Slog.e(TAG, "Build fingerprint is not consistent, warning user");
                     mUiHandler.post(() -> {
                         if (mShowDialogs) {

你可能感兴趣的:(Android相关知识学习,android,ui,iot,经验分享,RK)