0

I've an application with DevicePolicyManager configured, on Android 5.0.1. I don't want to create a work profile and control it, but i want to control my own (default) profile and hide some applications.

When i try to use the setApplicationHidden API, i'm getting a security exception, saying i'm not the profile owner...

Is it possible somehow to be the owner of the default profile?

Thanks.

Sharas
  • 1,985
  • 3
  • 20
  • 43

1 Answers1

0

Android for Work has two modes: Profile Owner or Device Owner. If you don't want to create a Managed Profile (Profile Owner), you can use Device Owner.

The setApplicationHidden API only works in these two modes.

If you want to disable (hide) applications, look at PackageManager.setApplicationEnabledSetting API which can be used to disable applications. But you can only disable other applications than your own if you have the CHANGE_COMPONENT_ENABLED_STATE permission which requires platform signing or system rights. More info: android permission - CHANGE_COMPONENT_ENABLED_STATE .

Otherwise you will have to use proprietary APIs. I know for a fact that at least Sony and Samsung have such APIs (I work for Sony Mobile).

Community
  • 1
  • 1
Marek Pola
  • 200
  • 1
  • 10
  • Thank you, but this API requires permission that should not used by third -party applications as stated here: http://developer.android.com/reference/android/Manifest.permission.html#CHANGE_COMPONENT_ENABLED_STATE – Sharas Mar 25 '15 at 15:25
  • this is for rooted or system apps only, – Amin Pinjari May 29 '18 at 09:05