diff --git a/opengl/tools/glgen/gen b/opengl/tools/glgen/gen index 3359a2272..fb3c3a951 100755 --- a/opengl/tools/glgen/gen +++ b/opengl/tools/glgen/gen @@ -27,7 +27,7 @@ echo "package android.app; import android.content.pm.IPackageManager; public cla echo "package android.content.pm; public class ApplicationInfo {public int targetSdkVersion;}" > out/android/content/pm/ApplicationInfo.java echo "package android.content.pm; public interface IPackageManager {ApplicationInfo getApplicationInfo(java.lang.String packageName, int flags, java.lang.String userId) throws android.os.RemoteException;}" > out/android/content/pm/IPackageManager.java echo "package android.os; public class Build {public static class VERSION_CODES { public static final int CUPCAKE = 3;}; }" > out/android/os/Build.java -echo "package android.os; public class UserId {public static String myUserId() { return \"\"; } }" > out/android/os/UserId.java +echo "package android.os; public class UserHandle {public static String myUserId() { return \"\"; } }" > out/android/os/UserHandle.java echo "package android.os; public class RemoteException extends Exception {}" > out/android/os/RemoteException.java echo "package android.util; public class Log {public static void w(String a, String b) {} public static void e(String a, String b) {}}" > out/android/util/Log.java diff --git a/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp b/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp index 54de1e7b7..5fda9f8e2 100644 --- a/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp +++ b/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp @@ -1,4 +1,3 @@ -/* ** Copyright 2012, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opengl/tools/glgen/stubs/egl/eglCreateWindowSurface.cpp b/opengl/tools/glgen/stubs/egl/eglCreateWindowSurface.cpp index 14213b677..906cd80fb 100644 --- a/opengl/tools/glgen/stubs/egl/eglCreateWindowSurface.cpp +++ b/opengl/tools/glgen/stubs/egl/eglCreateWindowSurface.cpp @@ -34,7 +34,7 @@ not_valid_surface: goto exit; } - window = android::android_Surface_getNativeWindow(_env, win); + window = android::android_view_Surface_getNativeWindow(_env, win); if (window == NULL) goto not_valid_surface; @@ -112,7 +112,11 @@ not_valid_surface: goto exit; } glConsumer = android::SurfaceTexture_getSurfaceTexture(_env, win); - window = new android::Surface(glConsumer); + + if (glConsumer == NULL) + goto not_valid_surface; + + window = new android::Surface(glConsumer->getBufferQueue()); if (window == NULL) goto not_valid_surface; diff --git a/opengl/tools/glgen/stubs/jsr239/GLImplHeader.java-impl b/opengl/tools/glgen/stubs/jsr239/GLImplHeader.java-impl index e3aea76b0..974023573 100644 --- a/opengl/tools/glgen/stubs/jsr239/GLImplHeader.java-impl +++ b/opengl/tools/glgen/stubs/jsr239/GLImplHeader.java-impl @@ -22,7 +22,7 @@ import android.app.AppGlobals; import android.content.pm.ApplicationInfo; import android.content.pm.IPackageManager; import android.os.Build; -import android.os.UserId; +import android.os.UserHandle; import android.util.Log; import java.nio.Buffer; @@ -67,7 +67,7 @@ public class GLImpl implements GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack { int version = 0; IPackageManager pm = AppGlobals.getPackageManager(); try { - ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0, UserId.myUserId()); + ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0, UserHandle.myUserId()); if (applicationInfo != null) { version = applicationInfo.targetSdkVersion; }