既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Go语言开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
和你一起终身学****习,这里是程序员Android
经典好文推荐,通过阅读本文,您将收获以下知识点:
一、开机向导时 Google DUO 概率ANR
二、开机向导时 Google Calendar 概率 ANR
三、开机向导时 ANR 弹框不show的解决方案
四、开机向导时 Google Music 概率 ANR
五、开机向导时 Google Play Store 概率 ANR
六、 Google play Store 下载apk 概率性闪退
一、开机向导时 DUO 概率ANR
=================
从Log
中分析主要原因是android.intent.action.LOCALE_CHANGED
广播接收超时导致的ANR
。
1.ANR Log 如下:
ANR Log
2.ANR 规避方案如下:
在BroadcastQueue
类的 processNextBroadcast
方法中,当第一次开机时候,跳过此Action。
3.修改类路径如下:
/alps/frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
public final class BroadcastQueue {
... ...
final void processNextBroadcastLocked(boolean fromMsg, boolean skipOomAdj) {
BroadcastRecord r;
... ...
// import android.provider.Settings;
//when frist boot , ingore Google Duo anr when receive broadcast : android.intent.action.LOCALE_CHANGED
if (info.activityInfo.name.contains ("com.google.android.apps.tachyon") &&
r.intent.getAction().equals("android.intent.action.LOCALE_CHANGED")){
int deviceProvisioned = Settings.Global.getInt(mService.mContext.getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0);
if (deviceProvisioned == 0) {
Slog.e(TAG,"switch users or first boot google duo ANR ignore");
skip = true;
}
}
// This is safe to do even if we are skipping the broadcast, and we need
// this information now to evaluate whether it is going to be allowed to run.
final int receiverUid = info.activityInfo.applicationInfo.uid;
// If it's a singleton, it needs to be the same app or a special app
... ...
}
... ...
}
4. git diff 修改如下:
git 修改记录
二、开机向导时 Calendar 概率 ANR
=======================
1.ANR Log 如下:
Calendar ANR log
2.ANR 规避方案如下:
主要原因是 android.intent.action.LOCALE_CHANGED 广播接收超时导致的ANR。
3.修改方案
请参考修改一
三、 开机向导时,ANR 弹框不show的解决方案
=========================
刷机或者恢复出厂设置是,开机向导过程中不应该显示ANR
。
修改文件路径如下:
frameworks/base/services/core/java/com/android/server/am/AppErrors.java
修改AppErrors
类中 handleShowAnrUi
方法,控制在开机向导时ANR
弹窗。
class AppErrors {
... ...
void handleShowAppErrorUi(Message msg) {
... ...
// If we've created a crash dialog, show it without the lock held
if (d != null) {
int deviceProvisioned = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.DEVICE_PROVISIONED,0);
if(proc.userId == 0){
if(deviceProvisioned == 0 && !proc.processName.equals("com.google.android.setupwizard")){
mService.killAppAtUsersRequest(proc, null);
}else{
d.show();
}
} else {
d.show();
}
}
... ...
}
... ...
}
1. git 解决方案
git 修改差别的
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Go语言开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
.(img-4nwNddBM-1715814074933)]
[外链图片转存中…(img-b3ZVs7EQ-1715814074934)]
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Go语言开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新