package defpackage;

import android.app.PendingIntent;
import android.content.ContentProviderClient;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
import com.google.android.gms.common.internal.zzaf;

/* JADX INFO: renamed from: ᵠᵶᵽʾ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC3174 {

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static final Uri f12047 = new Uri.Builder().scheme("content").authority("com.google.android.gms.chimera").build();

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static Intent m7281(Context context, C0478 c0478) throws zzaf {
        Bundle bundleCall;
        String str = c0478.f2569;
        Intent intent = null;
        if (str == null) {
            return new Intent().setComponent(null);
        }
        if (c0478.f2568) {
            Bundle bundle = new Bundle();
            bundle.putString("serviceActionBundleKey", str);
            try {
                ContentProviderClient contentProviderClientAcquireUnstableContentProviderClient = context.getContentResolver().acquireUnstableContentProviderClient(f12047);
                if (contentProviderClientAcquireUnstableContentProviderClient == null) {
                    throw new RemoteException("Failed to acquire ContentProviderClient");
                }
                try {
                    bundleCall = contentProviderClientAcquireUnstableContentProviderClient.call("serviceIntentCall", null, bundle);
                    contentProviderClientAcquireUnstableContentProviderClient.release();
                } catch (Throwable th) {
                    contentProviderClientAcquireUnstableContentProviderClient.release();
                    throw th;
                }
            } catch (RemoteException e) {
                e = e;
                "Dynamic intent resolution failed: ".concat(e.toString());
                bundleCall = null;
            } catch (IllegalArgumentException e2) {
                e = e2;
                "Dynamic intent resolution failed: ".concat(e.toString());
                bundleCall = null;
            }
            if (bundleCall != null) {
                Intent intent2 = (Intent) bundleCall.getParcelable("serviceResponseIntentKey");
                if (intent2 != null) {
                    intent = intent2;
                } else {
                    PendingIntent pendingIntent = (PendingIntent) bundleCall.getParcelable("serviceMissingResolutionIntentKey");
                    if (pendingIntent != null) {
                        new StringBuilder(str.length() + 72);
                        throw new zzaf(new C2646(25, pendingIntent, null));
                    }
                }
            }
            if (intent == null) {
                "Dynamic lookup for intent failed for action: ".concat(str);
            }
        }
        return intent == null ? new Intent(str).setPackage(c0478.f2567) : intent;
    }
}
