Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' into 'test_robotaxi-d-app-module_2130_221116_2.13.0.1'

Dev robotaxi d app module 2130 221116 2.13.0

See merge request zhjt/AndroidApp/MoGoEagleEye!491
This commit is contained in:
wangmingjun
2022-12-29 11:54:50 +00:00
4 changed files with 90 additions and 0 deletions

View File

@@ -9,10 +9,13 @@ import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
@@ -109,11 +112,22 @@ public class TaxiOrderCancelDialog extends AlertDialog implements View.OnClickLi
setCancelable(false);
setCanceledOnTouchOutside(false);
initWindowView();
}
private void initWindowView() {
Window window = getWindow();
//dialog padding 去掉
window.getDecorView().setPadding(0,0,0,0);
window.setDimAmount(0.5f);
window.getDecorView().setBackgroundColor(Color.parseColor("#00FFFFFF"));//设置背景, 不然显示不全
WindowManager.LayoutParams params = window.getAttributes();
window.setGravity(Gravity.CENTER);
WindowManager m = window.getWindowManager();
Display d = m.getDefaultDisplay();
params.height = d.getHeight() - 500;
window.setAttributes(params);
}
@RequiresApi(api = Build.VERSION_CODES.M)

View File

@@ -55,6 +55,10 @@ if (!isAndroidTestBuild()) {
leak_canary_crash_fix {
enable !isReleaseBuild
}
anr_fix {
enable true
}
}
}
}

View File

@@ -0,0 +1,71 @@
package com.mogo.launcher.lancet
import androidx.annotation.*
import com.knightboost.lancet.api.*
import com.knightboost.lancet.api.annotations.*
import com.knightboost.lancet.api.annotations.Weaver
import com.mogo.eagle.core.utilcode.util.*
import kotlinx.coroutines.Runnable
@Keep
@Weaver
@Group("anr_fix")
class ANRFix {
@Insert
@TargetClass("com.zhidao.cosupload.service.UploadService")
@TargetMethod(methodName = "addUploadPaths")
private fun fixAddUploadPathsANR() {
ThreadUtils.getIoPool().execute(ANRFixTask(This.get(), "addUploadPaths"))
}
@Insert
@TargetClass("com.zhidao.cosupload.service.UploadService")
@TargetMethod(methodName = "upload")
private fun fixUploadANR(@ClassOf("com.zhidao.cosupload.model.CacheUploadIdData") data: Any?) {
ThreadUtils.getIoPool().execute(ANRFixTask2(This.get(), "upload", data))
}
@Insert
@TargetClass("com.zhidao.cosupload.manager.CosUploadManagerImpl")
@TargetMethod(methodName = "upload")
private fun fixCosUploadManagerImplANR(productLine: String?, paths: List<String>?, eventId: String?, @ClassOf("com.zhidao.cosupload.DbPriorityConfig") config: Any?) {
ThreadUtils.getIoPool().execute(ANRFixTask3(This.get(), "upload", productLine, paths, eventId, config))
}
}
class ANRFixTask(private val delegate: Any, private val methodName: String): Runnable {
override fun run() {
delegate.javaClass.declaredMethods.find {
it.name != methodName && it.name.contains(methodName)
}?.also {
it.isAccessible = true
it.invoke(delegate)
}
}
}
class ANRFixTask2(private val delegate: Any, private val methodName: String, private val p: Any?): Runnable {
override fun run() {
delegate.javaClass.declaredMethods.find {
it.name != methodName && it.name.contains(methodName)
}?.also {
it.isAccessible = true
it.invoke(delegate, p)
}
}
}
class ANRFixTask3(private val delegate: Any, private val methodName: String,private val productLine: String?, private val paths: List<String>?, private val eventId: String?, private val config: Any?): Runnable {
override fun run() {
delegate.javaClass.declaredMethods.find {
it.name != methodName && it.name.contains(methodName)
}?.also {
it.isAccessible = true
it.invoke(delegate, productLine, paths, eventId, config)
}
}
}

View File

@@ -177,6 +177,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
}
MsgCategory.RECORD_BAG -> {
badCaseList?.add(0,msgBoxList)
badCaseList?.let { driverMsgBoxListAdapter?.setData(it) }
}
}
}