Link to app-provided configuration intent for app-owned rules.

If there is no valid intent, the automatic trigger preference is disabled.

Flag: android.app.modes_ui
Bug: 341961712
Test: manual (for Bedtime & Driving modes), ZenModeSetTriggerLinkPreferenceControllerTest

Change-Id: I673792effb3cfdcaaa7cf85adfb55a93b44dcc86
This commit is contained in:
Yuri Lin
2024-06-11 18:36:50 -04:00
parent 978cba142a
commit 21539cd2be
8 changed files with 316 additions and 35 deletions

View File

@@ -35,6 +35,7 @@ import java.util.ArrayList;
import java.util.List;
public class ZenModeFragment extends ZenModeFragmentBase {
// for mode deletion menu
private static final int DELETE_MODE = 1;
@@ -61,7 +62,8 @@ public class ZenModeFragment extends ZenModeFragmentBase {
prefControllers.add(new ZenModeDisplayLinkPreferenceController(
context, "mode_display_settings", mBackend, mHelperBackend));
prefControllers.add(new ZenModeSetTriggerLinkPreferenceController(context,
"zen_automatic_trigger_category", this, mBackend));
"zen_automatic_trigger_category", this, mBackend,
context.getPackageManager()));
prefControllers.add(new InterruptionFilterPreferenceController(
context, "allow_filtering", mBackend));
prefControllers.add(new ManualDurationPreferenceController(