From 5769c403f44d565ebff8d2bbb886e0cdc5382489 Mon Sep 17 00:00:00 2001 From: atrost Date: Tue, 23 Jul 2019 18:04:47 +0100 Subject: [PATCH] Add a platform compat config schema API. As decribed in go/xsdc-for-partners. This defines the schema of the XML file generated by @ChangeId annotation processor. The schema requires unique ids. Test: Used https://www.freeformatter.com/xml-validator-xsd.html to validate an example config. Bug: 138222363 Change-Id: Iaf37e049ddd483c4fd7d512475614476ac6606a5 --- services/core/xsd/Android.bp | 8 +++ services/core/xsd/platform-compat-config.xsd | 51 +++++++++++++++++++ .../xsd/platform-compat-schema/current.txt | 31 +++++++++++ .../platform-compat-schema/last_current.txt | 0 .../platform-compat-schema/last_removed.txt | 0 .../xsd/platform-compat-schema/removed.txt | 1 + 6 files changed, 91 insertions(+) create mode 100644 services/core/xsd/platform-compat-config.xsd create mode 100644 services/core/xsd/platform-compat-schema/current.txt create mode 100644 services/core/xsd/platform-compat-schema/last_current.txt create mode 100644 services/core/xsd/platform-compat-schema/last_removed.txt create mode 100644 services/core/xsd/platform-compat-schema/removed.txt diff --git a/services/core/xsd/Android.bp b/services/core/xsd/Android.bp index 98e4343e6e573..8b2cbbde2db8a 100644 --- a/services/core/xsd/Android.bp +++ b/services/core/xsd/Android.bp @@ -4,3 +4,11 @@ xsd_config { api_dir: "schema", package_name: "com.android.server.pm.permission.configfile", } + + +xsd_config { + name: "platform-compat-config", + srcs: ["platform-compat-config.xsd"], + api_dir: "platform-compat-schema", + package_name: "com.android.server.compat.config", +} diff --git a/services/core/xsd/platform-compat-config.xsd b/services/core/xsd/platform-compat-config.xsd new file mode 100644 index 0000000000000..ee39e507aff17 --- /dev/null +++ b/services/core/xsd/platform-compat-config.xsd @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/core/xsd/platform-compat-schema/current.txt b/services/core/xsd/platform-compat-schema/current.txt new file mode 100644 index 0000000000000..84567851da2cd --- /dev/null +++ b/services/core/xsd/platform-compat-schema/current.txt @@ -0,0 +1,31 @@ +// Signature format: 2.0 +package com.android.server.compat.config { + + public class Change { + ctor public Change(); + method public boolean getDisabled(); + method public int getEnableAfterTargetSdk(); + method public long getId(); + method public String getName(); + method public String getValue(); + method public void setDisabled(boolean); + method public void setEnableAfterTargetSdk(int); + method public void setId(long); + method public void setName(String); + method public void setValue(String); + } + + public class Config { + ctor public Config(); + method public java.util.List getCompatChange(); + } + + public class XmlParser { + ctor public XmlParser(); + method public static com.android.server.compat.config.Config read(java.io.InputStream) throws javax.xml.datatype.DatatypeConfigurationException, java.io.IOException, org.xmlpull.v1.XmlPullParserException; + method public static String readText(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; + method public static void skip(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; + } + +} + diff --git a/services/core/xsd/platform-compat-schema/last_current.txt b/services/core/xsd/platform-compat-schema/last_current.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/services/core/xsd/platform-compat-schema/last_removed.txt b/services/core/xsd/platform-compat-schema/last_removed.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/services/core/xsd/platform-compat-schema/removed.txt b/services/core/xsd/platform-compat-schema/removed.txt new file mode 100644 index 0000000000000..d802177e249b3 --- /dev/null +++ b/services/core/xsd/platform-compat-schema/removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0