Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71551a39 authored by Songchun Fan's avatar Songchun Fan Committed by Automerger Merge Worker
Browse files

Merge "Revert "Revert "[AppsFilter] read-only interface for snapshots""" into tm-dev am: 6346fb8a

parents 41716e63 6346fb8a
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -15,15 +15,34 @@
 */
package android.util;

import android.annotation.NonNull;

/**
 * A sparse array of ArraySets, which is suitable to hold userid->packages association.
 *
 * @hide
 */
public class SparseSetArray<T> {
    private final SparseArray<ArraySet<T>> mData = new SparseArray<>();
    private final SparseArray<ArraySet<T>> mData;

    public SparseSetArray() {
        mData = new SparseArray<>();
    }

    /**
     * Copy constructor
     */
    public SparseSetArray(@NonNull SparseSetArray<T> src) {
        final int arraySize = src.size();
        mData = new SparseArray<>(arraySize);
        for (int i = 0; i < arraySize; i++) {
            final int key = src.keyAt(i);
            final ArraySet<T> set = src.get(key);
            final int setSize = set.size();
            for (int j = 0; j < setSize; j++) {
                add(key, set.valueAt(j));
            }
        }
    }

    /**
Loading