Merge "Add a platform compat config schema API." am: 64e01268ce

am: 4565dd5de3

Change-Id: If234548ca79215d18b404d77ad6742039a16efb9
This commit is contained in:
Anna Trostanetski
2019-07-25 09:14:22 -07:00
committed by android-build-merger
6 changed files with 91 additions and 0 deletions

View File

@@ -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",
}

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2019 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!-- This defines the format of the XML file generated by
~ com.android.compat.annotation.ChangeIdProcessor annotation processor (from
~ tools/platform-compat), and is parsed in com/android/server/compat/CompatConfig.java.
-->
<xs:schema version="2.0" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="change">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:long" name="id" use="required"/>
<xs:attribute type="xs:string" name="name" use="required"/>
<xs:attribute type="xs:boolean" name="disabled"/>
<xs:attribute type="xs:int" name="enableAfterTargetSdk"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="config">
<xs:complexType>
<xs:sequence>
<xs:element name="compat-change" type="change" maxOccurs="unbounded"
minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="UniqueId">
<xs:selector xpath="compat-change" />
<xs:field xpath="@id" />
</xs:unique>
</xs:element>
</xs:schema>

View File

@@ -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<com.android.server.compat.config.Change> 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;
}
}

View File

@@ -0,0 +1 @@
// Signature format: 2.0