I am trying to disable one of the app from my app. I have created a launcher app and trying to use following method of package manager
pm.setApplicationEnabledSetting(packageInfo.packageName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
But I'm getting SecurityException as SecurityException: Permission Denial: attempt to change component state from pid=20217, uid=10066, package uid=10067
Note: Somewhere I found the solution to this is to mention below permission in manifest
But I'm getting a warning in this permission that this permission is only granted to system apps.