From d1a6da569230219f98001b6e6409f66ab23c5f28 Mon Sep 17 00:00:00 2001 From: Galia Peycheva Date: Tue, 17 Mar 2020 20:42:36 +0100 Subject: [PATCH] Hide all insets when the dream is activated By default we hide all insets while the DreamActivity is active. The client app has access to the main window of the activity, so it could override this. Bug: 151749301 Test: m && flash && start the screensaver and verify that nav bar is gone Change-Id: Iecdc5f67c976de5477523e9745a9e8733703c11f --- core/java/android/service/dreams/DreamActivity.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/java/android/service/dreams/DreamActivity.java b/core/java/android/service/dreams/DreamActivity.java index 8cdd24e0884dc..0a29edc81f2fb 100644 --- a/core/java/android/service/dreams/DreamActivity.java +++ b/core/java/android/service/dreams/DreamActivity.java @@ -19,6 +19,7 @@ package android.service.dreams; import android.annotation.Nullable; import android.app.Activity; import android.os.Bundle; +import android.view.WindowInsets; /** * The Activity used by the {@link DreamService} to draw screensaver content @@ -55,5 +56,8 @@ public class DreamActivity extends Activity { if (callback != null) { callback.onActivityCreated(this); } + + // Hide all insets (nav bar, status bar, etc) when the dream is showing + getWindow().getInsetsController().hide(WindowInsets.Type.systemBars()); } }