From be31a56456a19c2c0b3d3ed79f19e984cbff58ad Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Thu, 26 Jan 2023 13:10:28 -0800 Subject: [PATCH] Allow Launcher to use PipContentOverlay - Export PipContentOverlay to library shared with Launcher - Add PipContentOverlay#getLeash, which Launch propagates for cleanup This refactor makes it easier to experiment the app icon overlay (solid background with app icon as an overlay). Bug: 265998256 Test: Enter PiP from Google Maps, ensure the content overlay works Change-Id: If011c650e237c5834556e3b250200f63f78f84e2 --- libs/WindowManager/Shell/Android.bp | 1 + .../src/com/android/wm/shell/pip/PipContentOverlay.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/libs/WindowManager/Shell/Android.bp b/libs/WindowManager/Shell/Android.bp index f615ad6e671b2..0f4521951e3d2 100644 --- a/libs/WindowManager/Shell/Android.bp +++ b/libs/WindowManager/Shell/Android.bp @@ -47,6 +47,7 @@ filegroup { "src/com/android/wm/shell/sysui/ShellSharedConstants.java", "src/com/android/wm/shell/common/TransactionPool.java", "src/com/android/wm/shell/animation/Interpolators.java", + "src/com/android/wm/shell/pip/PipContentOverlay.java", "src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java", ], path: "src", diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipContentOverlay.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipContentOverlay.java index 7096a645ef85b..283b1ec0f7527 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipContentOverlay.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipContentOverlay.java @@ -16,6 +16,7 @@ package com.android.wm.shell.pip; +import android.annotation.Nullable; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Color; @@ -41,6 +42,11 @@ public abstract class PipContentOverlay { } } + @Nullable + public SurfaceControl getLeash() { + return mLeash; + } + /** * Animates the internal {@link #mLeash} by a given fraction. * @param atomicTx {@link SurfaceControl.Transaction} to operate, you should not explicitly