summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Garfield Tan <xutan@google.com> 2022-03-29 12:34:22 -0700
committer Garfield Tan <xutan@google.com> 2022-03-29 19:59:50 +0000
commit47acf93da238b616b38dea5def1bad85800901cf (patch)
tree05b8e5475eeabb0198aa70fc08aaac04ef7fcb69
parentd9fe67ca4ad81aba51c661e75b5fa63dc5a8f244 (diff)
Hide CaptionDecorView behind CAPTION_ON_SHELL flag
Also introduce a system property to facilitate debugging of caption in shell. Bug: 165794636 Test: Caption shows when the property is unset. Caption goes away when the property is set. Change-Id: I57060778c46da217a957910f0cc9d1fe1592cfa1
-rw-r--r--core/java/android/view/ViewRootImpl.java3
-rw-r--r--core/java/com/android/internal/policy/DecorView.java3
2 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 7dc4f22000b8..fec99eded1c4 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -278,7 +278,8 @@ public final class ViewRootImpl implements ViewParent,
* Whether the caption is drawn by the shell.
* @hide
*/
- public static final boolean CAPTION_ON_SHELL = false;
+ public static final boolean CAPTION_ON_SHELL =
+ SystemProperties.getBoolean("persist.debug.caption_on_shell", false);
/**
* Whether the client should compute the window frame on its own.
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index 89ac72255306..84d52814ea30 100644
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -2261,7 +2261,8 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
attrs.type == TYPE_APPLICATION || attrs.type == TYPE_DRAWN_APPLICATION;
final WindowConfiguration winConfig = getResources().getConfiguration().windowConfiguration;
// Only a non floating application window on one of the allowed workspaces can get a caption
- if (!mWindow.isFloating() && isApplication && winConfig.hasWindowDecorCaption()) {
+ if (!mWindow.isFloating() && isApplication && winConfig.hasWindowDecorCaption()
+ && !CAPTION_ON_SHELL) {
// Dependent on the brightness of the used title we either use the
// dark or the light button frame.
if (decorCaptionView == null) {