1e16873467cda89d905027458e2664c759465d463Sungsoo Lim/*
2e16873467cda89d905027458e2664c759465d463Sungsoo Lim * Copyright (C) 2014 The Android Open Source Project
3e16873467cda89d905027458e2664c759465d463Sungsoo Lim *
4e16873467cda89d905027458e2664c759465d463Sungsoo Lim * Licensed under the Apache License, Version 2.0 (the "License");
5e16873467cda89d905027458e2664c759465d463Sungsoo Lim * you may not use this file except in compliance with the License.
6e16873467cda89d905027458e2664c759465d463Sungsoo Lim * You may obtain a copy of the License at
7e16873467cda89d905027458e2664c759465d463Sungsoo Lim *
8e16873467cda89d905027458e2664c759465d463Sungsoo Lim *      http://www.apache.org/licenses/LICENSE-2.0
9e16873467cda89d905027458e2664c759465d463Sungsoo Lim *
10e16873467cda89d905027458e2664c759465d463Sungsoo Lim * Unless required by applicable law or agreed to in writing, software
11e16873467cda89d905027458e2664c759465d463Sungsoo Lim * distributed under the License is distributed on an "AS IS" BASIS,
12e16873467cda89d905027458e2664c759465d463Sungsoo Lim * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13e16873467cda89d905027458e2664c759465d463Sungsoo Lim * See the License for the specific language governing permissions and
14e16873467cda89d905027458e2664c759465d463Sungsoo Lim * limitations under the License.
15e16873467cda89d905027458e2664c759465d463Sungsoo Lim */
16e16873467cda89d905027458e2664c759465d463Sungsoo Lim
17e16873467cda89d905027458e2664c759465d463Sungsoo Limpackage android.media.tv;
18e16873467cda89d905027458e2664c759465d463Sungsoo Lim
19de08be8f79ea40f3dffae9edff4227704a5c0a3aJae Seoimport android.annotation.NonNull;
206057102dbb746593a7d59cf377c969b62e38c664Jae Seoimport android.annotation.SystemApi;
21e16873467cda89d905027458e2664c759465d463Sungsoo Limimport android.text.TextUtils;
22e16873467cda89d905027458e2664c759465d463Sungsoo Lim
23de08be8f79ea40f3dffae9edff4227704a5c0a3aJae Seoimport com.android.internal.util.Preconditions;
24de08be8f79ea40f3dffae9edff4227704a5c0a3aJae Seo
25e16873467cda89d905027458e2664c759465d463Sungsoo Limimport java.util.Arrays;
266057102dbb746593a7d59cf377c969b62e38c664Jae Seoimport java.util.Collections;
27e16873467cda89d905027458e2664c759465d463Sungsoo Limimport java.util.List;
281681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Limimport java.util.Objects;
29e16873467cda89d905027458e2664c759465d463Sungsoo Lim
30e16873467cda89d905027458e2664c759465d463Sungsoo Lim/**
31ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * A class representing a TV content rating. When a TV input service inserts the content rating
32ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * information on a program into the database, this class can be used to generate the formatted
33ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * string for
34ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * {@link TvContract.Programs#COLUMN_CONTENT_RATING TvContract.Programs.COLUMN_CONTENT_RATING}.
35ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * To create a {@code TvContentRating} object, use the
36ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * {@link #createRating TvContentRating.createRating} method with valid rating system string
37ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * constants.
380610e12733875a267f59d87a2a68aebbf486066eDongwon Kang *
390610e12733875a267f59d87a2a68aebbf486066eDongwon Kang * <p>It is possible for an application to define its own content rating system by supplying a
400610e12733875a267f59d87a2a68aebbf486066eDongwon Kang * content rating system definition XML resource (see example below) and declaring a broadcast
410610e12733875a267f59d87a2a68aebbf486066eDongwon Kang * receiver that filters {@link TvInputManager#ACTION_QUERY_CONTENT_RATING_SYSTEMS} in its manifest.
420610e12733875a267f59d87a2a68aebbf486066eDongwon Kang *
43fc27d6db089d25ab752c0445016fd07760c345f8Jae Seo * <h3> Example: Rating system definition for the TV Parental Guidelines</h3>
44ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * The following XML example shows how the TV Parental Guidelines in the United States can be
45ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * defined:
465c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim * <p><pre class="prettyprint">
47fc27d6db089d25ab752c0445016fd07760c345f8Jae Seo * {@literal
4814355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo * <rating-system-definitions xmlns:android="http://schemas.android.com/apk/res/android"
4914355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *     android:versionCode="1">
5014355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *     <rating-system-definition android:name="US_TV"
510a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *         android:country="US"
520a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *         android:description="@string/description_us_tv">
5314355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <sub-rating-definition android:name="US_TV_D"
5414355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="D"
550a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_d" />
5614355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <sub-rating-definition android:name="US_TV_L"
5714355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="L"
580a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_l" />
5914355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <sub-rating-definition android:name="US_TV_S"
6014355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="S"
610a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_s" />
6214355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <sub-rating-definition android:name="US_TV_V"
6314355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="V"
640a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_v" />
6514355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <sub-rating-definition android:name="US_TV_FV"
6614355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="FV"
670a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_fv" />
68fc27d6db089d25ab752c0445016fd07760c345f8Jae Seo *
6914355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <rating-definition android:name="US_TV_Y"
7014355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="TV-Y"
710a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_y"
720a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:icon="@drawable/icon_us_tv_y"
730a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:contentAgeHint="0" />
7414355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <rating-definition android:name="US_TV_Y7"
7514355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="TV-Y7"
760a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_y7"
770a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:icon="@drawable/icon_us_tv_y7"
780a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:contentAgeHint="7">
7914355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_FV" />
80fc27d6db089d25ab752c0445016fd07760c345f8Jae Seo *         </rating-definition>
8114355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <rating-definition android:name="US_TV_G"
8214355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="TV-G"
830a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_g"
840a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:icon="@drawable/icon_us_tv_g"
850a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:contentAgeHint="0" />
8614355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <rating-definition android:name="US_TV_PG"
8714355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="TV-PG"
880a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_pg"
890a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:icon="@drawable/icon_us_tv_pg"
900a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:contentAgeHint="14">
9114355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_D" />
9214355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_L" />
9314355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_S" />
9414355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_V" />
95fc27d6db089d25ab752c0445016fd07760c345f8Jae Seo *         </rating-definition>
9614355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <rating-definition android:name="US_TV_14"
9714355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="TV-14"
980a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_14"
990a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:icon="@drawable/icon_us_tv_14"
1000a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:contentAgeHint="14">
10114355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_D" />
10214355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_L" />
10314355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_S" />
10414355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_V" />
105fc27d6db089d25ab752c0445016fd07760c345f8Jae Seo *         </rating-definition>
10614355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <rating-definition android:name="US_TV_MA"
10714355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             android:title="TV-MA"
1080a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:description="@string/description_us_tv_ma"
1090a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:icon="@drawable/icon_us_tv_ma"
1100a514c0a87fe3f3a7a8ed973f68c2fc23d242bafJae Seo *             android:contentAgeHint="17">
11114355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_L" />
11214355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_S" />
11314355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <sub-rating android:name="US_TV_V" />
114fc27d6db089d25ab752c0445016fd07760c345f8Jae Seo *         </rating-definition>
11514355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <rating-order>
11614355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <rating android:name="US_TV_Y" />
11714355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <rating android:name="US_TV_Y7" />
11814355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         </rating-order>
11914355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         <rating-order>
12014355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <rating android:name="US_TV_G" />
12114355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <rating android:name="US_TV_PG" />
12214355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <rating android:name="US_TV_14" />
12314355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *             <rating android:name="US_TV_MA" />
12414355950d5ce42b8043cfb96d192f1c76b93d496Jae Seo *         </rating-order>
125fc27d6db089d25ab752c0445016fd07760c345f8Jae Seo *     </rating-system-definition>
1260610e12733875a267f59d87a2a68aebbf486066eDongwon Kang * </rating-system-definitions>}</pre>
1275c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *
1285c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim * <h3>System defined rating strings</h3>
129ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * The following strings are defined by the system to provide a standard way to create
130ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * {@code TvContentRating} objects.
1310610e12733875a267f59d87a2a68aebbf486066eDongwon Kang *
132ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <p>For example, to create an object that represents TV-PG rating with suggestive dialogue and
133ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * coarse language from the TV Parental Guidelines in the United States, one can use the following
134ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * code snippet:
1350610e12733875a267f59d87a2a68aebbf486066eDongwon Kang *
136ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <pre>
137b417c9d0e2819e1108b2c3e8dd7c8ea8eae57e6fJae Seo * TvContentRating rating = TvContentRating.createRating(
138ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         "com.android.tv",
139ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         "US_TV",
140ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         "US_TV_PG",
141ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         "US_TV_D", "US_TV_L");
142ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * </pre>
143ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <h4>System defined string for domains</h4>
144ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <table>
145ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *     <tr>
146ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         <th>Constant Value</th>
14751374011a85e7f5860766c4f56cd73ff39e77528Andrew Jeon *         <th>Description</th>
148ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *     </tr>
149ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *     <tr>
150ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         <td>com.android.tv</td>
1515c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *         <td>Used for creating system defined content ratings</td>
1525c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
1535c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim * </table>
15498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *
155ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <h4>System defined strings for rating systems</h4>
156ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <table>
1575c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
158ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         <th>Constant Value</th>
15951374011a85e7f5860766c4f56cd73ff39e77528Andrew Jeon *         <th>Description</th>
1605c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
16198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
162e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *         <td>AR_TV</td>
1631d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>TV content rating system for Argentina</td>
16498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
1651fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     <tr>
166e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *         <td>AU_TV</td>
1671d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>TV content rating system for Australia</td>
1681fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     </tr>
16998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
170e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *         <td>BR_TV</td>
1711d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>TV content rating system for Brazil</td>
17298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
17398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
17414287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_EN</td>
17514287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>TV content rating system for Canada (English)</td>
17614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
17714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
17814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_FR</td>
17914287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>TV content rating system for Canada (French)</td>
18014287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
18114287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
182d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB</td>
183d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB content rating system</td>
18498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
18598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
186d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB</td>
187d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB content rating system for Spain</td>
18898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
18998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
190d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB</td>
191d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB content rating system for France</td>
19298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
19398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
194d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB</td>
195d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB content rating system</td>
196fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     </tr>
197fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     <tr>
1985c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *         <td>KR_TV</td>
1991d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>TV content rating system for South Korea</td>
2005c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
20198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
2023652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>SG_TV</td>
2031d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>TV content rating system for Singapore</td>
20498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
20598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
20614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>US_MV</td>
20714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Movie content rating system for the United States</td>
20814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
20914287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
2101d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV</td>
211ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         <td>TV content rating system for the United States</td>
212e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *     </tr>
2135c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim * </table>
2145c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *
215ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <h4>System defined strings for ratings</h4>
216ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <table>
2175c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
218ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         <th>Rating System</th>
219ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         <th>Constant Value</th>
22051374011a85e7f5860766c4f56cd73ff39e77528Andrew Jeon *         <th>Description</th>
2215c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
22298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
2231d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td valign="top" rowspan="4">AR_TV</td>
224d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>AR_TV_ATP</td>
22598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Suitable for all audiences. Programs may contain mild violence, language and mature
2261d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         situations</td>
22798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
22898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
229d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>AR_TV_SAM_13</td>
23098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Suitable for ages 13 and up. Programs may contain mild to moderate language and mild
2311d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         violence and sexual references</td>
23298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
23398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
234d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>AR_TV_SAM_16</td>
23598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Suitable for ages 16 and up. Programs may contain more intensive violence and coarse
2361d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         language, partial nudity and moderate sexual references</td>
23798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
23898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
239d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>AR_TV_SAM_18</td>
24098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Suitable for mature audiences only. Programs contain strong violence, coarse language
2411d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         and explicit sexual references</td>
24298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
2431fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     <tr>
244d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td valign="top" rowspan="8">AU_TV</td>
245d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>AU_TV_P</td>
246d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for younger children aged between 2 and 11 years</td>
247d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *     </tr>
248d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *     <tr>
249d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>AU_TV_C</td>
250d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for older children aged between 5 and 14 years</td>
2511fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     </tr>
2521fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     <tr>
2531fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *         <td>AU_TV_G</td>
254d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for all ages</td>
2551fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     </tr>
2561fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     <tr>
2571fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *         <td>AU_TV_PG</td>
258d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Parental guidance is recommended for young viewers under 15</td>
2591fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     </tr>
2601fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     <tr>
2611fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *         <td>AU_TV_M</td>
262d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for mature audiences aged 15 years and over</td>
2631fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     </tr>
2641fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     <tr>
265d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>AU_TV_MA</td>
266d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Not suitable for children and teens under 15, due to sexual descriptions, course
267d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         language, adult themes or drug use</td>
2681fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     </tr>
2691fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     <tr>
270d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>AU_TV_AV</td>
271d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Not suitable for children and teens under 15. This category is used specifically for
272d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         violent programs</td>
27398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
27498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
275d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>AU_TV_R</td>
276d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Not for children under 18. Content may include graphic violence, sexual situations,
277d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         coarse language and explicit drug use</td>
2781fd38bd99610d7dc2a9c335ae2af4089fe1006a1Sungsoo Lim *     </tr>
279b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     <tr>
2801d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td valign="top" rowspan="6">BR_TV</td>
281b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *         <td>BR_TV_L</td>
28298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Content is suitable for all audiences</td>
283b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     </tr>
284b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     <tr>
285b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *         <td>BR_TV_10</td>
28698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Content suitable for viewers over the age of 10</td>
287b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     </tr>
288b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     <tr>
289b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *         <td>BR_TV_12</td>
29098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Content suitable for viewers over the age of 12</td>
291b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     </tr>
292b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     <tr>
293b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *         <td>BR_TV_14</td>
29498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Content suitable for viewers over the age of 14</td>
295b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     </tr>
296b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     <tr>
297b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *         <td>BR_TV_16</td>
29898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Content suitable for viewers over the age of 16</td>
299b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     </tr>
300b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     <tr>
301b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *         <td>BR_TV_18</td>
30298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Content suitable for viewers over the age of 18</td>
30398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
30498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
30514287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td valign="top" rowspan="7">CA_TV_EN</td>
30614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_EN_EXEMPT</td>
30714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Exempt from ratings</td>
30814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
30914287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
31014287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_EN_C</td>
31114287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Suitable for children ages 2&#8211;7</td>
31214287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
31314287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
31414287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_EN_C8</td>
31514287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Suitable for children ages 8 and older</td>
31614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
31714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
31814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_EN_G</td>
31914287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Suitable for the entire family</td>
32014287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
32114287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
32214287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_EN_PG</td>
32314287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>May contain moderate violence, profanity, nudity, and sexual references</td>
32414287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
32514287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
32614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_EN_14</td>
32714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Intended for viewers ages 14 and older</td>
32814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
32914287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
33014287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_EN_18</td>
33114287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Intended for viewers ages 18 and older</td>
33214287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
33314287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
33414287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td valign="top" rowspan="6">CA_TV_FR</td>
33514287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_FR_E</td>
33614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Exempt from ratings</td>
33714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
33814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
33914287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_FR_G</td>
34014287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Appropriate for all ages</td>
34114287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
34214287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
34314287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_FR_8</td>
34414287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Appropriate for children 8</td>
34514287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
34614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
34714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_FR_13</td>
34814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Suitable for children 13</td>
34914287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
35014287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
35114287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_FR_16</td>
35214287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Recommended for children over the age of 16</td>
35314287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
35414287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
35514287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>CA_TV_FR_18</td>
35614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Only to be viewed by adults</td>
35714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
35814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
359d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td valign="top" rowspan="15">DVB</td>
360d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_4</td>
361d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 4 and over</td>
36298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
36398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
364d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_5</td>
365d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 5 and over</td>
36698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
36798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
368d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_6</td>
369d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 6 and over</td>
37098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
37198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
372d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_7</td>
373d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 7 and over</td>
37498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
37598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
376d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_8</td>
377d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 8 and over</td>
378b4bbfbcef3dec8f0de13a6ee474858f3a3cd535dSungsoo Lim *     </tr>
37998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
380d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_9</td>
381d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 9 and over</td>
38298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
38398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
384d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_10</td>
385d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 10 and over</td>
38698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
38798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
388d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_11</td>
389d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 11 and over</td>
39098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
39198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
392d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_12</td>
393d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 12 and over</td>
39498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
39598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
396d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_13</td>
397d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 13 and over</td>
39898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
39998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
400d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_14</td>
401d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 14 and over</td>
40298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
40398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
404d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_15</td>
405d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 15 and over</td>
40698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
40798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
408d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_16</td>
409d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 16 and over</td>
41098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
41198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
412d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_17</td>
413d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 17 and over</td>
41498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
41598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
416d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>DVB_18</td>
417d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 18 and over</td>
41898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
4196b444eed2cbc6b124c9cfabb47fd924d7a55aa99Sungsoo Lim *     <tr>
420d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td valign="top" rowspan="18">ES_DVB</td>
421d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_ALL</td>
42298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Recommended for all ages</td>
423b1caf4d8178be53b432399747b5114275c200e43Dongwon Kang *     </tr>
424b1caf4d8178be53b432399747b5114275c200e43Dongwon Kang *     <tr>
425d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_C</td>
426d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for children</td>
427b1caf4d8178be53b432399747b5114275c200e43Dongwon Kang *     </tr>
428b1caf4d8178be53b432399747b5114275c200e43Dongwon Kang *     <tr>
429d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_X</td>
430d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for adults</td>
431b1caf4d8178be53b432399747b5114275c200e43Dongwon Kang *     </tr>
432b1caf4d8178be53b432399747b5114275c200e43Dongwon Kang *     <tr>
433d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_4</td>
434d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 4 and over</td>
43598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
43698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
437d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_5</td>
438d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 5 and over</td>
43998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
44098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
441d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_6</td>
442d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 6 and over</td>
44398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
44498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
445d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_7</td>
446d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 7 and over</td>
44798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
44898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
449d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_8</td>
450d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 8 and over</td>
45198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
45298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
453d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_9</td>
454d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 9 and over</td>
455b1caf4d8178be53b432399747b5114275c200e43Dongwon Kang *     </tr>
4564acc7c3f4e1d63e702b9a4782b01e4a4ef152e71Sungsoo Lim *     <tr>
457d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_10</td>
458d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 10 and over</td>
4594acc7c3f4e1d63e702b9a4782b01e4a4ef152e71Sungsoo Lim *     </tr>
4604acc7c3f4e1d63e702b9a4782b01e4a4ef152e71Sungsoo Lim *     <tr>
461d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_11</td>
462d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 11 and over</td>
4634acc7c3f4e1d63e702b9a4782b01e4a4ef152e71Sungsoo Lim *     </tr>
4644acc7c3f4e1d63e702b9a4782b01e4a4ef152e71Sungsoo Lim *     <tr>
465d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_12</td>
466d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 12 and over</td>
4674acc7c3f4e1d63e702b9a4782b01e4a4ef152e71Sungsoo Lim *     </tr>
4684acc7c3f4e1d63e702b9a4782b01e4a4ef152e71Sungsoo Lim *     <tr>
469d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_13</td>
470d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 13 and over</td>
4714acc7c3f4e1d63e702b9a4782b01e4a4ef152e71Sungsoo Lim *     </tr>
4724acc7c3f4e1d63e702b9a4782b01e4a4ef152e71Sungsoo Lim *     <tr>
473d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_14</td>
474d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 14 and over</td>
47598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
47698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
477d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_15</td>
478d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 15 and over</td>
47998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
48098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
481d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_16</td>
482d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 16 and over</td>
48398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
48498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
485d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_17</td>
486d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 17 and over</td>
48798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
48898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
489d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ES_DVB_18</td>
490d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 18 and over</td>
49198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
49298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
493d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td valign="top" rowspan="16">FR_DVB</td>
494d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_U</td>
495d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for all ages</td>
49698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
49798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
498d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_4</td>
499d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 4 and over</td>
50098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
50198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
502d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_5</td>
503d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 5 and over</td>
50498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
50598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
506d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_6</td>
507d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 6 and over</td>
50898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
50998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
510d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_7</td>
511d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 7 and over</td>
51298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
51398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
514d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_8</td>
515d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 8 and over</td>
51698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
51798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
518d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_9</td>
519d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 9 and over</td>
52098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
52198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
522d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_10</td>
523d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 10 and over</td>
52498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
52598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
526d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_11</td>
527d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 11 and over</td>
52898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
52998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
530d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_12</td>
531d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 12 and over</td>
532e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *     </tr>
533e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *     <tr>
534d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_13</td>
535d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 13 and over</td>
53698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
53798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
538d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_14</td>
539d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 14 and over</td>
54098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
54198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
542d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_15</td>
543d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 15 and over</td>
54498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
54598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
546d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_16</td>
547d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 16 and over</td>
54898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
54998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
550d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_17</td>
551d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 17 and over</td>
55298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
55398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
554d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>FR_DVB_18</td>
555d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 18 and over</td>
55698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
55798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
558d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td valign="top" rowspan="17">ISDB</td>
559d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_4</td>
560d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 4 and over</td>
56198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
56298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
563d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_5</td>
564d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 5 and over</td>
56598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
56698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
567d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_6</td>
568d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 6 and over</td>
56998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
57098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
571d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_7</td>
572d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 7 and over</td>
57398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
57498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
575d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_8</td>
576d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 8 and over</td>
57798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
57898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
579d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_9</td>
580d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 9 and over</td>
581e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *     </tr>
582e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *     <tr>
583d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_10</td>
584d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 10 and over</td>
58598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
58698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
587d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_11</td>
588d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 11 and over</td>
58998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
59098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
591d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_12</td>
592d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 12 and over</td>
59398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
59498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
595d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_13</td>
596d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 13 and over</td>
59798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
59898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
599d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_14</td>
600d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 14 and over</td>
60198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
60298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
603d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_15</td>
604d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 15 and over</td>
60598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
60698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
607d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_16</td>
608d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 16 and over</td>
60998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
61098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
611d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_17</td>
612d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 17 and over</td>
613fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     </tr>
614fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     <tr>
615d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_18</td>
616d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 18 and over</td>
617fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     </tr>
618fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     <tr>
619d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_19</td>
620d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 19 and over</td>
621fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     </tr>
622fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     <tr>
623d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>ISDB_20</td>
624d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Recommended for ages 20 and over</td>
625fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     </tr>
626fe5998b5add1e96eafd5583528bfc8d9874a4123Jae Seo *     <tr>
6271d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td valign="top" rowspan="5">KR_TV</td>
628b2835e2700a200b368a8247739648601d79e2b06Jae Seo *         <td>KR_TV_ALL</td>
62998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Appropriate for all ages</td>
63098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
63198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
63298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>KR_TV_7</td>
63398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>May contain material inappropriate for children younger than 7, and parental
6341d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         discretion should be used</td>
63598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
63698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
637e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *         <td>KR_TV_12</td>
63898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>May deemed inappropriate for those younger than 12, and parental discretion should be
6391d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         used</td>
640e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *     </tr>
641e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *     <tr>
642e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *         <td>KR_TV_15</td>
64398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>May be inappropriate for children under 15, and that parental discretion should be
6441d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         used</td>
645e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *     </tr>
646e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *     <tr>
647e6dca2cfa4eecd3a45792703b722fc3ef86e8744Sungsoo Lim *         <td>KR_TV_19</td>
64898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>For adults only</td>
64998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
65098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
6513652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td valign="top" rowspan="6">SG_TV</td>
6523652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>SG_TV_G</td>
6533652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>Suitable for all ages</td>
6543652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *     </tr>
6553652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *     <tr>
6563652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>SG_TV_PG</td>
6573652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>Suitable for all but parents should guide their young</td>
6583652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *     </tr>
6593652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *     <tr>
6603652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>SG_TV_PG13</td>
6613652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>Suitable for persons aged 13 and above but parental guidance is advised for children
6623652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         below 13</td>
66398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
66498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
6653652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>SG_TV_NC16</td>
6663652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>Suitable for persons aged 16 and above</td>
66798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
66898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
6693652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>SG_TV_M18</td>
6703652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>Suitable for persons aged 18 and above</td>
67198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
67298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
6733652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>SG_TV_R21</td>
6743652e1d8b879fd8e96e8f4e09cefea3c05aa4857Jae Seo *         <td>Suitable for adults aged 21 and above</td>
67598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
67698ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
67714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td valign="top" rowspan="5">US_MV</td>
67814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>US_MV_G</td>
67914287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>General audiences</td>
68014287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
68114287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
68214287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>US_MV_PG</td>
68314287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Parental guidance suggested</td>
68414287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
68514287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
68614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>US_MV_PG13</td>
68714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Parents strongly cautioned</td>
68814287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
68914287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
69014287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>US_MV_R</td>
69114287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>Restricted, under 17 requires accompanying parent or adult guardian</td>
69214287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
69314287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
69414287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>US_MV_NC17</td>
69514287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *         <td>No one 17 and under admitted</td>
69614287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     </tr>
69714287c8d2deaa2c27024549779fab45841cbb5e3Jae Seo *     <tr>
6981d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td valign="top" rowspan="6">US_TV</td>
6991d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_Y</td>
70098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>This program is designed to be appropriate for all children</td>
7015c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7025c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7031d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_Y7</td>
70498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>This program is designed for children age 7 and above</td>
7055c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7065c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7071d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_G</td>
70898ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>Most parents would find this program suitable for all ages</td>
7095c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7105c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7111d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_PG</td>
71298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>This program contains material that parents may find unsuitable for younger children
71398ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         </td>
7145c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7155c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7161d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_14</td>
71798ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>This program contains some material that many parents would find unsuitable for
7181d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         children under 14 years of age</td>
7195c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7205c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7211d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_MA</td>
72298ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *         <td>This program is specifically designed to be viewed by adults and therefore may be
7231d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         unsuitable for children under 17</td>
72498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
7255c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim * </table>
7265c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *
727ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <h4>System defined strings for sub-ratings</h4>
728ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo * <table>
7295c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
730ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         <th>Rating System</th>
731ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo *         <th>Constant Value</th>
73251374011a85e7f5860766c4f56cd73ff39e77528Andrew Jeon *         <th>Description</th>
7335c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7343596a9645eae5636706d6d76b3d0e321c3d5c11fSungsoo Lim *     <tr>
735d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td valign="top" rowspan="3">BR_TV</td>
736d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>BR_TV_D</td>
737d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Drugs<br/>Applicable to BR_TV_L, BR_TV_10, BR_TV_12, BR_TV_14, BR_TV_16, and BR_TV_18
738d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         </td>
73998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
74098ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
741d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>BR_TV_S</td>
742d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Sex<br/>Applicable to BR_TV_L, BR_TV_10, BR_TV_12, BR_TV_14, BR_TV_16, and BR_TV_18
743d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         </td>
74498ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
74598ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     <tr>
746d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>BR_TV_V</td>
747d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Violence<br/>Applicable to BR_TV_L, BR_TV_10, BR_TV_12, BR_TV_14, BR_TV_16, and
748d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         BR_TV_18</td>
74998ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
7505c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7511d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td valign="top" rowspan="5">US_TV</td>
7521d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_D</td>
753d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Suggestive dialogue (Usually means talks about sex)<br/>Applicable to US_TV_PG, and
754d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         US_TV_14</td>
7555c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7565c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7571d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_L</td>
758d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Coarse language<br/>Applicable to US_TV_PG, US_TV_14, and US_TV_MA</td>
7595c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7605c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7611d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_S</td>
762d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Sexual content<br/>Applicable to US_TV_PG, US_TV_14, and US_TV_MA</td>
7635c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7645c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7651d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_V</td>
766d3f17921bde06c0bd164f0abf0e99dafc7c0c569Sungsoo Lim *         <td>Violence<br/>Applicable to US_TV_PG, US_TV_14, and US_TV_MA</td>
7675c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     </tr>
7685c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim *     <tr>
7691d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>US_TV_FV</td>
7701d1164012740a486b3074b50d8d2a9c452dbfeccSungsoo Lim *         <td>Fantasy violence (Children's programming only)<br/>Applicable to US_TV_Y7</td>
77198ea5fa8e4a99433da0c32273674af189c65f14bSungsoo Lim *     </tr>
7725c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim * </table>
773e16873467cda89d905027458e2664c759465d463Sungsoo Lim */
7746057102dbb746593a7d59cf377c969b62e38c664Jae Seopublic final class TvContentRating {
7755c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    // TODO: Consider to use other DELIMITER. In some countries such as India may use this delimiter
7765c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    // in the main ratings.
7775c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    private static final String DELIMITER = "/";
778e16873467cda89d905027458e2664c759465d463Sungsoo Lim
7795c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    private final String mDomain;
7805c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    private final String mRatingSystem;
7815c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    private final String mRating;
7825c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    private final String[] mSubRatings;
7831681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim    private final int mHashCode;
784e16873467cda89d905027458e2664c759465d463Sungsoo Lim
785e16873467cda89d905027458e2664c759465d463Sungsoo Lim    /**
786936c040ec445afad98ec16fc634ae6573eceefbbJae Seo     * Rating constant denoting unrated content. Used to handle the case where the content rating
787936c040ec445afad98ec16fc634ae6573eceefbbJae Seo     * information is missing.
788936c040ec445afad98ec16fc634ae6573eceefbbJae Seo     *
789936c040ec445afad98ec16fc634ae6573eceefbbJae Seo     * <p>TV input services can call {@link TvInputManager#isRatingBlocked} with this constant to
790936c040ec445afad98ec16fc634ae6573eceefbbJae Seo     * determine whether they should block unrated content. The subsequent call to
791936c040ec445afad98ec16fc634ae6573eceefbbJae Seo     * {@link TvInputService.Session#notifyContentBlocked} with the same constant notifies
792936c040ec445afad98ec16fc634ae6573eceefbbJae Seo     * applications that the current program content is blocked by parental controls.
7937843e10e606c5d6402e2e69840f92e3bc85dbd2cJae Seo     */
794936c040ec445afad98ec16fc634ae6573eceefbbJae Seo    public static final TvContentRating UNRATED = new TvContentRating("null", "null", "null", null);
7957843e10e606c5d6402e2e69840f92e3bc85dbd2cJae Seo
7967843e10e606c5d6402e2e69840f92e3bc85dbd2cJae Seo    /**
797ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * Creates a {@code TvContentRating} object with predefined content rating strings.
7985c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim     *
799ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @param domain The domain string. For example, "com.android.tv".
800ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @param ratingSystem The rating system string. For example, "US_TV".
801ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @param rating The content rating string. For example, "US_TV_PG".
802ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @param subRatings The sub-rating strings. For example, "US_TV_D" and "US_TV_L".
803ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @return A {@code TvContentRating} object.
804ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @throws IllegalArgumentException If {@code domain}, {@code ratingSystem} or {@code rating} is
805ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     *             {@code null}.
806e16873467cda89d905027458e2664c759465d463Sungsoo Lim     */
807732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim    public static TvContentRating createRating(String domain, String ratingSystem,
808732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim            String rating, String... subRatings) {
8095c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        if (TextUtils.isEmpty(domain)) {
8105c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim            throw new IllegalArgumentException("domain cannot be empty");
8115c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        }
812d22e37acac3a83199423692671e2b20050088426Jaewan Kim        if (TextUtils.isEmpty(ratingSystem)) {
813d22e37acac3a83199423692671e2b20050088426Jaewan Kim            throw new IllegalArgumentException("ratingSystem cannot be empty");
814d22e37acac3a83199423692671e2b20050088426Jaewan Kim        }
8155c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        if (TextUtils.isEmpty(rating)) {
8165c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim            throw new IllegalArgumentException("rating cannot be empty");
8175c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        }
818732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim        return new TvContentRating(domain, ratingSystem, rating, subRatings);
819e16873467cda89d905027458e2664c759465d463Sungsoo Lim    }
820e16873467cda89d905027458e2664c759465d463Sungsoo Lim
821e16873467cda89d905027458e2664c759465d463Sungsoo Lim    /**
822ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * Recovers a {@code TvContentRating} object from the string that was previously created from
8235c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim     * {@link #flattenToString}.
824e16873467cda89d905027458e2664c759465d463Sungsoo Lim     *
825ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @param ratingString The string returned by {@link #flattenToString}.
826ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @return the {@code TvContentRating} object containing the domain, rating system, rating and
827ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     *         sub-ratings information encoded in {@code ratingString}.
8285c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim     * @see #flattenToString
829e16873467cda89d905027458e2664c759465d463Sungsoo Lim     */
8305c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    public static TvContentRating unflattenFromString(String ratingString) {
8315c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        if (TextUtils.isEmpty(ratingString)) {
8325c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim            throw new IllegalArgumentException("ratingString cannot be empty");
8335c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        }
8345c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        String[] strs = ratingString.split(DELIMITER);
835732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim        if (strs.length < 3) {
8365c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim            throw new IllegalArgumentException("Invalid rating string: " + ratingString);
8375c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        }
838732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim        if (strs.length > 3) {
839732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim            String[] subRatings = new String[strs.length - 3];
840732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim            System.arraycopy(strs, 3, subRatings, 0, subRatings.length);
841732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim            return new TvContentRating(strs[0], strs[1], strs[2], subRatings);
8425c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        }
843732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim        return new TvContentRating(strs[0], strs[1], strs[2], null);
844e16873467cda89d905027458e2664c759465d463Sungsoo Lim    }
845e16873467cda89d905027458e2664c759465d463Sungsoo Lim
846e16873467cda89d905027458e2664c759465d463Sungsoo Lim    /**
847e16873467cda89d905027458e2664c759465d463Sungsoo Lim     * Constructs a TvContentRating object from a given rating and sub-rating constants.
848e16873467cda89d905027458e2664c759465d463Sungsoo Lim     *
849ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @param domain The string for domain of the content rating system such as "com.android.tv".
850ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @param ratingSystem The rating system string such as "US_TV".
851ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @param rating The content rating string such as "US_TV_PG".
852ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @param subRatings The sub-rating strings such as "US_TV_D" and "US_TV_L".
853e16873467cda89d905027458e2664c759465d463Sungsoo Lim     */
854732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim    private TvContentRating(
855732be11cefc439ea47a6c9cced6ab240aa5f1ea9Sungsoo Lim            String domain, String ratingSystem, String rating, String[] subRatings) {
8565c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        mDomain = domain;
8575c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        mRatingSystem = ratingSystem;
8586057102dbb746593a7d59cf377c969b62e38c664Jae Seo        mRating = rating;
8591681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        if (subRatings == null || subRatings.length == 0) {
8601681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim            mSubRatings = null;
8611681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        } else {
8621681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim            Arrays.sort(subRatings);
8631681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim            mSubRatings = subRatings;
8641681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        }
865a9a29a29e55380ebd30175a75b285b16201002b6Sungsoo Lim        mHashCode = 31 * Objects.hash(mDomain, mRating) + Arrays.hashCode(mSubRatings);
866e16873467cda89d905027458e2664c759465d463Sungsoo Lim    }
867e16873467cda89d905027458e2664c759465d463Sungsoo Lim
868e16873467cda89d905027458e2664c759465d463Sungsoo Lim    /**
869ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * Returns the domain of this {@code TvContentRating} object.
8705c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim     */
8715c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    public String getDomain() {
8725c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        return mDomain;
8735c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    }
8745c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim
8755c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    /**
876ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * Returns the rating system of this {@code TvContentRating} object.
8775c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim     */
8785c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    public String getRatingSystem() {
8795c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        return mRatingSystem;
8805c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    }
8815c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim
8825c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim    /**
883ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * Returns the main rating of this {@code TvContentRating} object.
8846057102dbb746593a7d59cf377c969b62e38c664Jae Seo     */
8856057102dbb746593a7d59cf377c969b62e38c664Jae Seo    public String getMainRating() {
8866057102dbb746593a7d59cf377c969b62e38c664Jae Seo        return mRating;
8876057102dbb746593a7d59cf377c969b62e38c664Jae Seo    }
8886057102dbb746593a7d59cf377c969b62e38c664Jae Seo
8896057102dbb746593a7d59cf377c969b62e38c664Jae Seo    /**
890ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * Returns the unmodifiable sub-rating string {@link List} of this {@code TvContentRating}
891ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * object.
8926057102dbb746593a7d59cf377c969b62e38c664Jae Seo     */
8936057102dbb746593a7d59cf377c969b62e38c664Jae Seo    public List<String> getSubRatings() {
8946057102dbb746593a7d59cf377c969b62e38c664Jae Seo        if (mSubRatings == null) {
8956057102dbb746593a7d59cf377c969b62e38c664Jae Seo            return null;
8966057102dbb746593a7d59cf377c969b62e38c664Jae Seo        }
8976057102dbb746593a7d59cf377c969b62e38c664Jae Seo        return Collections.unmodifiableList(Arrays.asList(mSubRatings));
8986057102dbb746593a7d59cf377c969b62e38c664Jae Seo    }
8996057102dbb746593a7d59cf377c969b62e38c664Jae Seo
9006057102dbb746593a7d59cf377c969b62e38c664Jae Seo    /**
901ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * Returns a string that unambiguously describes the rating information contained in a
902ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * {@code TvContentRating} object. One can later recover the object from this string through
903ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * {@link #unflattenFromString}.
9046057102dbb746593a7d59cf377c969b62e38c664Jae Seo     *
905ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * @return a string containing the rating information, which can later be stored in the
906ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     *         database.
9076057102dbb746593a7d59cf377c969b62e38c664Jae Seo     * @see #unflattenFromString
9086057102dbb746593a7d59cf377c969b62e38c664Jae Seo     */
9096057102dbb746593a7d59cf377c969b62e38c664Jae Seo    public String flattenToString() {
9105c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        StringBuilder builder = new StringBuilder();
9115c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        builder.append(mDomain);
9125c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        builder.append(DELIMITER);
9135c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        builder.append(mRatingSystem);
9145c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        builder.append(DELIMITER);
9155c5b83fcd58d21c9ab7ac986bf84f604ec5bb4b5Sungsoo Lim        builder.append(mRating);
9166057102dbb746593a7d59cf377c969b62e38c664Jae Seo        if (mSubRatings != null) {
9176057102dbb746593a7d59cf377c969b62e38c664Jae Seo            for (String subRating : mSubRatings) {
9186057102dbb746593a7d59cf377c969b62e38c664Jae Seo                builder.append(DELIMITER);
9196057102dbb746593a7d59cf377c969b62e38c664Jae Seo                builder.append(subRating);
9206057102dbb746593a7d59cf377c969b62e38c664Jae Seo            }
9216057102dbb746593a7d59cf377c969b62e38c664Jae Seo        }
9226057102dbb746593a7d59cf377c969b62e38c664Jae Seo        return builder.toString();
9236057102dbb746593a7d59cf377c969b62e38c664Jae Seo    }
9246057102dbb746593a7d59cf377c969b62e38c664Jae Seo
9256057102dbb746593a7d59cf377c969b62e38c664Jae Seo    /**
926ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * Returns {@code true} if this rating has the same main rating as the specified rating and when
927ceb51abc74129f5c736ba5aa0400c45f1c4752acJae Seo     * this rating's sub-ratings contain the other's.
9280610e12733875a267f59d87a2a68aebbf486066eDongwon Kang     *
9290610e12733875a267f59d87a2a68aebbf486066eDongwon Kang     * <p>For example, a {@code TvContentRating} object that represents TV-PG with
9300610e12733875a267f59d87a2a68aebbf486066eDongwon Kang     * S(Sexual content) and V(Violence) contains TV-PG, TV-PG/S, TV-PG/V and itself.
9316057102dbb746593a7d59cf377c969b62e38c664Jae Seo     *
9326057102dbb746593a7d59cf377c969b62e38c664Jae Seo     * @param rating The {@link TvContentRating} to check.
9336057102dbb746593a7d59cf377c969b62e38c664Jae Seo     * @return {@code true} if this object contains {@code rating}, {@code false} otherwise.
9346057102dbb746593a7d59cf377c969b62e38c664Jae Seo     * @hide
935e16873467cda89d905027458e2664c759465d463Sungsoo Lim     */
9366057102dbb746593a7d59cf377c969b62e38c664Jae Seo    @SystemApi
937de08be8f79ea40f3dffae9edff4227704a5c0a3aJae Seo    public final boolean contains(@NonNull TvContentRating rating) {
938de08be8f79ea40f3dffae9edff4227704a5c0a3aJae Seo        Preconditions.checkNotNull(rating);
9396057102dbb746593a7d59cf377c969b62e38c664Jae Seo        if (!rating.getMainRating().equals(mRating)) {
9406057102dbb746593a7d59cf377c969b62e38c664Jae Seo            return false;
9416057102dbb746593a7d59cf377c969b62e38c664Jae Seo        }
942d22e37acac3a83199423692671e2b20050088426Jaewan Kim        if (!rating.getDomain().equals(mDomain) ||
943d22e37acac3a83199423692671e2b20050088426Jaewan Kim                !rating.getRatingSystem().equals(mRatingSystem) ||
944d22e37acac3a83199423692671e2b20050088426Jaewan Kim                !rating.getMainRating().equals(mRating)) {
945d22e37acac3a83199423692671e2b20050088426Jaewan Kim            return false;
946d22e37acac3a83199423692671e2b20050088426Jaewan Kim        }
9476057102dbb746593a7d59cf377c969b62e38c664Jae Seo        List<String> subRatings = getSubRatings();
9486057102dbb746593a7d59cf377c969b62e38c664Jae Seo        List<String> subRatingsOther = rating.getSubRatings();
9496057102dbb746593a7d59cf377c969b62e38c664Jae Seo        if (subRatings == null && subRatingsOther == null) {
9506057102dbb746593a7d59cf377c969b62e38c664Jae Seo            return true;
9516057102dbb746593a7d59cf377c969b62e38c664Jae Seo        } else if (subRatings == null && subRatingsOther != null) {
9526057102dbb746593a7d59cf377c969b62e38c664Jae Seo            return false;
9536057102dbb746593a7d59cf377c969b62e38c664Jae Seo        } else if (subRatings != null && subRatingsOther == null) {
9546057102dbb746593a7d59cf377c969b62e38c664Jae Seo            return true;
9556057102dbb746593a7d59cf377c969b62e38c664Jae Seo        } else {
9566057102dbb746593a7d59cf377c969b62e38c664Jae Seo            return subRatings.containsAll(subRatingsOther);
957e16873467cda89d905027458e2664c759465d463Sungsoo Lim        }
958e16873467cda89d905027458e2664c759465d463Sungsoo Lim    }
9591681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim
9601681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim    @Override
9611681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim    public boolean equals(Object obj) {
9621681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        if (!(obj instanceof TvContentRating)) {
9631681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim            return false;
9641681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        }
9651681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        TvContentRating other = (TvContentRating) obj;
9661681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        if (mHashCode != other.mHashCode) {
9671681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim            return false;
9681681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        }
9691681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        if (!TextUtils.equals(mDomain, other.mDomain)) {
9701681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim            return false;
9711681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        }
9721681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        if (!TextUtils.equals(mRatingSystem, other.mRatingSystem)) {
9731681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim            return false;
9741681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        }
9751681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        if (!TextUtils.equals(mRating, other.mRating)) {
9761681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim            return false;
9771681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        }
9781681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        return Arrays.equals(mSubRatings, other.mSubRatings);
9791681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim    }
9801681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim
9811681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim    @Override
9821681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim    public int hashCode() {
9831681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim        return mHashCode;
9841681ac0b690b8888858ab402742dd8eb285518d0Sungsoo Lim    }
985e16873467cda89d905027458e2664c759465d463Sungsoo Lim}
986