新增鹰眼识别车辆类型:卡车,自行车
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user