Loading core/java/android/view/SurfaceControl.java +15 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,11 @@ public class SurfaceControl { */ private static final int SURFACE_OPAQUE = 0x02; /** * Surface flag: Fully transparent, drop in composition if possible * @hide */ private static final int SURFACE_TRANSPARENT = 0x80; /* built-in physical display ids (keep in sync with ISurfaceComposer.h) * these are different from the logical display ids used elsewhere in the framework */ Loading Loading @@ -388,6 +393,16 @@ public class SurfaceControl { nativeSetFlags(mNativeObject, 0, SURFACE_HIDDEN); } public void setTransparent(boolean isTransparent) { checkNotReleased(); if(isTransparent) { nativeSetFlags(mNativeObject, SURFACE_TRANSPARENT, SURFACE_TRANSPARENT); } else { nativeSetFlags(mNativeObject, 0, SURFACE_TRANSPARENT); } } public void setTransparentRegionHint(Region region) { checkNotReleased(); nativeSetTransparentRegionHint(mNativeObject, region); Loading core/java/android/view/Window.java +5 −0 Original line number Diff line number Diff line Loading @@ -779,6 +779,11 @@ public abstract class Window { setFlags(0, flags); } /** @hide */ public void clearPrivateFlags(int flags) { setPrivateFlags(0, flags); } /** * Set the flags of the window, as per the * {@link WindowManager.LayoutParams WindowManager.LayoutParams} Loading core/java/android/view/WindowManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -1115,6 +1115,10 @@ public interface WindowManager extends ViewManager { */ public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400; /** Window flag: mark layer as fully transparent * {@hide} */ public static final int PRIVATE_FLAG_FULLY_TRANSPARENT = 0x10000000; /** * Control flags that are private to the platform. * @hide Loading services/core/java/com/android/server/wm/WindowManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -9455,6 +9455,12 @@ public class WindowManagerService extends IWindowManager.Stub } } private void handlePrivateFlagFullyTransparent(WindowState w) { final WindowManager.LayoutParams attrs = w.mAttrs; final WindowStateAnimator winAnimator = w.mWinAnimator; winAnimator.updateFullyTransparent(attrs); } private void updateAllDrawnLocked(DisplayContent displayContent) { // See if any windows have been drawn, so they (and others // associated with them) can now be shown. Loading Loading @@ -9656,6 +9662,8 @@ public class WindowManagerService extends IWindowManager.Stub handleFlagDimBehind(w); } handlePrivateFlagFullyTransparent(w); if (isDefaultDisplay && obscuredChanged && (mWallpaperTarget == w) && w.isVisibleLw()) { // This is the wallpaper target and its obscured state Loading services/core/java/com/android/server/wm/WindowStateAnimator.java +17 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ class WindowStateAnimator { boolean mWasAnimating; // Were we animating going into the most recent animation step? int mAnimLayer; int mLastLayer; boolean mFullyTransparent; //Last value of transparency setting SurfaceControl mSurfaceControl; SurfaceControl mPendingDestroySurface; Loading Loading @@ -1901,4 +1902,20 @@ class WindowStateAnimator { sb.append('}'); return sb.toString(); } void updateFullyTransparent(WindowManager.LayoutParams attrs) { final boolean fullyTransparent = (attrs.privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_FULLY_TRANSPARENT) != 0; if (fullyTransparent == mFullyTransparent) return; if (mSurfaceControl == null) return; SurfaceControl.openTransaction(); try { mSurfaceControl.setTransparent(fullyTransparent); } catch (RuntimeException e) { Slog.w(TAG, "Error toggling transparency. ", e); } finally { SurfaceControl.closeTransaction(); mFullyTransparent = fullyTransparent; } } } Loading
core/java/android/view/SurfaceControl.java +15 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,11 @@ public class SurfaceControl { */ private static final int SURFACE_OPAQUE = 0x02; /** * Surface flag: Fully transparent, drop in composition if possible * @hide */ private static final int SURFACE_TRANSPARENT = 0x80; /* built-in physical display ids (keep in sync with ISurfaceComposer.h) * these are different from the logical display ids used elsewhere in the framework */ Loading Loading @@ -388,6 +393,16 @@ public class SurfaceControl { nativeSetFlags(mNativeObject, 0, SURFACE_HIDDEN); } public void setTransparent(boolean isTransparent) { checkNotReleased(); if(isTransparent) { nativeSetFlags(mNativeObject, SURFACE_TRANSPARENT, SURFACE_TRANSPARENT); } else { nativeSetFlags(mNativeObject, 0, SURFACE_TRANSPARENT); } } public void setTransparentRegionHint(Region region) { checkNotReleased(); nativeSetTransparentRegionHint(mNativeObject, region); Loading
core/java/android/view/Window.java +5 −0 Original line number Diff line number Diff line Loading @@ -779,6 +779,11 @@ public abstract class Window { setFlags(0, flags); } /** @hide */ public void clearPrivateFlags(int flags) { setPrivateFlags(0, flags); } /** * Set the flags of the window, as per the * {@link WindowManager.LayoutParams WindowManager.LayoutParams} Loading
core/java/android/view/WindowManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -1115,6 +1115,10 @@ public interface WindowManager extends ViewManager { */ public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400; /** Window flag: mark layer as fully transparent * {@hide} */ public static final int PRIVATE_FLAG_FULLY_TRANSPARENT = 0x10000000; /** * Control flags that are private to the platform. * @hide Loading
services/core/java/com/android/server/wm/WindowManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -9455,6 +9455,12 @@ public class WindowManagerService extends IWindowManager.Stub } } private void handlePrivateFlagFullyTransparent(WindowState w) { final WindowManager.LayoutParams attrs = w.mAttrs; final WindowStateAnimator winAnimator = w.mWinAnimator; winAnimator.updateFullyTransparent(attrs); } private void updateAllDrawnLocked(DisplayContent displayContent) { // See if any windows have been drawn, so they (and others // associated with them) can now be shown. Loading Loading @@ -9656,6 +9662,8 @@ public class WindowManagerService extends IWindowManager.Stub handleFlagDimBehind(w); } handlePrivateFlagFullyTransparent(w); if (isDefaultDisplay && obscuredChanged && (mWallpaperTarget == w) && w.isVisibleLw()) { // This is the wallpaper target and its obscured state Loading
services/core/java/com/android/server/wm/WindowStateAnimator.java +17 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ class WindowStateAnimator { boolean mWasAnimating; // Were we animating going into the most recent animation step? int mAnimLayer; int mLastLayer; boolean mFullyTransparent; //Last value of transparency setting SurfaceControl mSurfaceControl; SurfaceControl mPendingDestroySurface; Loading Loading @@ -1901,4 +1902,20 @@ class WindowStateAnimator { sb.append('}'); return sb.toString(); } void updateFullyTransparent(WindowManager.LayoutParams attrs) { final boolean fullyTransparent = (attrs.privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_FULLY_TRANSPARENT) != 0; if (fullyTransparent == mFullyTransparent) return; if (mSurfaceControl == null) return; SurfaceControl.openTransaction(); try { mSurfaceControl.setTransparent(fullyTransparent); } catch (RuntimeException e) { Slog.w(TAG, "Error toggling transparency. ", e); } finally { SurfaceControl.closeTransaction(); mFullyTransparent = fullyTransparent; } } }