From 6b9e20d32d6cc9df338aefa908cf29bfdc2905cc Mon Sep 17 00:00:00 2001 From: Wa Gao Date: Wed, 8 Nov 2023 06:09:27 +0000 Subject: [PATCH] Add the dialog when clicking on the diabled switch. Bug: 302189945 Change-Id: I0bf7774b80a59c70a2ea1725e0adba522854adde --- ...content_protection_preference_fragment.xml | 5 +- .../ContentProtectionPreferenceFragment.java | 14 -- ...ContentProtectionWorkSwitchController.java | 86 +++++++++ ...ntentProtectionPreferenceFragmentTest.java | 75 -------- ...entProtectionWorkSwitchControllerTest.java | 163 ++++++++++++++++++ 5 files changed, 252 insertions(+), 91 deletions(-) create mode 100644 src/com/android/settings/security/ContentProtectionWorkSwitchController.java create mode 100644 tests/robotests/src/com/android/settings/security/ContentProtectionWorkSwitchControllerTest.java diff --git a/res/layout/content_protection_preference_fragment.xml b/res/layout/content_protection_preference_fragment.xml index a412d8618a4..4c7352e38c4 100644 --- a/res/layout/content_protection_preference_fragment.xml +++ b/res/layout/content_protection_preference_fragment.xml @@ -36,10 +36,11 @@ settings:lottie_rawRes="@drawable/content_protection_preference_illustration" settings:searchable="false" /> - + settings:restrictedSwitchSummary="@string/summary_placeholder" + settings:controller="com.android.settings.security.ContentProtectionWorkSwitchController"/>