package androidx.browser.customtabs; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.IBinder; import android.os.Parcelable; import android.util.SparseArray; import androidx.browser.customtabs.a; import androidx.core.app.i; import java.util.ArrayList; /* loaded from: classes.dex */ public final class d { /* renamed from: a, reason: collision with root package name */ public final Intent f1249a; /* renamed from: b, reason: collision with root package name */ public final Bundle f1250b; d(Intent intent, Bundle bundle) { this.f1249a = intent; this.f1250b = bundle; } public void a(Context context, Uri uri) { this.f1249a.setData(uri); androidx.core.content.a.startActivity(context, this.f1249a, this.f1250b); } public static final class a { /* renamed from: c, reason: collision with root package name */ private ArrayList f1253c; /* renamed from: d, reason: collision with root package name */ private Bundle f1254d; /* renamed from: e, reason: collision with root package name */ private ArrayList f1255e; /* renamed from: f, reason: collision with root package name */ private SparseArray f1256f; /* renamed from: g, reason: collision with root package name */ private Bundle f1257g; /* renamed from: a, reason: collision with root package name */ private final Intent f1251a = new Intent("android.intent.action.VIEW"); /* renamed from: b, reason: collision with root package name */ private final a.C0012a f1252b = new a.C0012a(); /* renamed from: h, reason: collision with root package name */ private int f1258h = 0; /* renamed from: i, reason: collision with root package name */ private boolean f1259i = true; public a() { } private void c(IBinder iBinder, PendingIntent pendingIntent) { Bundle bundle = new Bundle(); i.a(bundle, "android.support.customtabs.extra.SESSION", iBinder); if (pendingIntent != null) { bundle.putParcelable("android.support.customtabs.extra.SESSION_ID", pendingIntent); } this.f1251a.putExtras(bundle); } public d a() { if (!this.f1251a.hasExtra("android.support.customtabs.extra.SESSION")) { c(null, null); } ArrayList arrayList = this.f1253c; if (arrayList != null) { this.f1251a.putParcelableArrayListExtra("android.support.customtabs.extra.MENU_ITEMS", arrayList); } ArrayList arrayList2 = this.f1255e; if (arrayList2 != null) { this.f1251a.putParcelableArrayListExtra("android.support.customtabs.extra.TOOLBAR_ITEMS", arrayList2); } this.f1251a.putExtra("android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS", this.f1259i); this.f1251a.putExtras(this.f1252b.a().a()); Bundle bundle = this.f1257g; if (bundle != null) { this.f1251a.putExtras(bundle); } if (this.f1256f != null) { Bundle bundle2 = new Bundle(); bundle2.putSparseParcelableArray("androidx.browser.customtabs.extra.COLOR_SCHEME_PARAMS", this.f1256f); this.f1251a.putExtras(bundle2); } this.f1251a.putExtra("androidx.browser.customtabs.extra.SHARE_STATE", this.f1258h); return new d(this.f1251a, this.f1254d); } public a b(f fVar) { this.f1251a.setPackage(fVar.b().getPackageName()); c(fVar.a(), fVar.c()); return this; } public a(f fVar) { if (fVar != null) { b(fVar); } } } }