From 1e3defccf21196e2dd5adc37718a4307a3f76614 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 11 Oct 2018 15:15:46 +1300 Subject: [PATCH] accounts-service: Add support for oars-1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even though I can’t find a single copy of the specification or how it differs from oars-1.0; it allegedly exists. Signed-off-by: Philip Withnall https://phabricator.endlessm.com/T23999 --- .../com.endlessm.ParentalControls.AppFilter.xml | 4 ++-- libeos-parental-controls/app-filter.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/accounts-service/com.endlessm.ParentalControls.AppFilter.xml b/accounts-service/com.endlessm.ParentalControls.AppFilter.xml index 19f72db..af73110 100644 --- a/accounts-service/com.endlessm.ParentalControls.AppFilter.xml +++ b/accounts-service/com.endlessm.ParentalControls.AppFilter.xml @@ -41,7 +41,7 @@ It’s a two-tuple of the rating type, and a dictionary of rating sections and values. The type gives the rating scheme in use — currently only - `oars-1.0` is supported. + `oars-1.0` and `oars-1.1` are supported. Each dictionary entry is a mapping from an OARS section to the most severe value for it which the user is allowed to see (inclusive). Any @@ -57,7 +57,7 @@ --> + value="('oars-1.1', @a{ss} {})"/> diff --git a/libeos-parental-controls/app-filter.c b/libeos-parental-controls/app-filter.c index d42231e..6ec256b 100644 --- a/libeos-parental-controls/app-filter.c +++ b/libeos-parental-controls/app-filter.c @@ -403,13 +403,14 @@ get_app_filter_cb (GObject *obj, &content_rating_kind, &oars_variant)) { /* Default value. */ - content_rating_kind = "oars-1.0"; + content_rating_kind = "oars-1.1"; oars_variant = g_variant_new ("@a{ss} {}"); } /* Check that the OARS filter is in a format we support. Currently, that’s - * only oars-1.0. */ - if (!g_str_equal (content_rating_kind, "oars-1.0")) + * only oars-1.0 and oars-1.1. */ + if (!g_str_equal (content_rating_kind, "oars-1.0") && + !g_str_equal (content_rating_kind, "oars-1.1")) { g_task_return_new_error (task, EPC_APP_FILTER_ERROR, EPC_APP_FILTER_ERROR_INVALID_DATA,