changes to support Change-Id: I572fdfd6d34dbb5a0577c6cf14664b6f2d5700b4

1. add new column constants for : COLUMN_last_updatesrc
2. send downloadid in the uri wherever possible.
Change-Id: I49a18506060bf292a0750790042e94b0a35ea9bf
This commit is contained in:
Vasu Nori
2010-11-17 17:14:49 -08:00
parent dd688b600c
commit 8da7a4e345
2 changed files with 27 additions and 0 deletions

View File

@@ -841,6 +841,12 @@ public class DownloadManager {
}
ContentValues values = new ContentValues();
values.put(Downloads.Impl.COLUMN_DELETED, 1);
// if only one id is passed in, then include it in the uri itself.
// this will eliminate a full database scan in the download service.
if (ids.length == 1) {
return mResolver.update(ContentUris.withAppendedId(mBaseUri, ids[0]), values,
null, null);
}
return mResolver.update(mBaseUri, values, getWhereClauseForIds(ids),
getWhereArgsForIds(ids));
}

View File

@@ -382,6 +382,27 @@ public final class Downloads {
*/
public static final String COLUMN_ERROR_MSG = "errorMsg";
/**
* This column stores the source of the last update to this row.
* This column is only for internal use.
* Valid values are indicated by LAST_UPDATESRC_* constants.
* <P>Type: INT</P>
*/
public static final String COLUMN_LAST_UPDATESRC = "lastUpdateSrc";
/**
* default value for {@link #COLUMN_LAST_UPDATESRC}.
* This value is used when this column's value is not relevant.
*/
public static final int LAST_UPDATESRC_NOT_RELEVANT = 0;
/**
* One of the values taken by {@link #COLUMN_LAST_UPDATESRC}.
* This value is used when the update is NOT to be relayed to the DownloadService
* (and thus spare DownloadService from scanning the database when this change occurs)
*/
public static final int LAST_UPDATESRC_DONT_NOTIFY_DOWNLOADSVC = 1;
/*
* Lists the destinations that an application can specify for a download.
*/