Launchers that don't support managed profiles cannot be selected

If there is a managed profile, launchers that don't support managed profiles
cannot be selected as default Home

Change-Id: I7a19b5951402ec87a48464d783a539a607adabfe
Fix: 62013411
Test: m RunSettingsRoboTests
This commit is contained in:
Esteban Talavera
2017-05-25 11:23:04 +01:00
parent 0a6d61883c
commit 11e4b2c3f1
2 changed files with 86 additions and 7 deletions

View File

@@ -63,13 +63,15 @@ public class DefaultHomePicker extends DefaultAppPickerFragment {
}
final String summary;
boolean enabled = true;
if (mustSupportManagedProfile && !launcherHasManagedProfilesFeature(resolveInfo)) {
summary = getContext().getString(R.string.home_work_profile_not_supported);
enabled = false;
} else {
summary = null;
}
final DefaultAppInfo candidate =
new DefaultAppInfo(mPm, mUserId, activityName, summary);
new DefaultAppInfo(mPm, mUserId, activityName, summary, enabled);
candidates.add(candidate);
}
return candidates;