summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-09-06 21:08:27 -0700
committerDianne Hackborn <hackbod@google.com>2009-09-07 01:01:15 -0700
commit0586a1b77a788a119166a37fccd909bf9ed65f23 (patch)
tree274272fd870b2cde2215b086138f557622cef8f2 /core
parent88e625795943dea84b2e7c32f37e71303143b728 (diff)
downloadframeworks_base-0586a1b77a788a119166a37fccd909bf9ed65f23.zip
frameworks_base-0586a1b77a788a119166a37fccd909bf9ed65f23.tar.gz
frameworks_base-0586a1b77a788a119166a37fccd909bf9ed65f23.tar.bz2
Fix issue #2095422: Some fades from opaque to transparent don't work
ViewRoot was using Surface.clear(), which has different behavior in different processes -- in the system process it would kill the surface, causing all windows in that process to immediately disappear instead of animating away. This change makes Surface.release() public and uses that instead. It also renames Surface.clear() to Surface.destroy(). Also fixed some issues in the window manager that were causing the wallpaper to not get immediately resized when the orientation changes and its target window is removed and re-added. Change-Id: I2a992e365cf5747511f0bf1193db32dc2525b218
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 },