Android Lollipop - Check if a work profile is set up for the user

658 views Asked by At

I would like to find a way to know, from the user profile, if a work profile (profile owner) has been set up for the user.

I'm currently using this method:

public boolean isWorkProfileEnabled() {
    UserManager um = (UserManager) getSystemService(USER_SERVICE);
    return um.getUserProfiles().size() >= 2;
}

But this is not reliable. When it's equal 2, it can also mean a restricted profile is installed.

Someone has an idea?

0

There are 0 answers