Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72f3aa37 authored by Daisuke Miyakawa's avatar Daisuke Miyakawa
Browse files

Fix a bug in AbstractSyncableContentProvider.java and modify comments.

parent 7c3e18c5
Loading
Loading
Loading
Loading
+6 −10
Original line number Original line Diff line number Diff line
@@ -390,27 +390,24 @@ public abstract class AbstractSyncableContentProvider extends SyncableContentPro


    /**
    /**
     * <p>
     * <p>
     * Call mOpenHelper.getWritableDatabase() and mDb.beginTransaction().
     * Start batch transaction. {@link #endTransaction} MUST be called after 
     * {@link #endTransaction} MUST be called after calling this method.
     * calling this method. Those methods should be used like this:
     * Those methods should be used like this:
     * </p>
     * </p>
     *
     *
     * <pre class="prettyprint">
     * <pre class="prettyprint">
     * boolean successful = false;
     * boolean successful = false;
     * if (!beginTransaction()) {
     * beginBatch()
     *     return;
     * }
     * try {
     * try {
     *     // Do something related to mDb
     *     // Do something related to mDb
     *     successful = true;
     *     successful = true;
     *     return ret;
     *     return ret;
     * } finally {
     * } finally {
     *     endTransaction(successful);
     *     endBatch(successful);
     * }
     * }
     * </pre>
     * </pre>
     *
     *
     * @hide This method should be used only when {@link #applyBatch} is not enough and must be
     * @hide This method should be used only when {@link #applyBatch} is not enough and must be
     * used with {@link #endTransaction}.
     * used with {@link #endBatch}.
     * e.g. If returned value has to be used during one transaction, this method might be useful.
     * e.g. If returned value has to be used during one transaction, this method might be useful.
     */
     */
    public final void beginBatch() {
    public final void beginBatch() {
@@ -440,7 +437,7 @@ public abstract class AbstractSyncableContentProvider extends SyncableContentPro


    /**
    /**
     * <p>
     * <p>
     * Call mDb.endTransaction(). If successful is true, try to call
     * Finish batch transaction. If "successful" is true, try to call
     * mDb.setTransactionSuccessful() before calling mDb.endTransaction().
     * mDb.setTransactionSuccessful() before calling mDb.endTransaction().
     * This method MUST be used with {@link #beginBatch()}.
     * This method MUST be used with {@link #beginBatch()}.
     * </p>
     * </p>
@@ -461,7 +458,6 @@ public abstract class AbstractSyncableContentProvider extends SyncableContentPro
                getContext().getContentResolver().notifyChange(url, null /* observer */,
                getContext().getContentResolver().notifyChange(url, null /* observer */,
                        changeRequiresLocalSync(url));
                        changeRequiresLocalSync(url));
            }
            }
            mDb.endTransaction();
        }
        }
    }
    }