AppClone: Add new tab only if any user handle has the property set.

This will ensure that a new tab is not created for clone profile. The
existing behavior of creating work tab when managed profile is present
on device remains as-is.

Bug: 248204976
Test: manual (verfied with primary, clone and managed profile present on
device at the same time)
Test: make RunSettingsRoboTests -j

Change-Id: I116a0de69c51e90aa59fdb47e904c567e5d62102
This commit is contained in:
“Ankita
2022-09-22 09:33:54 +00:00
parent 7fd3621809
commit d3ea0f098e
2 changed files with 23 additions and 3 deletions

View File

@@ -478,8 +478,9 @@ public class ManageApplications extends InstrumentedFragment
mFilterAdapter.enableFilter(filterType);
if (mListType == LIST_TYPE_MAIN) {
if (UserManager.get(getActivity()).getUserProfiles().size() > 1 && !mIsWorkOnly
&& !mIsPersonalOnly) {
// Apply the personal and work filter only if new tab should be added
// for a given user profile. Else let it use the default all apps filter.
if (Utils.isNewTabNeeded(getActivity()) && !mIsWorkOnly && !mIsPersonalOnly) {
mFilterAdapter.enableFilter(FILTER_APPS_PERSONAL);
mFilterAdapter.enableFilter(FILTER_APPS_WORK);
}