android - How to query all the download item from the system DownloadProvider? -
is there method query download item system downloadprovider,i that,but need permission:android.permission.access_all_downloads,and worstly,this permission in signature level,i can't permission,is there other solution this.and want develop app manager downloads of system.thanks lot!
int columnid = c.getcolumnindex(downloadmanager.column_id); int columntitle = c.getcolumnindex(downloadmanager.column_title); log.d(tag, "query complete!-->" + c.getcount()); (int = 0; c.getcolumnname(i) != null; i++) log.d(tag, c.getcolumnname(i)); while (c.movetonext()) { int status = c.getint(c.getcolumnindex(downloadmanager.column_status)); long id = c.getlong(c.getcolumnindex(downloadmanager.column_id)); string title = c.getstring(c.getcolumnindex(downloadmanager.column_title)); switch (status) { case downloadmanager.status_paused: log.d(tag, "query 1 paused task:" + status + "-" + title + "-" + id); break; case downloadmanager.status_pending: log.d(tag, "query 1 pending task:" + status + "-" + title + "-" + id); break; case downloadmanager.status_running: log.d(tag, "query 1 running task:" + status + "-" + title + "-" + id); break; case downloadmanager.status_successful: log.d(tag, "query 1 success task:" + status + "-" + title + "-" + id); break; case downloadmanager.status_failed: log.d(tag, "query 1 failed task:" + status + "-" + title + "-" + id); // downloadmanager.remove(id); break; } }
as discovered, way query content://downloads/all_downloads
uri android.permission.access_all_downloads
, signature level permission. intentional , means not possible read downloads third party app not signed system signature.
Comments
Post a Comment