47 lines
1.5 KiB
Java
47 lines
1.5 KiB
Java
|
package com.google.android.gms.vision.clearcut;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.content.pm.PackageManager;
|
||
|
import com.google.android.gms.common.wrappers.Wrappers;
|
||
|
import com.google.android.gms.internal.vision.zzdh;
|
||
|
import com.google.android.gms.internal.vision.zzdm;
|
||
|
import com.google.android.gms.internal.vision.zzdp;
|
||
|
import com.google.android.gms.internal.vision.zzdt;
|
||
|
import com.google.android.gms.internal.vision.zzdu;
|
||
|
import com.google.android.gms.vision.L;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public class LogUtils {
|
||
|
public static zzdu zza(long j, int i) {
|
||
|
zzdu zzduVar = new zzdu();
|
||
|
zzdp zzdpVar = new zzdp();
|
||
|
zzduVar.zzqe = zzdpVar;
|
||
|
zzdm zzdmVar = new zzdm();
|
||
|
zzdpVar.zzpk = new zzdm[1];
|
||
|
zzdpVar.zzpk[0] = zzdmVar;
|
||
|
zzdmVar.zzot = Long.valueOf(j);
|
||
|
zzdmVar.zzou = Long.valueOf(i);
|
||
|
zzdmVar.zzov = new zzdt[i];
|
||
|
return zzduVar;
|
||
|
}
|
||
|
|
||
|
public static zzdh zzd(Context context) {
|
||
|
zzdh zzdhVar = new zzdh();
|
||
|
zzdhVar.zzod = context.getPackageName();
|
||
|
String zze = zze(context);
|
||
|
if (zze != null) {
|
||
|
zzdhVar.version = zze;
|
||
|
}
|
||
|
return zzdhVar;
|
||
|
}
|
||
|
|
||
|
private static String zze(Context context) {
|
||
|
try {
|
||
|
return Wrappers.packageManager(context).getPackageInfo(context.getPackageName(), 0).versionName;
|
||
|
} catch (PackageManager.NameNotFoundException e) {
|
||
|
L.zza(e, "Unable to find calling package info for %s", context.getPackageName());
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
}
|