From 65548c0e564276a86f95f9f3d3395593a5c0f8dd Mon Sep 17 00:00:00 2001 From: Yuri Lin Date: Thu, 18 Jul 2024 17:12:41 -0400 Subject: [PATCH 1/2] Add interstitial for modes that are disabled but not by user This covers both the case of navigating to the mode page through the mode aggregator menu as well as if an app sends an intent to go to the mode. The interstitial visuals are not done yet; in particular, the image is just a gray box for now. Manual tests done: - visually verifying the interstitial page in both portrait and landscape - accessing the mode page from modes list, confirming interstitial pops up - accessing enabled and disabled-by-user mode page from modes list (no interstitial) - getting to the mode page from intent through an app - accessing enabled and disabled-by-user mode pages from app intent (no interstitial) - adjusted display and font size (it looks bad with max display & font size, maybe not much to be done) Bug: 332730534 Test: manual, ZenModeFragmentTest, SetupInterstitialActivityTest Flag: android.app.modes_ui Change-Id: I21f13b0842d5b118a341f7d85e8fcac947ca3a06 --- AndroidManifest.xml | 6 + res/layout-land/mode_interstitial_layout.xml | 113 +++++++++++ res/layout/mode_interstitial_layout.xml | 86 +++++++++ res/values/strings.xml | 6 + .../modes/SetupInterstitialActivity.java | 177 ++++++++++++++++++ .../notification/modes/ZenModeFragment.java | 28 ++- .../modes/SetupInterstitialActivityTest.java | 99 ++++++++++ .../modes/ZenModeFragmentTest.java | 125 +++++++++++++ 8 files changed, 637 insertions(+), 3 deletions(-) create mode 100644 res/layout-land/mode_interstitial_layout.xml create mode 100644 res/layout/mode_interstitial_layout.xml create mode 100644 src/com/android/settings/notification/modes/SetupInterstitialActivity.java create mode 100644 tests/robotests/src/com/android/settings/notification/modes/SetupInterstitialActivityTest.java create mode 100644 tests/robotests/src/com/android/settings/notification/modes/ZenModeFragmentTest.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 223b473f903..7b79611ca65 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1369,6 +1369,12 @@ android:value="true" /> + + + + + + + + + + + + + + + + + + + + + + +