Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fef73ef8 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Don't show DND access settings in managed users

Test: launch direct intent in a managed user
Fixes: 187304252
Change-Id: I1cfcf8c147fc47b4e2fb2a725cba9846e4f09055
parent f9ebf660
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -24,8 +24,11 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.ArraySet;
import android.view.View;
import android.util.Log;

import androidx.preference.PreferenceScreen;

@@ -92,6 +95,11 @@ public class ZenAccessSettings extends EmptyTextSettings implements
    }

    private void reloadList() {
        if (mContext.getSystemService(UserManager.class)
                .isManagedProfile(UserHandle.myUserId())) {
            Log.w(TAG, "DND access cannot be enabled in a work profile");
            return;
        }
        final PreferenceScreen screen = getPreferenceScreen();
        screen.removeAll();
        final ArrayList<ApplicationInfo> apps = new ArrayList<>();