package com.google.android.gms.common.api.internal; import android.os.DeadObjectException; import android.os.RemoteException; import com.google.android.gms.common.api.ApiException; import com.google.android.gms.common.api.Status; import com.google.android.gms.tasks.TaskCompletionSource; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes.dex */ public abstract class zad extends zac { protected final TaskCompletionSource zaa; public zad(int i, TaskCompletionSource taskCompletionSource) { super(i); this.zaa = taskCompletionSource; } protected abstract void zac(zabq zabqVar) throws RemoteException; @Override // com.google.android.gms.common.api.internal.zai public final void zad(Status status) { this.zaa.trySetException(new ApiException(status)); } @Override // com.google.android.gms.common.api.internal.zai public final void zae(Exception exc) { this.zaa.trySetException(exc); } @Override // com.google.android.gms.common.api.internal.zai public final void zaf(zabq zabqVar) throws DeadObjectException { try { zac(zabqVar); } catch (DeadObjectException e) { zad(zai.zah(e)); throw e; } catch (RemoteException e2) { zad(zai.zah(e2)); } catch (RuntimeException e3) { this.zaa.trySetException(e3); } } @Override // com.google.android.gms.common.api.internal.zai public void zag(zaad zaadVar, boolean z) { } }