package com.google.android.play.core.a;

import X.4Ms;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Bundle;
import com.bytedance.covode.number.Covode;
import com.google.android.play.core.b.b;
import com.google.android.play.core.install.a;
import com.google.android.play.core.tasks.p;
import java.io.File;

public final class r extends p<a> {
    public final /* synthetic */ s LIZLLL;
    public final String LJ;

    static {
        Covode.recordClassIndex(44093);
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public r(s sVar, p<a> pVar, String str) {
        super(sVar, new b("OnRequestInstallCallback"), pVar);
        this.LIZLLL = sVar;
        this.LJ = str;
    }

    public final void LIZ(Bundle bundle) {
        Integer valueOf;
        Bundle bundle2 = bundle;
        super.LIZ(bundle2);
        if (bundle2.getInt("error.code", -2) != 0) {
            this.LIZIZ.LIZIZ(new a(bundle2.getInt("error.code", -2)));
            return;
        }
        p<T> pVar = this.LIZIZ;
        s sVar = this.LIZLLL;
        String str = this.LJ;
        int i = bundle2.getInt("version.code", -1);
        int i2 = bundle2.getInt("update.availability");
        int i3 = bundle2.getInt("install.status", 0);
        if (bundle2.getInt("client.version.staleness", -1) == -1) {
            valueOf = null;
        } else {
            valueOf = Integer.valueOf(bundle2.getInt("client.version.staleness"));
        }
        int i4 = bundle2.getInt("in.app.update.priority", 0);
        long j = bundle2.getLong("bytes.downloaded");
        long j2 = bundle2.getLong("total.bytes.to.download");
        long j3 = bundle2.getLong("additional.size.required");
        Context context = sVar.LIZLLL.LIZ;
        if (4Ms.LIZJ == null || !4Ms.LJ) {
            4Ms.LIZJ = context.getFilesDir();
        }
        pVar.LIZ(new w(str, i, i2, i3, valueOf, i4, j, j2, j3, u.LIZ(new File(4Ms.LIZJ, "assetpacks")), (PendingIntent) bundle2.getParcelable("blocking.intent"), (PendingIntent) bundle2.getParcelable("nonblocking.intent"), (PendingIntent) bundle2.getParcelable("blocking.destructive.intent"), (PendingIntent) bundle2.getParcelable("nonblocking.destructive.intent")));
    }
}
