-
public final class CrashGuardLayer 4 crash marker + per-model breaker, state in the existing
zerogpuprefs. A phase is written before every dangerous step (download/load/sample) and cleared on graceful shutdown; a phase that survives to the next boot means the process died mid-step —sdk.crash_detected— and repeated deaths during one model's risky phases blocklist that model for 24 h so a crash loop can't take the host app down again and again.All transitions are pure functions over CrashGuardState (unit-testable); this class is only the SharedPreferences shell.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classCrashGuard.Companion
-
Constructor Summary
Constructors Constructor Description CrashGuard(Context context, Function0<Long> clock)
-
Method Summary
Modifier and Type Method Description final CrashReportonBoot()Evaluated once at SDK construction; null means the last exit was clean. final UnitsetPhase(String phase, String modelId, String modelVersion)final UnitclearPhase(String lastShutdownCode)final BooleanisBlocklisted(String modelId, String modelVersion)-
-
Method Detail
-
onBoot
final CrashReport onBoot()
Evaluated once at SDK construction; null means the last exit was clean.
-
clearPhase
final Unit clearPhase(String lastShutdownCode)
-
isBlocklisted
final Boolean isBlocklisted(String modelId, String modelVersion)
-
-
-
-