Merge change Ic9f6bf94 into eclair

* changes:
  Add a test app that will drain the battery.  NOT IN BUILD.
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index b798bde..3f8c71e 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -851,10 +851,6 @@
                         }
                     }
                     
-                    int maxVers = sa.getInt(
-                            com.android.internal.R.styleable.AndroidManifestUsesSdk_maxSdkVersion,
-                            SDK_VERSION);
-
                     sa.recycle();
 
                     if (minCode != null) {
@@ -894,13 +890,6 @@
                     } else {
                         pkg.applicationInfo.targetSdkVersion = targetVers;
                     }
-                    
-                    if (maxVers < SDK_VERSION) {
-                        outError[0] = "Requires older sdk version #" + maxVers
-                                + " (current version is #" + SDK_VERSION + ")";
-                        mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
-                        return null;
-                    }
                 }
 
                 XmlUtils.skipCurrentTag(parser);
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java
index e60859b..fb3747c 100644
--- a/opengl/java/android/opengl/GLSurfaceView.java
+++ b/opengl/java/android/opengl/GLSurfaceView.java
@@ -867,7 +867,7 @@
                     mEglDisplay, mEglConfig, holder);
 
             if (mEglSurface == null || mEglSurface == EGL10.EGL_NO_SURFACE) {
-                throw new RuntimeException("createWindowSurface failed");
+                throwEglException("createWindowSurface");
             }
 
             /*
@@ -875,7 +875,7 @@
              * the context is current and bound to a surface.
              */
             if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
-                throw new RuntimeException("eglMakeCurrent failed.");
+                throwEglException("eglMakeCurrent");
             }
 
             GL gl = mEglContext.getGL();
@@ -934,6 +934,10 @@
             }
         }
 
+        private void throwEglException(String function) {
+            throw new RuntimeException(function + " failed: " + mEgl.eglGetError());
+        }
+
         EGL10 mEgl;
         EGLDisplay mEglDisplay;
         EGLSurface mEglSurface;
diff --git a/tests/ImfTest/AndroidManifest.xml b/tests/ImfTest/AndroidManifest.xml
index 55e5d38..82dbe75 100755
--- a/tests/ImfTest/AndroidManifest.xml
+++ b/tests/ImfTest/AndroidManifest.xml
@@ -1,6 +1,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
         package="com.android.imftest">
 
+   <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
+
    <application>
     
         <activity android:name=".samples.InputTypeActivity" android:label="Input Type Activity">