Loading src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java +12 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.pm.ActivityInfo; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.UserProperties; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; Loading Loading @@ -156,12 +157,23 @@ public class DeviceAdminListPreferenceController extends BasePreferenceControlle mAdmins.clear(); final List<UserHandle> profiles = mUm.getUserProfiles(); for (UserHandle profile : profiles) { if (shouldSkipProfile(profile)) { continue; } final int profileId = profile.getIdentifier(); updateAvailableAdminsForProfile(profileId); } Collections.sort(mAdmins); } private boolean shouldSkipProfile(UserHandle profile) { return android.os.Flags.allowPrivateProfile() && android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace() && mUm.isQuietModeEnabled(profile) && mUm.getUserProperties(profile).getShowInQuietMode() == UserProperties.SHOW_IN_QUIET_MODE_HIDDEN; } private void refreshUI() { if (mPreferenceGroup == null) { return; Loading src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java +12 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.UserInfo; import android.content.pm.UserProperties; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.VpnManager; Loading Loading @@ -220,6 +221,9 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe public int getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile() { int activeAdmins = 0; for (final UserInfo userInfo : mUm.getProfiles(MY_USER_ID)) { if (shouldSkipProfile(userInfo)) { continue; } final List<ComponentName> activeAdminsForUser = mDpm.getActiveAdminsAsUser(userInfo.id); if (activeAdminsForUser != null) { Loading Loading @@ -250,6 +254,14 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe return false; } private boolean shouldSkipProfile(UserInfo userInfo) { return android.os.Flags.allowPrivateProfile() && android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace() && userInfo.isQuietModeEnabled() && mUm.getUserProperties(userInfo.getUserHandle()).getShowInQuietMode() == UserProperties.SHOW_IN_QUIET_MODE_HIDDEN; } private Intent getParentalControlsIntent() { final ComponentName componentName = mDpm.getProfileOwnerOrDeviceOwnerSupervisionComponent(new UserHandle(MY_USER_ID)); Loading Loading
src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java +12 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.pm.ActivityInfo; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.UserProperties; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; Loading Loading @@ -156,12 +157,23 @@ public class DeviceAdminListPreferenceController extends BasePreferenceControlle mAdmins.clear(); final List<UserHandle> profiles = mUm.getUserProfiles(); for (UserHandle profile : profiles) { if (shouldSkipProfile(profile)) { continue; } final int profileId = profile.getIdentifier(); updateAvailableAdminsForProfile(profileId); } Collections.sort(mAdmins); } private boolean shouldSkipProfile(UserHandle profile) { return android.os.Flags.allowPrivateProfile() && android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace() && mUm.isQuietModeEnabled(profile) && mUm.getUserProperties(profile).getShowInQuietMode() == UserProperties.SHOW_IN_QUIET_MODE_HIDDEN; } private void refreshUI() { if (mPreferenceGroup == null) { return; Loading
src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java +12 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.UserInfo; import android.content.pm.UserProperties; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.VpnManager; Loading Loading @@ -220,6 +221,9 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe public int getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile() { int activeAdmins = 0; for (final UserInfo userInfo : mUm.getProfiles(MY_USER_ID)) { if (shouldSkipProfile(userInfo)) { continue; } final List<ComponentName> activeAdminsForUser = mDpm.getActiveAdminsAsUser(userInfo.id); if (activeAdminsForUser != null) { Loading Loading @@ -250,6 +254,14 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe return false; } private boolean shouldSkipProfile(UserInfo userInfo) { return android.os.Flags.allowPrivateProfile() && android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace() && userInfo.isQuietModeEnabled() && mUm.getUserProperties(userInfo.getUserHandle()).getShowInQuietMode() == UserProperties.SHOW_IN_QUIET_MODE_HIDDEN; } private Intent getParentalControlsIntent() { final ComponentName componentName = mDpm.getProfileOwnerOrDeviceOwnerSupervisionComponent(new UserHandle(MY_USER_ID)); Loading