Starting from Lollipop, Android introduced Multiple user profiles.Where user can add new user or a guest user.My application will be installed in Owner profile.When a message is received to my application it play audio on loudspeaker.
So Basically i want to detect where device is running in Owner profile at the specific point ?
Ex: XxxManager.isOwnerProfileActive();
NOTE: There is way where app can figure out if the profile is in Background/ foreground.Using the Intent.ACTION_USER_BACKGROUND / Intent.ACTION_USER_FOREGROUND which will be broadcasted by system.But i am looking for an API.