Reputation: 4380
I want to prevent my Android app is running in my personal profile, when my work profile is activated, is there any way to check from my Android app, Android System activated work profile or not? Thank you
Upvotes: 2
Views: 1276
Reputation: 31
Please find the below code:
final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
if(um.isManagedProfile()){
Log.d(TAG,"It is work profile " );
}else{
Log.d(TAG,"It is a personal profile" );
}
have a look on https://developer.android.com/reference/android/os/UserManager#isManagedProfile()
Upvotes: 3