Loading core/java/android/content/AbstractSyncableContentProvider.java +6 −10 Original line number Original line Diff line number Diff line Loading @@ -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() { Loading Loading @@ -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> Loading @@ -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(); } } } } Loading Loading
core/java/android/content/AbstractSyncableContentProvider.java +6 −10 Original line number Original line Diff line number Diff line Loading @@ -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() { Loading Loading @@ -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> Loading @@ -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(); } } } } Loading