From bc57cd1b248bf23e443581f9fe44167c94699ce8 Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Mon, 19 Aug 2013 15:47:42 -0700 Subject: Notify ViewRootImpl when it's safe to modify Canvas. When Activity.convert{To|From}Translucent() is called the ViewRootImpl is now notified when it is safe to convert the Canvas from translucent to opaque and back to translucent. This will make it possible to save resources when compositing opaque layers. Fixes bug 10349536. Change-Id: I7282aee1d54601fb00611d20be204bf164d873f6 --- .../java/com/android/server/am/ActivityManagerService.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'services') diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index be6119d..cc9a72c 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -8152,18 +8152,20 @@ public final class ActivityManagerService extends ActivityManagerNative } @Override - public void convertFromTranslucent(IBinder token) { + public boolean convertFromTranslucent(IBinder token) { final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { final ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { - return; + return false; } if (r.changeWindowTranslucency(true)) { mWindowManager.setAppFullscreen(token, true); mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); + return true; } + return false; } } finally { Binder.restoreCallingIdentity(origId); @@ -8171,19 +8173,21 @@ public final class ActivityManagerService extends ActivityManagerNative } @Override - public void convertToTranslucent(IBinder token) { + public boolean convertToTranslucent(IBinder token) { final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { final ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { - return; + return false; } if (r.changeWindowTranslucency(false)) { r.task.stack.convertToTranslucent(r); mWindowManager.setAppFullscreen(token, false); mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); + return true; } + return false; } } finally { Binder.restoreCallingIdentity(origId); -- cgit v1.1