summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.xml54
-rwxr-xr-xcore/java/android/content/pm/ConfigurationInfo.java30
-rw-r--r--core/java/android/content/pm/PackageParser.java12
-rw-r--r--core/res/res/values/attrs_manifest.xml19
-rw-r--r--core/res/res/values/public.xml1
5 files changed, 102 insertions, 14 deletions
diff --git a/api/current.xml b/api/current.xml
index 69660d6..c98a5c4 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -3518,17 +3518,6 @@
visibility="public"
>
</field>
-<field name="donut_resource_pad30"
- type="int"
- transient="false"
- volatile="false"
- value="16843394"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
<field name="donut_resource_pad4"
type="int"
transient="false"
@@ -4453,6 +4442,17 @@
visibility="public"
>
</field>
+<field name="glEsVersion"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843394"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="gradientRadius"
type="int"
transient="false"
@@ -35239,6 +35239,17 @@
visibility="public"
>
</method>
+<method name="getGlEsVersion"
+ return="java.lang.String"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="writeToParcel"
return="void"
abstract="false"
@@ -35264,6 +35275,17 @@
visibility="public"
>
</field>
+<field name="GL_ES_VERSION_UNDEFINED"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="0"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="INPUT_FEATURE_FIVE_WAY_NAV"
type="int"
transient="false"
@@ -35286,6 +35308,16 @@
visibility="public"
>
</field>
+<field name="reqGlEsVersion"
+ type="int"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="reqInputFeatures"
type="int"
transient="false"
diff --git a/core/java/android/content/pm/ConfigurationInfo.java b/core/java/android/content/pm/ConfigurationInfo.java
index dcc7463..fb7a47f 100755
--- a/core/java/android/content/pm/ConfigurationInfo.java
+++ b/core/java/android/content/pm/ConfigurationInfo.java
@@ -22,7 +22,7 @@ import android.os.Parcelable;
/**
* Information you can retrieve about hardware configuration preferences
* declared by an application. This corresponds to information collected from the
- * AndroidManifest.xml's &lt;uses-configuration&gt; tags.
+ * AndroidManifest.xml's &lt;uses-configuration&gt; and the &lt;uses-feature&gt;tags.
*/
public class ConfigurationInfo implements Parcelable {
/**
@@ -70,6 +70,16 @@ public class ConfigurationInfo implements Parcelable {
*/
public int reqInputFeatures = 0;
+ /**
+ * Default value for {@link #reqGlEsVersion};
+ */
+ public static final int GL_ES_VERSION_UNDEFINED = 0;
+ /**
+ * The GLES version used by an application. The upper order 16 bits represent the
+ * major version and the lower order 16 bits the minor version.
+ */
+ public int reqGlEsVersion;
+
public ConfigurationInfo() {
}
@@ -78,6 +88,7 @@ public class ConfigurationInfo implements Parcelable {
reqKeyboardType = orig.reqKeyboardType;
reqNavigation = orig.reqNavigation;
reqInputFeatures = orig.reqInputFeatures;
+ reqGlEsVersion = orig.reqGlEsVersion;
}
public String toString() {
@@ -86,7 +97,8 @@ public class ConfigurationInfo implements Parcelable {
+ ", touchscreen = " + reqTouchScreen + "}"
+ ", inputMethod = " + reqKeyboardType + "}"
+ ", navigation = " + reqNavigation + "}"
- + ", reqInputFeatures = " + reqInputFeatures + "}";
+ + ", reqInputFeatures = " + reqInputFeatures + "}"
+ + ", reqGlEsVersion = " + reqGlEsVersion + "}";
}
public int describeContents() {
@@ -98,6 +110,7 @@ public class ConfigurationInfo implements Parcelable {
dest.writeInt(reqKeyboardType);
dest.writeInt(reqNavigation);
dest.writeInt(reqInputFeatures);
+ dest.writeInt(reqGlEsVersion);
}
public static final Creator<ConfigurationInfo> CREATOR =
@@ -115,5 +128,18 @@ public class ConfigurationInfo implements Parcelable {
reqKeyboardType = source.readInt();
reqNavigation = source.readInt();
reqInputFeatures = source.readInt();
+ reqGlEsVersion = source.readInt();
+ }
+
+ /**
+ * This method extracts the major and minor version of reqGLEsVersion attribute
+ * and returns it as a string. Say reqGlEsVersion value of 0x00010002 is returned
+ * as 1.2
+ * @return String representation of the reqGlEsVersion attribute
+ */
+ public String getGlEsVersion() {
+ int major = ((reqGlEsVersion & 0xffff0000) >> 16);
+ int minor = reqGlEsVersion & 0x0000ffff;
+ return String.valueOf(major)+"."+String.valueOf(minor);
}
}
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index e2c0fe6..ab8559c 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -748,6 +748,18 @@ public class PackageParser {
XmlUtils.skipCurrentTag(parser);
+ } else if (tagName.equals("uses-feature")) {
+ ConfigurationInfo cPref = new ConfigurationInfo();
+ sa = res.obtainAttributes(attrs,
+ com.android.internal.R.styleable.AndroidManifestUsesFeature);
+ cPref.reqGlEsVersion = sa.getInt(
+ com.android.internal.R.styleable.AndroidManifestUsesFeature_glEsVersion,
+ ConfigurationInfo.GL_ES_VERSION_UNDEFINED);
+ sa.recycle();
+ pkg.configPreferences.add(cPref);
+
+ XmlUtils.skipCurrentTag(parser);
+
} else if (tagName.equals("uses-sdk")) {
if (mSdkVersion > 0) {
sa = res.obtainAttributes(attrs,
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 0a2d208..91cd9fd 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -596,7 +596,8 @@
{@link #AndroidManifestUsesPermission uses-permission},
{@link #AndroidManifestUsesConfiguration uses-configuration},
{@link #AndroidManifestApplication application},
- {@link #AndroidManifestInstrumentation instrumentation}. -->
+ {@link #AndroidManifestInstrumentation instrumentation},
+ {@link #AndroidManifestUsesFeature uses-feature}. -->
<declare-styleable name="AndroidManifest">
<attr name="versionCode" />
<attr name="versionName" />
@@ -765,6 +766,22 @@
<attr name="reqFiveWayNav" />
</declare-styleable>
+ <!-- The <code>uses-feature</code> tag specifies
+ a specific feature used by the application.
+ For example an application might specify that it requires
+ specific version of open gl. Multiple such attribute
+ values can be specified by the application.
+
+ <p>This appears as a child tag of the root
+ {@link #AndroidManifest manifest} tag. -->
+ <declare-styleable name="AndroidManifestUsesFeature" parent="AndroidManifest">
+ <!-- The GLES driver version number needed by an application.
+ The higher 16 bits represent the major number and the lower 16 bits
+ represent the minor number. For example for GL 1.2 referring to
+ 0x00000102, the actual value should be set as 0x00010002. -->
+ <attr name="glEsVersion" format="integer"/>
+ </declare-styleable>
+
<!-- The <code>uses-sdk</code> tag describes the SDK features that the
containing package must be running on to operate correctly.
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index c2c84d6..b29f9ac 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1115,6 +1115,7 @@
<public type="attr" name="fadeEnabled" />
<public type="attr" name="backupAgent" />
<public type="attr" name="allowBackup" />
+ <public type="attr" name="glEsVersion" />
<public-padding type="attr" name="donut_resource_pad" end="0x0101029f" />