summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragment.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2020-01-13 21:39:15 -0700
committerJeff Sharkey <jsharkey@android.com>2020-01-13 21:39:18 -0700
commitbf8b367dd678419dda542346672b882cd58911b4 (patch)
treeede52297add7c62eae01239cfcca9406577e1538 /rs/java/android/renderscript/ProgramFragment.java
parent193c7167d5a79cb7e023f358f0783207297f1b0c (diff)
Introduce "generation" to track mutations.
Add generation numbers to the metadata for each media item. This is useful for apps that are attempting to quickly identify exactly which media items have changed since a previous point in time. Generation numbers are monotonically increasing over time, and can be safely arithmetically compared. Detecting media changes using generation numbers is more robust than using DATE_MODIFIED, since those values may change in unexpected ways when apps use File.setLastModified() or when the system clock is set incorrectly. This is implemented by ensuring that all mutations to go through our local SQLiteQueryBuilder, which then forces those mutations to always happen inside an active transaction. Then each time we create a transaction, we increment the generation counter, and force-copy the current generation into any mutation operations. This design also means that all mutations that should affect the generation counter must go through DatabaseHelper to ensure that the logic above is applied; there's mechanical refactoring across MediaProvider to accomplish this. Fix bug in getWritableDatabase() that could return a readable database. Fix bug in LegacyMediaProvider to create missing directories. Adjust logging script to enable log cleaner SQL from SQLQueryBuilder instead of noisy raw logs. Bug: 140248585 Test: atest --test-mapping packages/providers/MediaProvider Change-Id: If87f586e2340688ea1716682de20ee40c0d2b953
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragment.java')
0 files changed, 0 insertions, 0 deletions