summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/service/wallpaper/WallpaperService.java3
-rw-r--r--core/java/android/view/Surface.java12
-rw-r--r--core/java/android/view/ViewRoot.java4
-rw-r--r--core/jni/android_view_Surface.cpp4
4 files changed, 13 insertions, 10 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index 2cdfc66..2e4f1d2 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -377,6 +377,7 @@ public abstract class WallpaperService extends Service {
if (!mCreated) {
mLayout.type = mIWallpaperEngine.mWindowType;
mLayout.gravity = Gravity.LEFT|Gravity.TOP;
+ mLayout.setTitle(WallpaperService.this.getClass().getName());
mLayout.windowAnimations =
com.android.internal.R.style.Animation_Wallpaper;
mSession.add(mWindow, mLayout, View.VISIBLE, mContentInsets);
@@ -558,7 +559,7 @@ public abstract class WallpaperService extends Service {
mSession.remove(mWindow);
} catch (RemoteException e) {
}
- mSurfaceHolder.mSurface.clear();
+ mSurfaceHolder.mSurface.release();
mCreated = false;
}
}
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java
index 5cecac3..b85667b 100644
--- a/core/java/android/view/Surface.java
+++ b/core/java/android/view/Surface.java
@@ -181,7 +181,7 @@ public class Surface implements Parcelable {
public Surface(SurfaceSession s,
int pid, int display, int w, int h, int format, int flags)
throws OutOfResourcesException {
- mCanvas = new Canvas();
+ mCanvas = new CompatibleCanvas();
init(s,pid,display,w,h,format,flags);
}
@@ -271,8 +271,12 @@ public class Surface implements Parcelable {
*/
public native boolean isValid();
- /** Call this free the surface up. {@hide} */
- public native void clear();
+ /** Free all server-side state associated with this surface and
+ * release this object's reference. {@hide} */
+ public native void destroy();
+
+ /** Release the local reference to the server-side surface. @hide */
+ public native void release();
/** draw into a surface */
public Canvas lockCanvas(Rect dirty) throws OutOfResourcesException, IllegalArgumentException
@@ -400,6 +404,4 @@ public class Surface implements Parcelable {
throws OutOfResourcesException;
private native void init(Parcel source);
-
- private native void release();
}
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index fafe00f..b61465a 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -1575,7 +1575,7 @@ public final class ViewRoot extends Handler implements ViewParent,
if (mUseGL) {
destroyGL();
}
- mSurface.clear();
+ mSurface.release();
try {
sWindowSession.remove(mWindow);
@@ -2532,7 +2532,7 @@ public final class ViewRoot extends Handler implements ViewParent,
}
}
- mSurface.clear();
+ mSurface.release();
}
if (mAdded) {
mAdded = false;
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index 02677f4..40c8aa0 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -214,7 +214,7 @@ static void Surface_initParcel(JNIEnv* env, jobject clazz, jobject argParcel)
setSurface(env, clazz, rhs);
}
-static void Surface_clear(JNIEnv* env, jobject clazz, uintptr_t *ostack)
+static void Surface_destroy(JNIEnv* env, jobject clazz, uintptr_t *ostack)
{
const sp<SurfaceControl>& surface(getSurfaceControl(env, clazz));
if (SurfaceControl::isValid(surface)) {
@@ -622,7 +622,7 @@ static JNINativeMethod gSurfaceMethods[] = {
{"nativeClassInit", "()V", (void*)nativeClassInit },
{"init", "(Landroid/view/SurfaceSession;IIIIII)V", (void*)Surface_init },
{"init", "(Landroid/os/Parcel;)V", (void*)Surface_initParcel },
- {"clear", "()V", (void*)Surface_clear },
+ {"destroy", "()V", (void*)Surface_destroy },
{"release", "()V", (void*)Surface_release },
{"copyFrom", "(Landroid/view/Surface;)V", (void*)Surface_copyFrom },
{"isValid", "()Z", (void*)Surface_isValid },