From 1801b180dac364a25ef12a5af01ce0bb5a74a601 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Thu, 27 Feb 2014 14:09:53 +0000 Subject: [PATCH] API changes for 64 bit platforms. EGLObjectHandle.(int) and int EGLObjectHandle.getHandle() have now been deprecated and replaced with variants that take and return java longs. bug: 13181704 Change-Id: I67bef5fbf064e85205b8a85e00f91f4ffcf60d19 --- api/current.txt | 6 ++-- .../java/android/opengl/EGLObjectHandle.java | 33 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/api/current.txt b/api/current.txt index 8340265a2810d..6846faa95ac18 100644 --- a/api/current.txt +++ b/api/current.txt @@ -16310,8 +16310,10 @@ package android.opengl { } public abstract class EGLObjectHandle { - ctor protected EGLObjectHandle(int); - method public int getHandle(); + ctor protected deprecated EGLObjectHandle(int); + ctor protected EGLObjectHandle(long); + method public deprecated int getHandle(); + method public long getNativeHandle(); } public class EGLSurface extends android.opengl.EGLObjectHandle { diff --git a/opengl/java/android/opengl/EGLObjectHandle.java b/opengl/java/android/opengl/EGLObjectHandle.java index e6e397602def6..113f867c404fd 100644 --- a/opengl/java/android/opengl/EGLObjectHandle.java +++ b/opengl/java/android/opengl/EGLObjectHandle.java @@ -24,18 +24,28 @@ package android.opengl; public abstract class EGLObjectHandle { private final long mHandle; - // TODO Deprecate EGLObjectHandle(int) method + /** + * @deprecated Use {@link EGLObjectHandle(long)} instead. Handles + * on 64 bit platforms will be wider than java ints. + */ + @Deprecated protected EGLObjectHandle(int handle) { mHandle = handle; } - // TODO Unhide the EGLObjectHandle(long) method - /** - * {@hide} - */ protected EGLObjectHandle(long handle) { mHandle = handle; } - // TODO Deprecate getHandle() method in favor of getNativeHandle() + /** + * @deprecated Use {@link #getNativeHandle()} instead. Handles on + * 64 bit platforms will be wider than java ints. + */ + @Deprecated + public int getHandle() { + if ((mHandle & 0xffffffffL) != mHandle) { + throw new UnsupportedOperationException(); + } + return (int)mHandle; + } /** * Returns the native handle of the wrapped EGL object. This handle can be * cast to the corresponding native type on the native side. @@ -44,17 +54,6 @@ public abstract class EGLObjectHandle { * * @return the native handle of the wrapped EGL object. */ - public int getHandle() { - if ((mHandle & 0xffffffffL) != mHandle) { - throw new UnsupportedOperationException(); - } - return (int)mHandle; - } - - // TODO Unhide getNativeHandle() method - /** - * {@hide} - */ public long getNativeHandle() { return mHandle; }