YieldTransaction should actually commit the transaction.

Bug: 6239243
Change-Id: I2e0dfb0c8f0b062674cc2a1c14955eba9a4b9df3
diff --git a/core/java/android/database/sqlite/SQLiteSession.java b/core/java/android/database/sqlite/SQLiteSession.java
index 43efb03..9410243 100644
--- a/core/java/android/database/sqlite/SQLiteSession.java
+++ b/core/java/android/database/sqlite/SQLiteSession.java
@@ -398,16 +398,16 @@
         throwIfNoTransaction();
         assert mConnection != null;
 
-        endTransactionUnchecked(cancellationSignal);
+        endTransactionUnchecked(cancellationSignal, false);
     }
 
-    private void endTransactionUnchecked(CancellationSignal cancellationSignal) {
+    private void endTransactionUnchecked(CancellationSignal cancellationSignal, boolean yielding) {
         if (cancellationSignal != null) {
             cancellationSignal.throwIfCanceled();
         }
 
         final Transaction top = mTransactionStack;
-        boolean successful = top.mMarkedSuccessful && !top.mChildFailed;
+        boolean successful = (top.mMarkedSuccessful || yielding) && !top.mChildFailed;
 
         RuntimeException listenerException = null;
         final SQLiteTransactionListener listener = top.mListener;
@@ -534,7 +534,7 @@
         final int transactionMode = mTransactionStack.mMode;
         final SQLiteTransactionListener listener = mTransactionStack.mListener;
         final int connectionFlags = mConnectionFlags;
-        endTransactionUnchecked(cancellationSignal); // might throw
+        endTransactionUnchecked(cancellationSignal, true); // might throw
 
         if (sleepAfterYieldDelayMillis > 0) {
             try {