新增鹰眼识别车辆类型:卡车,自行车

This commit is contained in:
lianglihui
2021-06-11 15:58:02 +08:00
parent 34f71b3833
commit 8bd6fb19b7
5 changed files with 32 additions and 16 deletions

View File

@@ -6,7 +6,9 @@ import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import java.util.List;
@@ -58,6 +60,25 @@ public class AppUtils {
}
}
private static final String MOGO_MAP_SDK_VERSION = "MAP_SDK_VERSION";
public static String getCustomMapSDKVersion(Context context){
return getApplicationMetaValue(context,MOGO_MAP_SDK_VERSION);
}
private static String getApplicationMetaValue(Context context,String metaName){
try {
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(),PackageManager.GET_META_DATA);
Bundle bundle = applicationInfo.metaData;
if (bundle != null){
return bundle.getString(metaName);
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return "";
}
public static boolean isAppForeground( Context context ) {
if ( context != null ) {
ActivityManager activityManager = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );

View File

@@ -180,11 +180,9 @@ class BaseDrawer {
AdasRecognizedType recognizedType = AdasRecognizedType.valueFrom(type);
if (recognizedType == AdasRecognizedType.classIdCar) {
return R.raw.othercar;
} else if (recognizedType == AdasRecognizedType.classIdTrafficBus
|| recognizedType == AdasRecognizedType.classIdTrafficTruck) {
} else if (recognizedType == AdasRecognizedType.classIdTrafficBus) {
return R.raw.bus;
} else if (recognizedType == AdasRecognizedType.classIdBicycle
|| recognizedType == AdasRecognizedType.classIdMoto) {
} else if (recognizedType == AdasRecognizedType.classIdMoto) {
return R.raw.motorbike;
} else if (recognizedType == AdasRecognizedType.classIdStopLine) {
return R.raw.stopline;
@@ -192,6 +190,10 @@ class BaseDrawer {
return R.raw.arraw;
} else if (recognizedType == AdasRecognizedType.classIdUnKnow) {
return R.raw.tache;
}else if(recognizedType == AdasRecognizedType.classIdBicycle){
return R.raw.zixingche;
}else if(recognizedType == AdasRecognizedType.classIdTrafficTruck){
return R.raw.kache;
}
return R.raw.people;
}

Binary file not shown.

View File

@@ -11,6 +11,7 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.test.crashreport.CrashReportConstants;
import com.mogo.test.crashreport.ITestCrashReportProvider;
import com.mogo.utils.AppUtils;
import com.mogo.utils.logger.Logger;
import com.tencent.bugly.crashreport.CrashReport;
@@ -31,7 +32,7 @@ class BuglyCrashReportProvider implements ITestCrashReportProvider {
private static final String TAG = "BuglyCrashReportProvider";
@Override
public void init(final Context context ) {
public void init(Context context ) {
Logger.d(TAG, "init");
String packageName = context.getPackageName();
String processName = getProcessName( android.os.Process.myPid() );
@@ -39,17 +40,9 @@ class BuglyCrashReportProvider implements ITestCrashReportProvider {
strategy.setUploadProcess( processName == null || processName.equals( packageName ) );
CrashReport.initCrashReport( context, "f3f8b0b2f1", true, strategy );
CrashReport.putUserData( context, "serial", MoGoAiCloudClientConfig.getInstance().getSn() );
try {
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(),PackageManager.GET_META_DATA);
Bundle bundle = applicationInfo.metaData;
if (bundle != null){
String sdkVersion = bundle.getString("MAP_SDK_VERSION");
Log.e("lianglihui", "init: "+sdkVersion);
CrashReport.putUserData( context, "MAP_SDK_VERSION",bundle.getString("MAP_SDK_VERSION") );
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
Log.e("lianglihui", "init: "+mapSDKVersion);
CrashReport.putUserData( context, "MAP_SDK_VERSION",mapSDKVersion );
}
/**