0

I want to make a list of all user apps installed, and give the user the option to hide a app that he want. I have a rooted device, but when try to hide a selected app, gives me this error :

Permission Denial: attempt to change component state from pid=19832, uid=10158, package uid=10143.

This is the code i used to hide: input is the package name and xclass is the laucher activity

    ComponentName componentToDisable =
            new ComponentName(""+input,
            ""+xclass);

            getPackageManager().setComponentEnabledSetting(
            componentToDisable,
            PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
            PackageManager.DONT_KILL_APP);

Manifest permissions :

<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INJECT_EVENTS"
    tools:ignore="ProtectedPermissions" />   
Konrad Krakowiak
  • 12,285
  • 11
  • 58
  • 45
Fil Mig
  • 1
  • 1
  • This link might be useful for you, http://stackoverflow.com/questions/8398514/hide-application-icon – dhun Apr 16 '15 at 14:46
  • Thanks dhun. But that is for hide our app icon. I have already try that part of the code (of hide the icon app), but gives me the same error. – Fil Mig Apr 16 '15 at 14:57

0 Answers0