mirror of
https://github.com/androidx/media.git
synced 2025-05-06 23:20:42 +08:00

The way it is currently, it's very unclear that an operation on the version table will correctly belong to a transaction in code such as this, taken from DefaultDownloadIndex: writableDatabase.beginTransaction(); try { writableDatabase.execSQL(...); versionTable.setVersion(...); writableDatabase.setTransactionSuccessful(); } finally { writableDatabase.endTransaction(); } This change explicitly passes the database, to make it obvious that the operation will really go into the same transaction: writableDatabase.beginTransaction(); try { writableDatabase.execSQL(....); VersionTable.setVersion(writableDatabase, ...); writableDatabase.setTransactionSuccessful(); } finally { writableDatabase.endTransaction(); } PiperOrigin-RevId: 231374933