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

Commit 35b94bdc authored by George Lu's avatar George Lu Committed by Android (Google) Code Review
Browse files

Merge "Introduce ProgramInfoCache"

parents 853039cc c7697785
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2741,6 +2741,7 @@ package android.hardware.radio {
    method public int describeContents();
    method @android.hardware.radio.ProgramSelector.IdentifierType public int getType();
    method public long getValue();
    method public boolean isCategoryType();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.ProgramSelector.Identifier> CREATOR;
  }
+2 −0
Original line number Diff line number Diff line
@@ -352,6 +352,8 @@ public final class ProgramList implements AutoCloseable {
        /**
         * Checks, if non-tunable entries that define tree structure on the
         * program list (i.e. DAB ensembles) should be included.
         *
         * @see {@link ProgramSelector.Identifier#isCategory()}
         */
        public boolean areCategoriesIncluded() {
            return mIncludeCategories;
+13 −0
Original line number Diff line number Diff line
@@ -580,6 +580,19 @@ public final class ProgramSelector implements Parcelable {
            return mType;
        }

        /**
         * Returns whether this Identifier's type is considered a category when filtering
         * ProgramLists for category entries.
         *
         * @see {@link ProgramList.Filter#areCategoriesIncluded()}
         * @return False if this identifier's type is not tuneable (e.g. DAB ensemble or
         *         vendor-specified type). True otherwise.
         */
        public boolean isCategoryType() {
            return (mType >= IDENTIFIER_TYPE_VENDOR_START && mType <= IDENTIFIER_TYPE_VENDOR_END)
                    || mType == IDENTIFIER_TYPE_DAB_ENSEMBLE;
        }

        /**
         * Value of an identifier.
         *
+18 −0
Original line number Diff line number Diff line
@@ -257,6 +257,24 @@ public final class RadioMetadata implements Parcelable {

    private final Bundle mBundle;

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (!(obj instanceof RadioMetadata)) return false;
        Bundle otherBundle = ((RadioMetadata) obj).mBundle;
        if (!mBundle.keySet().equals(otherBundle.keySet())) {
            return false;
        }
        for (String key : mBundle.keySet()) {
            // This logic will return a false negative if we ever put Bundles into mBundle. As of
            // 2019-04-09, we only put ints, Strings, and Parcelables in, so it's fine for now.
            if (!mBundle.get(key).equals(otherBundle.get(key))) {
                return false;
            }
        }
        return true;
    }

    RadioMetadata() {
        mBundle = new Bundle();
    }
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ android_test {
        "compatibility-device-util-axt",
        "androidx.test.rules",
        "testng",
        "services.core",
    ],
    libs: ["android.test.base"],
    srcs: ["src/**/*.java"],
Loading