Consider a use case like, in a device testDPC app is installed and is running as a profile owner. My app ABC have installed and it is having two instance one is running inside the work profile(Badged) another is in personal profile(Non badged). Now I need to check programatically in my app whether it is in work/personal profile.
Android for work - How to check if my application is running in the work profile?
The answer above will not help me as it uses DevicePolicyManger which is only available for testDpc.
Also I could not find any flag indicating in ApplicationInfo api for the above https://developer.android.com/reference/android/content/pm/ApplicationInfo.html
Any help would appreciated.