hi i am working in framework side implementing one test app to disable another app but when i run my test app it is showing
Java.lang.SecurityException: Permission Denial: attempt to change component state from pid=xxx,uid=xxxx,package uid=xxx
at xxxxxxxx
my java code
PackageManager pm = getApplicationContext().getPackagemanager();
pm.setComponentEnabledSetting(new ComponentName("com.example","MainActivity"),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,PackageManager.DONT_KILL_APP);
AndroidManifest.xml
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE>
i have tried above permission with both (Permission is only granted to system apps) and also tried tag but no lucky
how to use system apps granted permission,
Could you please guys help me to resolve this issue
Thanks in advance