package P;

import F.C0168w;
import J0.RunnableC0394y;
import android.os.Handler;
import android.os.Looper;
import android.view.ActionMode;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class a implements J4.c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f5532a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ h f5533b;

    public /* synthetic */ a(h hVar, int i6) {
        this.f5532a = i6;
        this.f5533b = hVar;
    }

    @Override // J4.c
    public final Object invoke(Object obj) {
        switch (this.f5532a) {
            case 0:
                J4.a aVar = (J4.a) obj;
                h hVar = this.f5533b;
                Handler handler = hVar.f5552a.getHandler();
                if ((handler != null ? handler.getLooper() : null) == Looper.myLooper()) {
                    aVar.invoke();
                } else {
                    Handler handler2 = hVar.f5552a.getHandler();
                    if (handler2 != null) {
                        handler2.post(new RunnableC0394y(aVar, 1));
                    }
                }
                return C3137A.f25453a;
            case 1:
                ActionMode actionMode = this.f5533b.f5559h;
                if (actionMode != null) {
                    actionMode.invalidate();
                }
                return C3137A.f25453a;
            case 2:
                ActionMode actionMode2 = this.f5533b.f5559h;
                if (actionMode2 != null) {
                    actionMode2.invalidateContentRect();
                }
                return C3137A.f25453a;
            default:
                h hVar2 = this.f5533b;
                hVar2.f5556e.start();
                return new C0168w(hVar2, 5);
        }
    }
}
