Is it possible to disable apps without hiding them

2019-07-02 09:46发布

问题:

Background

End users can disable certain apps via the App manager which is built into the OS. This screen looks something like that (on some devices it says "Turn off" instead):

Once you disable an app, it will not be active and won't run in any way till you re-enable it again. However, in order to re-enable it, you can still find it on the app-manager, as shown here.

I'm trying to mimic this behavior on my "App Manager" app.

What I tried

Using the ADB tool (or using root and then the ADB tool), you can use the next command to disable apps:

adb shell pm disable APP_PACKAGE_NAME

where "APP_PACKAGE_NAME" is the package name of the app to disable.

The problem

If you use the ADB tool , the app you've chosen to disable will also get completely hidden from the app manager, even on the list of disabled apps.

The question

Is there an alternative to disabling apps, that will not hide apps when disabling them?

If so, what is it?