package p138.p176.p177.p242.p246.p247.p248;

import android.app.ActivityManager;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.DeadObjectException;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import com.google.android.gms.common.api.ApiException;
import com.google.android.gms.common.api.GoogleApiActivity;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.common.api.UnsupportedApiCallException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.concurrent.GuardedBy;
import p000.p001.p002.p003.p004.C0567;
import p037.p057.C1714;
import p037.p057.C1717;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p242.p246.C4191;
import p138.p176.p177.p242.p246.C4193;
import p138.p176.p177.p242.p246.C4194;
import p138.p176.p177.p242.p246.C4198;
import p138.p176.p177.p242.p246.p247.C4202;
import p138.p176.p177.p242.p246.p247.C4212;
import p138.p176.p177.p242.p246.p247.InterfaceC4213;
import p138.p176.p177.p242.p246.p247.InterfaceC4214;
import p138.p176.p177.p242.p246.p249.AbstractC4251;
import p138.p176.p177.p242.p246.p249.C4264;
import p138.p176.p177.p242.p246.p249.C4272;
import p138.p176.p177.p242.p246.p249.C4281;
import p138.p176.p177.p242.p246.p249.InterfaceC4273;
import p138.p176.p177.p242.p258.p260.HandlerC4356;
import p138.p176.p177.p242.p267.C5043;
import p138.p176.p177.p242.p267.InterfaceC5053;
import p138.p176.p177.p242.p270.C5063;

