63 lines
2.4 KiB
Java
63 lines
2.4 KiB
Java
package com.discord.hardware_analytics;
|
|
|
|
import android.app.ActivityManager;
|
|
import android.content.Context;
|
|
import d0.z.d.m;
|
|
import java.util.Objects;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: MemoryInfo.kt */
|
|
public final class MemoryInfo {
|
|
public static final a a = new a(null);
|
|
public final boolean b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public final int f2014c;
|
|
public final int d;
|
|
public final ActivityManager.MemoryInfo e;
|
|
|
|
/* compiled from: MemoryInfo.kt */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
public MemoryInfo(Context context) {
|
|
m.checkNotNullParameter(context, "context");
|
|
ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
|
|
this.e = memoryInfo;
|
|
Object systemService = context.getSystemService("activity");
|
|
Objects.requireNonNull(systemService, "null cannot be cast to non-null type android.app.ActivityManager");
|
|
ActivityManager activityManager = (ActivityManager) systemService;
|
|
this.b = activityManager.isLowRamDevice();
|
|
this.f2014c = activityManager.getMemoryClass();
|
|
this.d = activityManager.getLargeMemoryClass();
|
|
m.checkNotNullParameter(context, "context");
|
|
Object systemService2 = context.getSystemService("activity");
|
|
Objects.requireNonNull(systemService2, "null cannot be cast to non-null type android.app.ActivityManager");
|
|
((ActivityManager) systemService2).getMemoryInfo(memoryInfo);
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder L = c.d.b.a.a.L("MemoryObserver(isLowRamDevice=");
|
|
L.append(this.b);
|
|
L.append(", memoryClass=");
|
|
L.append(this.f2014c);
|
|
L.append(", ");
|
|
L.append("largeMemoryClass=");
|
|
L.append(this.d);
|
|
L.append(", info=");
|
|
ActivityManager.MemoryInfo memoryInfo = this.e;
|
|
StringBuilder L2 = c.d.b.a.a.L("MemoryInfo(availMem=");
|
|
L2.append(memoryInfo.availMem);
|
|
L2.append(", totalMem=");
|
|
L2.append(memoryInfo.totalMem);
|
|
L2.append(", threshold=");
|
|
L2.append(memoryInfo.threshold);
|
|
L2.append(", lowMemory=");
|
|
L2.append(memoryInfo.lowMemory);
|
|
L2.append(')');
|
|
L.append(L2.toString());
|
|
L.append(')');
|
|
return L.toString();
|
|
}
|
|
}
|