package com.facetec.sdk; import android.os.Parcel; import java.util.HashMap; import java.util.Timer; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes.dex */ public final class cb { private static final HashMap a = new HashMap<>(); private static Timer d = null; cb() { } /* JADX INFO: Access modifiers changed from: package-private */ public static void a(T t, Parcel parcel) { if (t != null) { parcel.writeInt(a(t)); } else { parcel.writeInt(0); } } /* JADX INFO: Access modifiers changed from: package-private */ public static T c(Parcel parcel) { int readInt = parcel.readInt(); if (readInt != 0) { return (T) c(readInt); } return null; } private static int a(Object obj) { final int hashCode; synchronized (cb.class) { hashCode = obj.hashCode(); if (d == null) { d = new Timer(); } d.schedule(new da(new Runnable(hashCode) { // from class: com.facetec.sdk.cb$$ExternalSyntheticLambda0 public final int f$0; @Override // java.lang.Runnable public final void run() { cb.c(this.f$0); } { this.f$0 = hashCode; } }), 300000L); a.put(Integer.valueOf(hashCode), obj); } return hashCode; } /* JADX INFO: Access modifiers changed from: private */ public static Object c(int i) { Object remove; synchronized (cb.class) { HashMap hashMap = a; remove = hashMap.remove(Integer.valueOf(i)); if (d != null && hashMap.isEmpty()) { d.cancel(); d = null; } } return remove; } }