Add new filter to list private space apps when not in quite mode

This change handles listing of private space apps in Settings > Sound &
vibration > Do Not Disturb > Apps page.

Based on the new filter this page
- lists the apps from private space whenever profile is unlocked.
- when quite mode enabled privat space apps in the list is hidden.

Recording Link: b/322316632#comment3

Bug: 322316632
Test: Manual
Change-Id: Ie8a7b3376351c031a1abb8488eceb7859a1930fd
This commit is contained in:
josephpv
2024-01-25 13:42:02 +00:00
committed by Joseph Vincent
parent e8ba1b5711
commit 14b2f9568e
4 changed files with 15 additions and 4 deletions

View File

@@ -118,7 +118,10 @@ public class ZenModeAddBypassingAppsPreferenceController extends AbstractPrefere
return; return;
} }
ApplicationsState.AppFilter filter = ApplicationsState.FILTER_ALL_ENABLED; ApplicationsState.AppFilter filter = android.multiuser.Flags.enablePrivateSpaceFeatures()
&& android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace()
? ApplicationsState.FILTER_ENABLED_NOT_QUIET
: ApplicationsState.FILTER_ALL_ENABLED;
mAppSession.rebuild(filter, ApplicationsState.ALPHA_COMPARATOR); mAppSession.rebuild(filter, ApplicationsState.ALPHA_COMPARATOR);
} }

View File

@@ -45,7 +45,6 @@ import com.android.settingslib.widget.AppPreference;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* Adds a preference to the PreferenceScreen for each notification channel that can bypass DND. * Adds a preference to the PreferenceScreen for each notification channel that can bypass DND.
*/ */
@@ -107,7 +106,10 @@ public class ZenModeAllBypassingAppsPreferenceController extends AbstractPrefere
return; return;
} }
ApplicationsState.AppFilter filter = ApplicationsState.FILTER_ALL_ENABLED; ApplicationsState.AppFilter filter = android.multiuser.Flags.enablePrivateSpaceFeatures()
&& android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace()
? ApplicationsState.FILTER_ENABLED_NOT_QUIET
: ApplicationsState.FILTER_ALL_ENABLED;
mAppSession.rebuild(filter, ApplicationsState.ALPHA_COMPARATOR); mAppSession.rebuild(filter, ApplicationsState.ALPHA_COMPARATOR);
} }

View File

@@ -82,7 +82,10 @@ public class ZenModeBypassingAppsPreferenceController extends AbstractZenModePre
return; return;
} }
ApplicationsState.AppFilter filter = ApplicationsState.FILTER_ALL_ENABLED; ApplicationsState.AppFilter filter = android.multiuser.Flags.enablePrivateSpaceFeatures()
&& android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace()
? ApplicationsState.FILTER_ENABLED_NOT_QUIET
: ApplicationsState.FILTER_ALL_ENABLED;
List<ApplicationsState.AppEntry> apps = mAppSession.rebuild(filter, List<ApplicationsState.AppEntry> apps = mAppSession.rebuild(filter,
ApplicationsState.ALPHA_COMPARATOR); ApplicationsState.ALPHA_COMPARATOR);
updateAppsBypassingDndSummaryText(apps); updateAppsBypassingDndSummaryText(apps);

View File

@@ -162,4 +162,7 @@ public class ZenModeAddBypassingAppsPreferenceControllerTest {
assertThat(pref.getKey()).isEqualTo( assertThat(pref.getKey()).isEqualTo(
ZenModeAddBypassingAppsPreferenceController.KEY_NO_APPS); ZenModeAddBypassingAppsPreferenceController.KEY_NO_APPS);
} }
// TODO(b/331624810): Add tests to verify updateAppList() when the filter is
// ApplicationsState.FILTER_ENABLED_NOT_QUIET
} }