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

Commit 22f7c476 authored by Jaewan Kim's avatar Jaewan Kim Committed by Android (Google) Code Review
Browse files

Merge "Treat empty subrating as the same as null subratings." into lmp-dev

parents 8a22f018 d22e37ac
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1425,6 +1425,9 @@ public final class TvContentRating {
        if (TextUtils.isEmpty(domain)) {
            throw new IllegalArgumentException("domain cannot be empty");
        }
        if (TextUtils.isEmpty(ratingSystem)) {
            throw new IllegalArgumentException("ratingSystem cannot be empty");
        }
        if (TextUtils.isEmpty(rating)) {
            throw new IllegalArgumentException("rating cannot be empty");
        }
@@ -1469,7 +1472,7 @@ public final class TvContentRating {
        mDomain = domain;
        mRatingSystem = ratingSystem;
        mRating = rating;
        mSubRatings = subRatings;
        mSubRatings = (subRatings == null || subRatings.length == 0) ? null : subRatings;
    }

    /**
@@ -1548,6 +1551,11 @@ public final class TvContentRating {
        if (!rating.getMainRating().equals(mRating)) {
            return false;
        }
        if (!rating.getDomain().equals(mDomain) ||
                !rating.getRatingSystem().equals(mRatingSystem) ||
                !rating.getMainRating().equals(mRating)) {
            return false;
        }
        List<String> subRatings = getSubRatings();
        List<String> subRatingsOther = rating.getSubRatings();
        if (subRatings == null && subRatingsOther == null) {