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

Commit e46beb7c authored by Kweku Adams's avatar Kweku Adams
Browse files

Creating base QuotaTracker class.

The CountQuotaTracker and DurationQuotaTracker will both extend this
class to implement their respective tracking. Common code and ancillary
options have been put into the base class.

Bug: 135764360
Test: atest CountQuotaTrackerTest
Test: atest DurationQuotaTrackerTest
Change-Id: I4b55219cd4ea76bf05ddddda10e6fb6b3f187226
parent a99a9692
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@ import android.annotation.Nullable;
 * @see Uptc
 */
public interface Categorizer {
    /** A {@link Categorizer} that always returns {@link Category.SINGLE_CATEGORY}. */
    Categorizer SINGLE_CATEGORIZER = (userId, packageName, tag) -> Category.SINGLE_CATEGORY;

    /**
     * Return the {@link Category} that this UPTC belongs to.
     *
+6 −0
Original line number Diff line number Diff line
@@ -28,6 +28,12 @@ import android.util.quota.CategoryProto;
 * @see Uptc
 */
public final class Category {
    /**
     * A {@link Category} that can be used if every app should be treated the same (given the same
     * category).
     */
    public static final Category SINGLE_CATEGORY = new Category("SINGLE");

    @NonNull
    private final String mName;

+661 −0

File added.

Preview size limit exceeded, changes collapsed.