Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: DownloadManager and COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED

I'm trying to work around disabled Download Manager correctly. Best info I could find is How to Enable Android Download Manager.

PackageManager.COMPONENT_ENABLED_STATE_DISABLED and PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER states are quite understandable for me.

But after hour of googling I'm still confused with PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED.

Documentation reads:

Flag for setApplicationEnabledSetting(String, int, int) only: This application should be considered, until the point where the user actually wants to use it. This means that it will not normally show up to the user (such as in the launcher), but various parts of the user interface can use GET_DISABLED_UNTIL_USED_COMPONENTS to still see it and allow the user to select it (as for example an IME, device admin, etc). Such code, once the user has selected the app, should at that point also make it enabled. This option currently can not be used with setComponentEnabledSetting(ComponentName, int, int).

Does it mean that I should consider this state as enabled?

How can user select DownloadManager? How can it show up?

like image 385
George Sovetov Avatar asked Nov 14 '16 10:11

George Sovetov


1 Answers

You can get the notify when ever DownloadManager is available setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)

like image 72
Sanat Chandravanshi Avatar answered Oct 02 '22 12:10

Sanat Chandravanshi