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

Commit d22e37ac authored by Jaewan Kim's avatar Jaewan Kim
Browse files

Treat empty subrating as the same as null subratings.

Change-Id: Ic288c680c639ccba6cf593d1286776a6c891b726
parent 328e679b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1427,6 +1427,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");
        }
@@ -1471,7 +1474,7 @@ public final class TvContentRating {
        mDomain = domain;
        mRatingSystem = ratingSystem;
        mRating = rating;
        mSubRatings = subRatings;
        mSubRatings = (subRatings == null || subRatings.length == 0) ? null : subRatings;
    }

    /**
@@ -1550,6 +1553,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) {