完成应用报告显示逻辑

This commit is contained in:
ZhanGSKen 2025-02-09 13:08:34 +08:00
parent 2f72f1795e
commit ee52a6c28c
3 changed files with 24 additions and 27 deletions

View File

@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun Feb 09 11:41:02 HKT 2025
#Sun Feb 09 05:07:18 GMT 2025
stageCount=2
libraryProject=libappbase
baseVersion=1.2
publishVersion=1.2.1
buildCount=0
buildCount=30
baseBetaVersion=1.2.2

View File

@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun Feb 09 11:40:48 HKT 2025
#Sun Feb 09 05:07:18 GMT 2025
stageCount=2
libraryProject=libappbase
baseVersion=1.2
publishVersion=1.2.1
buildCount=0
buildCount=30
baseBetaVersion=1.2.2

View File

@ -130,7 +130,6 @@ public final class CrashHandler {
LogUtils.d(TAG, "gotoCrashActiviy: ");
if (AppCrashSafetyWire.getInstance().isAppCrashSafetyWireOK()) {
LogUtils.d(TAG, "gotoCrashActiviy: isAppCrashSafetyWireOK");
AppCrashSafetyWire.getInstance().postResumeCrashSafetyWireHandler(app);
intent.setClass(app, GlobalCrashActiviy.class);
intent.putExtra(EXTRA_CRASH_INFO, errorLog);
// 如果发生了 CrashHandler 内部崩溃 就调用基础的应用崩溃显示类
@ -141,7 +140,6 @@ public final class CrashHandler {
// 正常状态调用进阶的应用崩溃显示页
intent.setClass(app, CrashActiviy.class);
intent.putExtra(EXTRA_CRASH_INFO, errorLog);
AppCrashSafetyWire.getInstance().resumeToMaximumImmediately();
}
@ -330,21 +328,17 @@ public final class CrashHandler {
new Handler(Looper.getMainLooper()).postDelayed(new Runnable(){
@Override
public void run() {
LogUtils.d(TAG, "Handler run()");
if (!AppCrashSafetyWire.getInstance().isSafetyWireWorking(currentSafetyLevel - 1)) {
// 如果下一次应用崩溃时保险丝熔断则先恢复保险丝满能状态
// 进程持续运行时恢复保险丝熔断值
//Resume to maximum
resumeToMaximumImmediately();
// LogUtils.d(TAG, "postCrashSafetyWire Resume to maximum");
// while (resumeToMaximum(currentSafetyLevel + 1)) {
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e) {
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
// }
// }
AppCrashSafetyWire.getInstance().resumeToMaximumImmediately();
LogUtils.d(TAG, "postResumeCrashSafetyWireHandler");
}
}, 1000);
}
}, 500);
}
}
public static String getAppName(Context context) {
@ -368,6 +362,7 @@ public final class CrashHandler {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppCrashSafetyWire.getInstance().postResumeCrashSafetyWireHandler(getApplicationContext());
mLog = getIntent().getStringExtra(EXTRA_CRASH_INFO);
setTheme(android.R.style.Theme_DeviceDefault_Light_DarkActionBar);
@ -388,7 +383,7 @@ public final class CrashHandler {
contentView.addView(hw, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
setContentView(contentView);
getActionBar().setTitle(TITTLE);
getActionBar().setSubtitle("GlobalCrashActiviy Error");
getActionBar().setSubtitle(GlobalApplication.class.getSimpleName() + " Error");
}
}
@ -457,6 +452,8 @@ public final class CrashHandler {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppCrashSafetyWire.getInstance().postResumeCrashSafetyWireHandler(getApplicationContext());
mLog = getIntent().getStringExtra(EXTRA_CRASH_INFO);
setTheme(android.R.style.Theme_DeviceDefault_NoActionBar);
// TypedArray a = obtainStyledAttributes(attrs, R.styleable.ASupportToolbar, R.attr.aSupportToolbar, 0);