Turn on HW accel by default for apps that target ICS.
Change-Id: I010e11e03b2dfd0d1db8c47f74c25a28586fd79c
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index e927f6c..208869b 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -1573,7 +1573,7 @@
boolean hardwareAccelerated = sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestApplication_hardwareAccelerated,
- false);
+ owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.ICE_CREAM_SANDWICH);
if (sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestApplication_hasCode,
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 1b28aa2..6c7c58d 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -278,6 +278,16 @@
/**
* Current version under development.
+ *
+ * <p>Applications targeting this or a later release will get these
+ * new changes in behavior:</p>
+ * <ul>
+ * <li> 2d drawing hardware acceleration is now turned on by default.
+ * You can use
+ * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated}
+ * to turn it off if needed, although this is strongly discouraged since
+ * it will result in poor performance on larger screen devices.
+ * </ul>
*/
public static final int ICE_CREAM_SANDWICH = CUR_DEVELOPMENT;
}
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index f7974e9..c9ac57a 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -235,12 +235,13 @@
<attr name="vmSafeMode" format="boolean" />
<!-- <p>Flag indicating whether the application's rendering should be hardware
- accelerated if possible. This flag is turned off by default, both for
- applications and activities.</p>
+ accelerated if possible. This flag is turned on by default for applications
+ that are targeting {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}
+ or later.</p>
<p>This flag can be set on the application and any activity declared
in the manifest. When enabled for the application, each activity is
automatically assumed to be hardware accelerated. This flag can be
- overriden in the activity tags, either turning it off (if on for the
+ overridden in the activity tags, either turning it off (if on for the
application) or on (if off for the application.)</p>
<p>When this flag is turned on for an activity (either directly or via
the application tag), every window created from the activity, including