Skip to content
Commit 0fa31f69 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Introduce QUERY_ARG_MATCH_* values for filtering.

The existing strategy of methods like setIncludePending() doesn't
scale well for callers to use multiple matching strategies.  For
example, callers are interested in these matching strategies:

MATCH_EXCLUDE: Ensure that any matches are excluded.
MATCH_INCLUDE: Ensure that any matches are included.
MATCH_ONLY: Return only exact matches.

The reason why we have this menu of options is because the underlying
fields have different default behavior.  For example, "trashed" items
are naturally excluded by default, but "favorite" items are naturally
included by default.

Callers only interesting in listing "trashed" items or "favorite"
items shouldn't need to perform their own inefficient Cursor diffing
logic, so we give them these flexible arguments.

Adjust MediaProvider internals to apply these matcher values to
all update() and delete() calls, in addition to query().

Bug: 143432502
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I0d4bc063b8ea5ac2a602fab43a62c2de7724ba34
parent 847e6761
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment