Search code examples
androidandroid-activityprofileuser-profiledevice-owner

Unable to Creating Work Profile (Profile owner) in Some Android 5.0+ devices?


I am facing one problem and i am not getting solution on internet. My problem is- in some devices like samsung and motorola which have android 5.0+ version i am unable to create work profile(TestDPC app on playstore). What's the reason please if anybody know explain it please. This is the code checked by android at time of work profile creation-

  PackageManager pm=getPackageManager();
    System.out.println(" can create profile="+ pm.hasSystemFeature(PackageManager.FEATURE_MANAGED_USERS));

Is There an option to change that thing so that i can create a work profile in every device.

Thank you


Solution

  • By checking code

    pm.hasSystemFeature(PackageManager.FEATURE_MANAGED_USERS));
    

    if device has a managed user than only it can create a work profile otherwise won't allow to create work profile.Device should have this managed user feature.