Skip to content

Commit 73667fe

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "YieldTransaction should actually commit the transaction."
2 parents 3df92c5 + d19ff5f commit 73667fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/java/android/database/sqlite/SQLiteSession.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,16 +398,16 @@ public void endTransaction(CancellationSignal cancellationSignal) {
398398
throwIfNoTransaction();
399399
assert mConnection != null;
400400

401-
endTransactionUnchecked(cancellationSignal);
401+
endTransactionUnchecked(cancellationSignal, false);
402402
}
403403

404-
private void endTransactionUnchecked(CancellationSignal cancellationSignal) {
404+
private void endTransactionUnchecked(CancellationSignal cancellationSignal, boolean yielding) {
405405
if (cancellationSignal != null) {
406406
cancellationSignal.throwIfCanceled();
407407
}
408408

409409
final Transaction top = mTransactionStack;
410-
boolean successful = top.mMarkedSuccessful && !top.mChildFailed;
410+
boolean successful = (top.mMarkedSuccessful || yielding) && !top.mChildFailed;
411411

412412
RuntimeException listenerException = null;
413413
final SQLiteTransactionListener listener = top.mListener;
@@ -534,7 +534,7 @@ private boolean yieldTransactionUnchecked(long sleepAfterYieldDelayMillis,
534534
final int transactionMode = mTransactionStack.mMode;
535535
final SQLiteTransactionListener listener = mTransactionStack.mListener;
536536
final int connectionFlags = mConnectionFlags;
537-
endTransactionUnchecked(cancellationSignal); // might throw
537+
endTransactionUnchecked(cancellationSignal, true); // might throw
538538

539539
if (sleepAfterYieldDelayMillis > 0) {
540540
try {

0 commit comments

Comments
 (0)