149 lines
6.6 KiB
Java
149 lines
6.6 KiB
Java
package com.discord.hardware_analytics;
|
|
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.os.Looper;
|
|
import c.a.k.c.a;
|
|
import com.discord.hardware_analytics.media_codec.VideoRes;
|
|
import com.discord.utilities.system.RemoteIntentService;
|
|
import d0.d0.f;
|
|
import d0.t.h0;
|
|
import d0.t.n;
|
|
import d0.t.u;
|
|
import d0.z.d.m;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Iterator;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: HardwareSurveyService.kt */
|
|
public final class HardwareSurveyService extends RemoteIntentService {
|
|
public static final a i = new a(null);
|
|
|
|
/* compiled from: HardwareSurveyService.kt */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
public HardwareSurveyService() {
|
|
super("HardwareSurveyService");
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:88:0x0133 A[EDGE_INSN: B:88:0x0133->B:56:0x0133 ?: BREAK , SYNTHETIC] */
|
|
/* JADX WARNING: Removed duplicated region for block: B:91:0x005e A[SYNTHETIC] */
|
|
@Override // com.discord.utilities.system.RemoteIntentService
|
|
public Bundle doWork(Intent intent) {
|
|
boolean z2;
|
|
boolean z3;
|
|
m.checkNotNullParameter(intent, "intent");
|
|
if (!m.areEqual(Looper.myLooper(), Looper.getMainLooper())) {
|
|
c.a.k.c.a aVar = c.a.k.c.a.b;
|
|
long currentTimeMillis = System.currentTimeMillis();
|
|
List<a.C0026a> list = c.a.k.c.a.a;
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap(c.d.b.a.a.I(list, 10, 16));
|
|
for (Object obj : list) {
|
|
a.C0026a aVar2 = (a.C0026a) obj;
|
|
linkedHashMap.put(obj, -1);
|
|
}
|
|
Map mutableMap = h0.toMutableMap(linkedHashMap);
|
|
List<a.C0026a> list2 = c.a.k.c.a.a;
|
|
int coerceAtMost = f.coerceAtMost(16, c.a.k.c.a.a((a.C0026a) u.last((List<? extends Object>) list2), 16));
|
|
for (a.C0026a aVar3 : list2) {
|
|
int a2 = c.a.k.c.a.a(aVar3, coerceAtMost);
|
|
mutableMap.put(aVar3, Integer.valueOf(a2));
|
|
if (a2 == coerceAtMost) {
|
|
VideoRes videoRes = aVar3.a;
|
|
if (aVar3.d) {
|
|
List<a.C0026a> list3 = c.a.k.c.a.a;
|
|
ArrayList arrayList = new ArrayList();
|
|
for (Object obj2 : list3) {
|
|
if (((a.C0026a) obj2).a.compareTo(videoRes) <= 0) {
|
|
arrayList.add(obj2);
|
|
}
|
|
}
|
|
Iterator it = arrayList.iterator();
|
|
while (it.hasNext()) {
|
|
mutableMap.put((a.C0026a) it.next(), Integer.valueOf(coerceAtMost));
|
|
}
|
|
} else {
|
|
List<a.C0026a> list4 = c.a.k.c.a.a;
|
|
ArrayList arrayList2 = new ArrayList();
|
|
for (Object obj3 : list4) {
|
|
a.C0026a aVar4 = (a.C0026a) obj3;
|
|
if (aVar4.a.compareTo(videoRes) < 0 && !aVar4.d) {
|
|
arrayList2.add(obj3);
|
|
}
|
|
}
|
|
Iterator it2 = arrayList2.iterator();
|
|
while (it2.hasNext()) {
|
|
mutableMap.put((a.C0026a) it2.next(), Integer.valueOf(coerceAtMost));
|
|
}
|
|
}
|
|
Collection values = mutableMap.values();
|
|
if (!(values instanceof Collection) || !values.isEmpty()) {
|
|
Iterator it3 = values.iterator();
|
|
while (true) {
|
|
if (!it3.hasNext()) {
|
|
break;
|
|
}
|
|
if (((Number) it3.next()).intValue() == -1) {
|
|
z3 = true;
|
|
continue;
|
|
} else {
|
|
z3 = false;
|
|
continue;
|
|
}
|
|
if (z3) {
|
|
z2 = true;
|
|
break;
|
|
}
|
|
}
|
|
if (z2) {
|
|
break;
|
|
}
|
|
}
|
|
z2 = false;
|
|
if (z2) {
|
|
}
|
|
}
|
|
}
|
|
DecoderCountInfo decoderCountInfo = new DecoderCountInfo(0, 0, 0, 0, 0, 0, 0, 127);
|
|
for (Map.Entry entry : mutableMap.entrySet()) {
|
|
a.C0026a aVar5 = (a.C0026a) entry.getKey();
|
|
int intValue = ((Number) entry.getValue()).intValue();
|
|
if (aVar5.d) {
|
|
int ordinal = aVar5.a.ordinal();
|
|
if (ordinal == 0) {
|
|
decoderCountInfo.f2014c = intValue;
|
|
} else if (ordinal == 1) {
|
|
decoderCountInfo.b = intValue;
|
|
} else if (ordinal == 2) {
|
|
decoderCountInfo.a = intValue;
|
|
} else if (ordinal == 3) {
|
|
throw new AssertionError();
|
|
}
|
|
} else {
|
|
int ordinal2 = aVar5.a.ordinal();
|
|
if (ordinal2 == 0) {
|
|
decoderCountInfo.f = intValue;
|
|
} else if (ordinal2 == 1) {
|
|
decoderCountInfo.e = intValue;
|
|
} else if (ordinal2 == 2) {
|
|
decoderCountInfo.d = intValue;
|
|
} else if (ordinal2 == 3) {
|
|
throw new AssertionError();
|
|
}
|
|
}
|
|
}
|
|
decoderCountInfo.g = (int) (System.currentTimeMillis() - currentTimeMillis);
|
|
Bundle bundle = new Bundle();
|
|
m.checkNotNullParameter(bundle, "bundle");
|
|
bundle.putIntegerArrayList("com.discord.hardware_analytics.DecoderCountInfo", n.arrayListOf(Integer.valueOf(decoderCountInfo.a), Integer.valueOf(decoderCountInfo.b), Integer.valueOf(decoderCountInfo.f2014c), Integer.valueOf(decoderCountInfo.d), Integer.valueOf(decoderCountInfo.e), Integer.valueOf(decoderCountInfo.f), Integer.valueOf(decoderCountInfo.g)));
|
|
return bundle;
|
|
}
|
|
throw new IllegalStateException("Check failed.".toString());
|
|
}
|
|
}
|