68 lines
2.3 KiB
Java
68 lines
2.3 KiB
Java
package com.facebook;
|
|
|
|
import android.os.AsyncTask;
|
|
import android.os.Handler;
|
|
import android.os.HandlerThread;
|
|
import android.os.Looper;
|
|
import android.util.Log;
|
|
import java.net.HttpURLConnection;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class GraphRequestAsyncTask extends AsyncTask<Void, Void, List<GraphResponse>> {
|
|
private static final String d = GraphRequestAsyncTask.class.getCanonicalName();
|
|
private final HttpURLConnection a;
|
|
private final GraphRequestBatch b;
|
|
private Exception c;
|
|
|
|
public GraphRequestAsyncTask(GraphRequestBatch graphRequestBatch) {
|
|
this(null, graphRequestBatch);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
@Override // android.os.AsyncTask
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onPostExecute(List<GraphResponse> list) {
|
|
super.onPostExecute(list);
|
|
Exception exc = this.c;
|
|
if (exc != null) {
|
|
Log.d(d, String.format("onPostExecute: exception encountered during request: %s", exc.getMessage()));
|
|
}
|
|
}
|
|
|
|
@Override // android.os.AsyncTask
|
|
protected void onPreExecute() {
|
|
super.onPreExecute();
|
|
if (FacebookSdk.n()) {
|
|
Log.d(d, String.format("execute async task: %s", this));
|
|
}
|
|
if (this.b.f() == null) {
|
|
this.b.a(Thread.currentThread() instanceof HandlerThread ? new Handler() : new Handler(Looper.getMainLooper()));
|
|
}
|
|
}
|
|
|
|
public String toString() {
|
|
return "{RequestAsyncTask: connection: " + this.a + ", requests: " + this.b + "}";
|
|
}
|
|
|
|
public GraphRequestAsyncTask(HttpURLConnection httpURLConnection, GraphRequestBatch graphRequestBatch) {
|
|
this.b = graphRequestBatch;
|
|
this.a = httpURLConnection;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
@Override // android.os.AsyncTask
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public List<GraphResponse> doInBackground(Void... voidArr) {
|
|
try {
|
|
if (this.a == null) {
|
|
return this.b.a();
|
|
}
|
|
return GraphRequest.a(this.a, this.b);
|
|
} catch (Exception e) {
|
|
this.c = e;
|
|
return null;
|
|
}
|
|
}
|
|
}
|