/* JADX INFO: renamed from: ދ.ހ.֏.ހ.ހ.މ.ނ.ؠ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C4217 implements Handler.Callback {

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public static final Status f13421 = new Status(4, "Sign-out occurred while this API call was in progress.");

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public static final Status f13422 = new Status(4, "The user must be signed in to make this API call.");

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public static final Object f13423 = new Object();

    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    @GuardedBy("lock")
    public static C4217 f13424;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public long f13425 = 5000;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public long f13426 = 120000;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public long f13427 = 10000;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final Context f13428;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public final C4194 f13429;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public final C4272 f13430;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public final AtomicInteger f13431;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public final Map<C4244<?>, C4218<?>> f13432;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    @GuardedBy("lock")
    public C4226 f13433;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    @GuardedBy("lock")
    public final Set<C4244<?>> f13434;

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final Set<C4244<?>> f13435;

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public final Handler f13436;

    /* JADX INFO: renamed from: ދ.ހ.֏.ހ.ހ.މ.ނ.ؠ$֏, reason: contains not printable characters */
    public class C4218<O extends C4202.InterfaceC4205> implements InterfaceC4213, InterfaceC4214, InterfaceC4247 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final Queue<AbstractC4228> f13437;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final C4202.InterfaceC4210 f13438;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final C4244<O> f13439;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final C4225 f13440;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public final Set<C4245> f13441;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final Map<C4224<?>, C4236> f13442;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public final int f13443;

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public final BinderC4238 f13444;

        /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
        public boolean f13445;

        /* JADX INFO: renamed from: އ, reason: contains not printable characters */
        public final List<C4219> f13446;

        /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
        public C4191 f13447;

        /* JADX INFO: renamed from: މ, reason: contains not printable characters */
        public final /* synthetic */ C4217 f13448;

        /* JADX WARN: Multi-variable type inference failed */
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final C4193 m6883(C4193[] c4193Arr) {
            if (c4193Arr != null && c4193Arr.length != 0) {
                C4193[] c4193ArrM6869 = this.f13438.m6869();
                if (c4193ArrM6869 == null) {
                    c4193ArrM6869 = new C4193[0];
                }
                C1714 c1714 = new C1714(c4193ArrM6869.length);
                for (C4193 c4193 : c4193ArrM6869) {
                    c1714.put(c4193.f13398, Long.valueOf(c4193.m6842()));
                }
                for (C4193 c41932 : c4193Arr) {
                    if (!c1714.containsKey(c41932.f13398) || ((Long) c1714.get(c41932.f13398)).longValue() < c41932.m6842()) {
                        return c41932;
                    }
                }
            }
            return null;
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final void m6884() {
            C0567.m1879(this.f13448.f13436);
            if (this.f13438.m6865() || this.f13438.m6868()) {
                return;
            }
            C4217 c4217 = this.f13448;
            C4272 c4272 = c4217.f13430;
            Context context = c4217.f13428;
            C4202.InterfaceC4210 interfaceC4210 = this.f13438;
            if (c4272 == null) {
                throw null;
            }
            C0567.m1910(context);
            C0567.m1910(interfaceC4210);
            int iMo6844 = 0;
            if (interfaceC4210.m6866()) {
                int iM6867 = interfaceC4210.m6867();
                int i = c4272.f13555.get(iM6867, -1);
                if (i != -1) {
                    iMo6844 = i;
                } else {
                    int i2 = 0;
                    while (true) {
                        if (i2 >= c4272.f13555.size()) {
                            iMo6844 = i;
                            break;
                        }
                        int iKeyAt = c4272.f13555.keyAt(i2);
                        if (iKeyAt > iM6867 && c4272.f13555.get(iKeyAt) == 0) {
                            break;
                        } else {
                            i2++;
                        }
                    }
                    if (iMo6844 == -1) {
                        iMo6844 = c4272.f13556.mo6844(context, iM6867);
                    }
                    c4272.f13555.put(iM6867, iMo6844);
                }
            }
            if (iMo6844 != 0) {
                mo6875(new C4191(iMo6844, null));
                return;
            }
            C4220 c4220 = this.f13448.new C4220(this.f13438, this.f13439);
            if (this.f13438.mo6872()) {
                BinderC4238 binderC4238 = this.f13444;
                InterfaceC5053 interfaceC5053 = binderC4238.f13481;
                if (interfaceC5053 != null) {
                    interfaceC5053.m6871();
                }
                binderC4238.f13480.f13532 = Integer.valueOf(System.identityHashCode(binderC4238));
                C4202.AbstractC4203<? extends InterfaceC5053, C5043> abstractC4203 = binderC4238.f13478;
                Context context2 = binderC4238.f13476;
                Looper looper = binderC4238.f13477.getLooper();
                C4264 c4264 = binderC4238.f13480;
                binderC4238.f13481 = (InterfaceC5053) abstractC4203.mo6861(context2, looper, c4264, c4264.f13531, binderC4238, binderC4238);
                binderC4238.f13482 = c4220;
                Set<Scope> set = binderC4238.f13479;
                if (set == null || set.isEmpty()) {
                    binderC4238.f13477.post(new RunnableC4239(binderC4238));
                } else {
                    binderC4238.f13481.mo8535();
                }
            }
            this.f13438.m6862(c4220);
        }

        @Override // p138.p176.p177.p242.p246.p247.InterfaceC4213
        /* JADX INFO: renamed from: ֏ */
        public final void mo6873(int i) {
            if (Looper.myLooper() == this.f13448.f13436.getLooper()) {
                m6894();
            } else {
                this.f13448.f13436.post(new RunnableC4231(this));
            }
        }

        /* JADX WARN: Multi-variable type inference failed */
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final void m6885(Status status) {
            C0567.m1879(this.f13448.f13436);
            Iterator<AbstractC4228> it = this.f13437.iterator();
            while (it.hasNext()) {
                C5063<T> c5063 = ((AbstractC4242) it.next()).f13485;
                c5063.f15214.m8563((Exception) new ApiException(status));
            }
            this.f13437.clear();
        }

        @Override // p138.p176.p177.p242.p246.p247.InterfaceC4214
        /* JADX INFO: renamed from: ֏ */
        public final void mo6875(C4191 c4191) {
            InterfaceC5053 interfaceC5053;
            C0567.m1879(this.f13448.f13436);
            BinderC4238 binderC4238 = this.f13444;
            if (binderC4238 != null && (interfaceC5053 = binderC4238.f13481) != null) {
                interfaceC5053.m6871();
            }
            m6897();
            this.f13448.f13430.f13555.clear();
            m6892(c4191);
            if (c4191.f13393 == 4) {
                m6885(C4217.f13422);
                return;
            }
            if (this.f13437.isEmpty()) {
                this.f13447 = c4191;
                return;
            }
            m6889(c4191);
            if (this.f13448.m6882(c4191, this.f13443)) {
                return;
            }
            if (c4191.f13393 == 18) {
                this.f13445 = true;
            }
            if (this.f13445) {
                Handler handler = this.f13448.f13436;
                handler.sendMessageDelayed(Message.obtain(handler, 9, this.f13439), this.f13448.f13425);
            } else {
                if (this.f13439 == null) {
                    throw null;
                }
                throw null;
            }
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final void m6886(AbstractC4228 abstractC4228) {
            C0567.m1879(this.f13448.f13436);
            if (this.f13438.m6865()) {
                if (m6890(abstractC4228)) {
                    m6899();
                    return;
                } else {
                    this.f13437.add(abstractC4228);
                    return;
                }
            }
            this.f13437.add(abstractC4228);
            C4191 c4191 = this.f13447;
            if (c4191 != null) {
                if ((c4191.f13393 == 0 || c4191.f13394 == null) ? false : true) {
                    mo6875(this.f13447);
                    return;
                }
            }
            m6884();
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final boolean m6887(boolean z) {
            C0567.m1879(this.f13448.f13436);
            if (!this.f13438.m6865() || this.f13442.size() != 0) {
                return false;
            }
            C4225 c4225 = this.f13440;
            if (!((c4225.f13463.isEmpty() && c4225.f13464.isEmpty()) ? false : true)) {
                this.f13438.m6871();
                return true;
            }
            if (z) {
                m6899();
            }
            return false;
        }

        @Override // p138.p176.p177.p242.p246.p247.InterfaceC4213
        /* JADX INFO: renamed from: ؠ */
        public final void mo6874(Bundle bundle) {
            if (Looper.myLooper() == this.f13448.f13436.getLooper()) {
                m6891();
            } else {
                this.f13448.f13436.post(new RunnableC4230(this));
            }
        }

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final boolean m6888() {
            return this.f13438.mo6872();
        }

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final boolean m6889(C4191 c4191) {
            synchronized (C4217.f13423) {
            }
            return false;
        }

        /* JADX WARN: Multi-variable type inference failed */
        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final boolean m6890(AbstractC4228 abstractC4228) {
            if (!(abstractC4228 instanceof AbstractC4237)) {
                m6893(abstractC4228);
                return true;
            }
            AbstractC4237 abstractC4237 = (AbstractC4237) abstractC4228;
            C4243 c4243 = (C4243) abstractC4237;
            if (c4243 == null || this.f13442.get(c4243.f13486) != null) {
                throw null;
            }
            C4193 c4193M6883 = m6883((C4193[]) null);
            if (c4193M6883 == null) {
                m6893(abstractC4228);
                return true;
            }
            if (this.f13442.get(c4243.f13486) != null) {
                throw null;
            }
            ((AbstractC4242) abstractC4237).f13485.f15214.m8563((Exception) new UnsupportedApiCallException(c4193M6883));
            return false;
        }

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final void m6891() {
            m6897();
            m6892(C4191.f13391);
            m6898();
            Iterator<C4236> it = this.f13442.values().iterator();
            if (it.hasNext()) {
                it.next();
                throw null;
            }
            m6895();
            m6899();
        }

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final void m6892(C4191 c4191) {
            Iterator<C4245> it = this.f13441.iterator();
            if (!it.hasNext()) {
                this.f13441.clear();
                return;
            }
            C4245 next = it.next();
            if (C0567.m1922(c4191, C4191.f13391)) {
                this.f13438.m6870();
            }
            if (next == null) {
                throw null;
            }
            throw null;
        }

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final void m6893(AbstractC4228 abstractC4228) {
            m6888();
            if (((C4243) abstractC4228) == null) {
                throw null;
            }
            try {
                abstractC4228.mo6907((C4218<?>) this);
            } catch (DeadObjectException unused) {
                mo6873(1);
                this.f13438.m6871();
            }
        }

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final void m6894() {
            m6897();
            this.f13445 = true;
            C4225 c4225 = this.f13440;
            if (c4225 == null) {
                throw null;
            }
            c4225.m6904(true, C4241.f13484);
            Handler handler = this.f13448.f13436;
            handler.sendMessageDelayed(Message.obtain(handler, 9, this.f13439), this.f13448.f13425);
            Handler handler2 = this.f13448.f13436;
            handler2.sendMessageDelayed(Message.obtain(handler2, 11, this.f13439), this.f13448.f13426);
            this.f13448.f13430.f13555.clear();
        }

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public final void m6895() {
            ArrayList arrayList = new ArrayList(this.f13437);
            int size = arrayList.size();
            int i = 0;
            while (i < size) {
                Object obj = arrayList.get(i);
                i++;
                AbstractC4228 abstractC4228 = (AbstractC4228) obj;
                if (!this.f13438.m6865()) {
                    return;
                }
                if (m6890(abstractC4228)) {
                    this.f13437.remove(abstractC4228);
                }
            }
        }

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final void m6896() {
            C0567.m1879(this.f13448.f13436);
            m6885(C4217.f13421);
            C4225 c4225 = this.f13440;
            if (c4225 == null) {
                throw null;
            }
            c4225.m6904(false, C4217.f13421);
            for (C4224 c4224 : (C4224[]) this.f13442.keySet().toArray(new C4224[this.f13442.size()])) {
                m6886(new C4243(c4224, new C5063()));
            }
            m6892(new C4191(4));
            if (this.f13438.m6865()) {
                this.f13438.m6863(new C4232(this));
            }
        }

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public final void m6897() {
            C0567.m1879(this.f13448.f13436);
            this.f13447 = null;
        }

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public final void m6898() {
            if (this.f13445) {
                this.f13448.f13436.removeMessages(11, this.f13439);
                this.f13448.f13436.removeMessages(9, this.f13439);
                this.f13445 = false;
            }
        }

        /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
        public final void m6899() {
            this.f13448.f13436.removeMessages(12, this.f13439);
            Handler handler = this.f13448.f13436;
            handler.sendMessageDelayed(handler.obtainMessage(12, this.f13439), this.f13448.f13427);
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ހ.ހ.މ.ނ.ؠ$ؠ, reason: contains not printable characters */
    public static class C4219 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final C4244<?> f13449;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final C4193 f13450;

        public final boolean equals(Object obj) {
            if (obj != null && (obj instanceof C4219)) {
                C4219 c4219 = (C4219) obj;
                if (C0567.m1922(this.f13449, c4219.f13449) && C0567.m1922(this.f13450, c4219.f13450)) {
                    return true;
                }
            }
            return false;
        }

        public final int hashCode() {
            return Arrays.hashCode(new Object[]{this.f13449, this.f13450});
        }

        public final String toString() {
            C4281 c4281M1935 = C0567.m1935(this);
            c4281M1935.m6962("key", this.f13449);
            c4281M1935.m6962("feature", this.f13450);
            return c4281M1935.toString();
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ހ.ހ.މ.ނ.ؠ$ހ, reason: contains not printable characters */
    public class C4220 implements InterfaceC4240, AbstractC4251.InterfaceC4254 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final C4202.InterfaceC4210 f13451;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final C4244<?> f13452;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public InterfaceC4273 f13453 = null;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public Set<Scope> f13454 = null;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public boolean f13455 = false;

        public C4220(C4202.InterfaceC4210 interfaceC4210, C4244<?> c4244) {
            this.f13451 = interfaceC4210;
            this.f13452 = c4244;
        }

        @Override // p138.p176.p177.p242.p246.p249.AbstractC4251.InterfaceC4254
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final void mo6900(C4191 c4191) {
            C4217.this.f13436.post(new RunnableC4234(this, c4191));
        }

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final void m6901(C4191 c4191) {
            C4218<?> c4218 = C4217.this.f13432.get(this.f13452);
            C0567.m1879(c4218.f13448.f13436);
            c4218.f13438.m6871();
            c4218.mo6875(c4191);
        }
    }

    public C4217(Context context, Looper looper, C4194 c4194) {
        new AtomicInteger(1);
        this.f13431 = new AtomicInteger(0);
        this.f13432 = new ConcurrentHashMap(5, 0.75f, 1);
        this.f13433 = null;
        this.f13434 = new C1717(0);
        this.f13435 = new C1717(0);
        this.f13428 = context;
        this.f13436 = new HandlerC4356(looper, this);
        this.f13429 = c4194;
        this.f13430 = new C4272(c4194);
        Handler handler = this.f13436;
        handler.sendMessage(handler.obtainMessage(6));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C4217 m6880(Context context) {
        C4217 c4217;
        synchronized (f13423) {
            if (f13424 == null) {
                HandlerThread handlerThread = new HandlerThread("GoogleApiHandler", 9);
                handlerThread.start();
                f13424 = new C4217(context.getApplicationContext(), handlerThread.getLooper(), C4194.f13402);
            }
            c4217 = f13424;
        }
        return c4217;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // android.os.Handler.Callback
    public boolean handleMessage(Message message) {
        C4218<?> next;
        int i = message.what;
        int i2 = 0;
        switch (i) {
            case 1:
                this.f13427 = ((Boolean) message.obj).booleanValue() ? 10000L : 300000L;
                this.f13436.removeMessages(12);
                for (C4244<?> c4244 : this.f13432.keySet()) {
                    Handler handler = this.f13436;
                    handler.sendMessageDelayed(handler.obtainMessage(12, c4244), this.f13427);
                }
                return true;
            case 2:
                if (((C4245) message.obj) != null) {
                    throw null;
                }
                throw null;
            case 3:
                for (C4218<?> c4218 : this.f13432.values()) {
                    c4218.m6897();
                    c4218.m6884();
                }
                return true;
            case 4:
            case 8:
            case 13:
                C4235 c4235 = (C4235) message.obj;
                Map<C4244<?>, C4218<?>> map = this.f13432;
                if (c4235.f13474 == null) {
                    throw null;
                }
                C4218<?> c42182 = map.get(null);
                if (c42182 == null) {
                    m6881(c4235.f13474);
                    Map<C4244<?>, C4218<?>> map2 = this.f13432;
                    if (c4235.f13474 == null) {
                        throw null;
                    }
                    c42182 = map2.get(null);
                }
                if (!c42182.m6888() || this.f13431.get() == c4235.f13473) {
                    c42182.m6886(c4235.f13472);
                } else {
                    c4235.f13472.mo6906(f13421);
                    c42182.m6896();
                }
                return true;
            case 5:
                int i3 = message.arg1;
                C4191 c4191 = (C4191) message.obj;
                Iterator<C4218<?>> it = this.f13432.values().iterator();
                while (true) {
                    if (it.hasNext()) {
                        next = it.next();
                        if (next.f13443 == i3) {
                        }
                    } else {
                        next = null;
                    }
                }
                if (next != null) {
                    C4194 c4194 = this.f13429;
                    int i4 = c4191.f13393;
                    if (c4194 == null) {
                        throw null;
                    }
                    String strM6852 = C4198.m6852(i4);
                    String str = c4191.f13395;
                    StringBuilder sb = new StringBuilder(C2803.m4895(str, C2803.m4895(strM6852, 69)));
                    sb.append("Error resolution was canceled by the user, original error message: ");
                    sb.append(strM6852);
                    sb.append(": ");
                    sb.append(str);
                    next.m6885(new Status(17, sb.toString()));
                } else {
                    StringBuilder sb2 = new StringBuilder(76);
                    sb2.append("Could not find API instance ");
                    sb2.append(i3);
                    sb2.append(" while trying to fail enqueued calls.");
                    Log.wtf("GoogleApiManager", sb2.toString(), new Exception());
                }
                return true;
            case 6:
                if (this.f13428.getApplicationContext() instanceof Application) {
                    ComponentCallbacks2C4215.m6876((Application) this.f13428.getApplicationContext());
                    ComponentCallbacks2C4215.f13416.m6877(new C4229(this));
                    ComponentCallbacks2C4215 componentCallbacks2C4215 = ComponentCallbacks2C4215.f13416;
                    if (!componentCallbacks2C4215.f13418.get()) {
                        ActivityManager.RunningAppProcessInfo runningAppProcessInfo = new ActivityManager.RunningAppProcessInfo();
                        ActivityManager.getMyMemoryState(runningAppProcessInfo);
                        if (!componentCallbacks2C4215.f13418.getAndSet(true) && runningAppProcessInfo.importance > 100) {
                            componentCallbacks2C4215.f13417.set(true);
                        }
                    }
                    if (!componentCallbacks2C4215.f13417.get()) {
                        this.f13427 = 300000L;
                    }
                }
                return true;
            case 7:
                m6881((C4212<?>) message.obj);
                return true;
            case 9:
                if (this.f13432.containsKey(message.obj)) {
                    C4218<?> c42183 = this.f13432.get(message.obj);
                    C0567.m1879(c42183.f13448.f13436);
                    if (c42183.f13445) {
                        c42183.m6884();
                    }
                }
                return true;
            case 10:
                Iterator<C4244<?>> it2 = this.f13435.iterator();
                while (it2.hasNext()) {
                    this.f13432.remove(it2.next()).m6896();
                }
                this.f13435.clear();
                return true;
            case 11:
                if (this.f13432.containsKey(message.obj)) {
                    C4218<?> c42184 = this.f13432.get(message.obj);
                    C0567.m1879(c42184.f13448.f13436);
                    if (c42184.f13445) {
                        c42184.m6898();
                        C4217 c4217 = c42184.f13448;
                        c42184.m6885(c4217.f13429.mo6843(c4217.f13428) == 18 ? new Status(8, "Connection timed out while waiting for Google Play services update to complete.") : new Status(8, "API failed to connect while resuming due to an unknown error."));
                        c42184.f13438.m6871();
                    }
                }
                return true;
            case 12:
                if (this.f13432.containsKey(message.obj)) {
                    this.f13432.get(message.obj).m6887(true);
                }
                return true;
            case 14:
                if (((C4227) message.obj) == null || !this.f13432.containsKey(null)) {
                    throw null;
                }
                this.f13432.get(null).m6887(false);
                throw null;
            case 15:
                C4219 c4219 = (C4219) message.obj;
                if (this.f13432.containsKey(c4219.f13449)) {
                    C4218<?> c42185 = this.f13432.get(c4219.f13449);
                    if (c42185.f13446.contains(c4219) && !c42185.f13445) {
                        if (c42185.f13438.m6865()) {
                            c42185.m6895();
                        } else {
                            c42185.m6884();
                        }
                    }
                }
                return true;
            case 16:
                C4219 c42192 = (C4219) message.obj;
                if (this.f13432.containsKey(c42192.f13449)) {
                    C4218<?> c42186 = this.f13432.get(c42192.f13449);
                    if (c42186.f13446.remove(c42192)) {
                        c42186.f13448.f13436.removeMessages(15, c42192);
                        c42186.f13448.f13436.removeMessages(16, c42192);
                        C4193 c4193 = c42192.f13450;
                        ArrayList arrayList = new ArrayList(c42186.f13437.size());
                        for (AbstractC4228 abstractC4228 : c42186.f13437) {
                            if (abstractC4228 instanceof AbstractC4237) {
                                C4243 c4243 = (C4243) ((AbstractC4237) abstractC4228);
                                if (c4243 == null) {
                                    throw null;
                                }
                                if (c42186.f13442.get(c4243.f13486) != null) {
                                    throw null;
                                }
                            }
                        }
                        int size = arrayList.size();
                        while (i2 < size) {
                            Object obj = arrayList.get(i2);
                            i2++;
                            AbstractC4228 abstractC42282 = (AbstractC4228) obj;
                            c42186.f13437.remove(abstractC42282);
                            ((AbstractC4242) abstractC42282).f13485.f15214.m8563((Exception) new UnsupportedApiCallException(c4193));
                        }
                    }
                }
                return true;
            default:
                StringBuilder sb3 = new StringBuilder(31);
                sb3.append("Unknown message id: ");
                sb3.append(i);
                Log.w("GoogleApiManager", sb3.toString());
                return false;
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m6881(C4212<?> c4212) {
        if (c4212 == null) {
            throw null;
        }
        C4218<?> c4218 = this.f13432.get(null);
        if (c4218 != null) {
            if (c4218.m6888()) {
                this.f13435.add(null);
            }
            c4218.m6884();
            return;
        }
        new LinkedList();
        new HashSet();
        new HashMap();
        new ArrayList();
        this.f13436.getLooper();
        if (c4212 == null) {
            throw null;
        }
        C5043 c5043 = C5043.f15182;
        new C1717(0).addAll(Collections.emptySet());
        throw null;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final boolean m6882(C4191 c4191, int i) {
        C4194 c4194 = this.f13429;
        Context context = this.f13428;
        PendingIntent activity = null;
        if (c4194 == null) {
            throw null;
        }
        if ((c4191.f13393 == 0 || c4191.f13394 == null) ? false : true) {
            activity = c4191.f13394;
        } else {
            Intent intentMo6845 = c4194.mo6845(context, c4191.f13393, (String) null);
            if (intentMo6845 != null) {
                activity = PendingIntent.getActivity(context, 0, intentMo6845, 134217728);
            }
        }
        if (activity == null) {
            return false;
        }
        c4194.m6847(context, c4191.f13393, GoogleApiActivity.m1331(context, activity, i));
        return true;
    }
}
