package androidx.emoji2.text;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

/* JADX INFO: loaded from: classes.dex */
public abstract class l {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final q f2241a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f2242b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f2243c = 0;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final i f2244d = new i();

    @Nullable
    int[] mEmojiAsDefaultStyleExceptions;

    @Nullable
    Set<o> mInitCallbacks;

    public l(q qVar) {
        p0.g.checkNotNull(qVar, "metadataLoader cannot be null.");
        this.f2241a = qVar;
    }

    @NonNull
    public l setUseEmojiAsDefaultStyle(boolean z10, @Nullable List<Integer> list) {
        this.f2242b = z10;
        if (!z10 || list == null) {
            this.mEmojiAsDefaultStyleExceptions = null;
        } else {
            this.mEmojiAsDefaultStyleExceptions = new int[list.size()];
            Iterator<Integer> it = list.iterator();
            int i10 = 0;
            while (it.hasNext()) {
                this.mEmojiAsDefaultStyleExceptions[i10] = it.next().intValue();
                i10++;
            }
            Arrays.sort(this.mEmojiAsDefaultStyleExceptions);
        }
        return this;
    }
}
