package o;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.n90, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1935n90 implements Handler.Callback {
    public final /* synthetic */ int a;
    public final /* synthetic */ Object b;

    public /* synthetic */ C1935n90(int i, Object obj) {
        this.a = i;
        this.b = obj;
    }

    @Override // android.os.Handler.Callback
    public final boolean handleMessage(Message message) {
        switch (this.a) {
            case 0:
                if (message.what != 0) {
                    return false;
                }
                G0 g0 = (G0) this.b;
                if (message.obj != null) {
                    throw new ClassCastException();
                }
                synchronized (g0.m) {
                    throw null;
                }
            default:
                int i = message.arg1;
                Log.isLoggable("MessengerIpcClient", 3);
                Tu0 tu0 = (Tu0) this.b;
                synchronized (tu0) {
                    try {
                        jw0 jw0Var = (jw0) tu0.e.get(i);
                        if (jw0Var == null) {
                            return true;
                        }
                        tu0.e.remove(i);
                        tu0.c();
                        Bundle data = message.getData();
                        if (data.getBoolean("unsupported", false)) {
                            jw0Var.b(new C1549j60("Not supported by GmsCore", null));
                            return true;
                        }
                        switch (jw0Var.e) {
                            case 0:
                                if (!data.getBoolean("ack", false)) {
                                    jw0Var.b(new C1549j60("Invalid response to one way request", null));
                                    return true;
                                }
                                if (Log.isLoggable("MessengerIpcClient", 3)) {
                                    jw0Var.toString();
                                }
                                jw0Var.b.b(null);
                                return true;
                            default:
                                Bundle bundle = data.getBundle("data");
                                if (bundle == null) {
                                    bundle = Bundle.EMPTY;
                                }
                                if (Log.isLoggable("MessengerIpcClient", 3)) {
                                    jw0Var.toString();
                                    String.valueOf(bundle);
                                }
                                jw0Var.b.b(bundle);
                                return true;
                        }
                    } finally {
                    }
                }
        }
    }
}
