package o;

import androidx.appcompat.widget.ActionBarContextView;
import com.google.android.gms.common.api.Api;
import java.util.Arrays;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.j, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1535j implements InterfaceC1888mk0 {
    public int a;
    public boolean b;
    public Object c;

    @Override // o.InterfaceC1888mk0
    public void a() {
        if (this.b) {
            return;
        }
        ActionBarContextView actionBarContextView = (ActionBarContextView) this.c;
        actionBarContextView.q = null;
        super/*android.view.View*/.setVisibility(this.a);
    }

    @Override // o.InterfaceC1888mk0
    public void b() {
        this.b = true;
    }

    @Override // o.InterfaceC1888mk0
    public void c() {
        super/*android.view.View*/.setVisibility(0);
        this.b = false;
    }

    public void d(Object obj) {
        int i;
        obj.getClass();
        int length = ((Object[]) this.c).length;
        int i2 = this.a;
        int i3 = i2 + 1;
        if (i3 < 0) {
            throw new IllegalArgumentException("cannot store more than MAX_VALUE elements");
        }
        if (i3 <= length) {
            i = length;
        } else {
            i = (length >> 1) + length + 1;
            if (i < i3) {
                int iHighestOneBit = Integer.highestOneBit(i2);
                i = iHighestOneBit + iHighestOneBit;
            }
            if (i < 0) {
                i = Api.BaseClientBuilder.API_PRIORITY_OTHER;
            }
        }
        if (i > length || this.b) {
            this.c = Arrays.copyOf((Object[]) this.c, i);
            this.b = false;
        }
        Object[] objArr = (Object[]) this.c;
        int i4 = this.a;
        this.a = i4 + 1;
        objArr[i4] = obj;
    }
}
