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

Commit e407a608 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick
Browse files

resolved conflicts for merge of 7d6362de to master

Change-Id: Ic26dd6d617f0edba549c992256511613df00caa6
parents df0089e1 7d6362de
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ import android.util.EventLog;
import android.util.Log;
import android.util.Pair;

import dalvik.system.BlockGuard;

import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@@ -1360,6 +1362,7 @@ public class SQLiteDatabase extends SQLiteClosable {
            CursorFactory cursorFactory, String sql, String[] selectionArgs,
            String editTable) {
        verifyDbIsOpen();
        BlockGuard.getThreadPolicy().onReadFromDisk();
        long timeStart = 0;

        if (Config.LOGV || mSlowQueryThreshold != -1) {
@@ -1519,6 +1522,7 @@ public class SQLiteDatabase extends SQLiteClosable {
    public long insertWithOnConflict(String table, String nullColumnHack,
            ContentValues initialValues, int conflictAlgorithm) {
        verifyDbIsOpen();
        BlockGuard.getThreadPolicy().onWriteToDisk();

        // Measurements show most sql lengths <= 152
        StringBuilder sql = new StringBuilder(152);
@@ -1608,6 +1612,7 @@ public class SQLiteDatabase extends SQLiteClosable {
     */
    public int delete(String table, String whereClause, String[] whereArgs) {
        verifyDbIsOpen();
        BlockGuard.getThreadPolicy().onWriteToDisk();
        lock();
        SQLiteStatement statement = null;
        try {
@@ -1660,6 +1665,7 @@ public class SQLiteDatabase extends SQLiteClosable {
     */
    public int updateWithOnConflict(String table, ContentValues values,
            String whereClause, String[] whereArgs, int conflictAlgorithm) {
        BlockGuard.getThreadPolicy().onWriteToDisk();
        if (values == null || values.size() == 0) {
            throw new IllegalArgumentException("Empty values");
        }
@@ -1749,6 +1755,7 @@ public class SQLiteDatabase extends SQLiteClosable {
     */
    public void execSQL(String sql) throws SQLException {
        verifyDbIsOpen();
        BlockGuard.getThreadPolicy().onWriteToDisk();
        long timeStart = SystemClock.uptimeMillis();
        lock();
        logTimeStat(mLastSqlStatement, timeStart, GET_LOCK_LOG_PREFIX);
@@ -1810,6 +1817,7 @@ public class SQLiteDatabase extends SQLiteClosable {
     * @throws SQLException If the SQL string is invalid for some reason
     */
    public void execSQL(String sql, Object[] bindArgs) throws SQLException {
        BlockGuard.getThreadPolicy().onWriteToDisk();
        if (bindArgs == null) {
            throw new IllegalArgumentException("Empty bindArgs");
        }
+6 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package android.database.sqlite;

import android.os.SystemClock;

import dalvik.system.BlockGuard;

/**
 * A pre-compiled statement against a {@link SQLiteDatabase} that can be reused.
 * The statement cannot return multiple rows, but 1x1 result sets are allowed.
@@ -48,6 +50,7 @@ public class SQLiteStatement extends SQLiteProgram
     */
    public void execute() {
        mDatabase.verifyDbIsOpen();
        BlockGuard.getThreadPolicy().onWriteToDisk();
        long timeStart = SystemClock.uptimeMillis();
        mDatabase.lock();

@@ -73,6 +76,7 @@ public class SQLiteStatement extends SQLiteProgram
     */
    public long executeInsert() {
        mDatabase.verifyDbIsOpen();
        BlockGuard.getThreadPolicy().onWriteToDisk();
        long timeStart = SystemClock.uptimeMillis();
        mDatabase.lock();

@@ -98,6 +102,7 @@ public class SQLiteStatement extends SQLiteProgram
     */
    public long simpleQueryForLong() {
        mDatabase.verifyDbIsOpen();
        BlockGuard.getThreadPolicy().onReadFromDisk();
        long timeStart = SystemClock.uptimeMillis();
        mDatabase.lock();

@@ -123,6 +128,7 @@ public class SQLiteStatement extends SQLiteProgram
     */
    public String simpleQueryForString() {
        mDatabase.verifyDbIsOpen();
        BlockGuard.getThreadPolicy().onReadFromDisk();
        long timeStart = SystemClock.uptimeMillis();
        mDatabase.lock();