package o; import java.io.UnsupportedEncodingException; import o.C15788ibz; /* loaded from: classes.dex */ public abstract class hSC extends HJP { protected static final String PROTOCOL_CHARSET = "utf-8"; private static final String PROTOCOL_CONTENT_TYPE = String.format("application/json; charset=%s", PROTOCOL_CHARSET); private C15788ibz.LWm mListener; private final Object mLock; private final String mRequestBody; @Override // o.HJP public abstract C15788ibz parseNetworkResponse(DrQ drQ); @Deprecated public hSC(String str, String str2, C15788ibz.LWm lWm, C15788ibz.HBt hBt) { this(-1, str, str2, lWm, hBt); } public hSC(int i, String str, String str2, C15788ibz.LWm lWm, C15788ibz.HBt hBt) { super(i, str, hBt); this.mLock = new Object(); this.mListener = lWm; this.mRequestBody = str2; } @Override // o.HJP public void cancel() { super.cancel(); synchronized (this.mLock) { this.mListener = null; } } @Override // o.HJP public void deliverResponse(T t) { C15788ibz.LWm lWm; synchronized (this.mLock) { lWm = this.mListener; } if (lWm != null) { lWm.onResponse(t); } } @Override // o.HJP @Deprecated public String getPostBodyContentType() { return getBodyContentType(); } @Override // o.HJP @Deprecated public byte[] getPostBody() { return getBody(); } @Override // o.HJP public byte[] getBody() { try { String str = this.mRequestBody; if (str != null) { return str.getBytes(PROTOCOL_CHARSET); } return null; } catch (UnsupportedEncodingException unused) { qWd.c("Unsupported Encoding while trying to get the bytes of %s using %s", this.mRequestBody, PROTOCOL_CHARSET); return null; } } @Override // o.HJP public String getBodyContentType() { return PROTOCOL_CONTENT_TYPE; } }