Measure walltime in ContentResolver and SQLiteDatabase operations logging.
The forgotten parts from Id72f718c / d72f718c9c. Whoops.
Tested by watching a device's logcat -b events and observing no huge
or negative values. And this time with the right system.img file,
even!
diff --git a/core/java/android/database/sqlite/SQLiteQuery.java b/core/java/android/database/sqlite/SQLiteQuery.java
index 5bcad4b..7cd9561 100644
--- a/core/java/android/database/sqlite/SQLiteQuery.java
+++ b/core/java/android/database/sqlite/SQLiteQuery.java
@@ -17,7 +17,7 @@
package android.database.sqlite;
import android.database.CursorWindow;
-import android.os.Debug;
+import android.os.SystemClock;
import android.util.Log;
/**
@@ -57,7 +57,7 @@
*/
/* package */ int fillWindow(CursorWindow window,
int maxRead, int lastPos) {
- long timeStart = Debug.threadCpuTimeNanos();
+ long timeStart = SystemClock.uptimeMillis();
mDatabase.lock();
try {
diff --git a/core/java/android/database/sqlite/SQLiteStatement.java b/core/java/android/database/sqlite/SQLiteStatement.java
index f1f5a2a..f29b69f 100644
--- a/core/java/android/database/sqlite/SQLiteStatement.java
+++ b/core/java/android/database/sqlite/SQLiteStatement.java
@@ -16,7 +16,7 @@
package android.database.sqlite;
-import android.os.Debug;
+import android.os.SystemClock;
/**
* A pre-compiled statement against a {@link SQLiteDatabase} that can be reused.
@@ -44,7 +44,7 @@
* some reason
*/
public void execute() {
- long timeStart = Debug.threadCpuTimeNanos();
+ long timeStart = SystemClock.uptimeMillis();
mDatabase.lock();
acquireReference();
@@ -68,7 +68,7 @@
* some reason
*/
public long executeInsert() {
- long timeStart = Debug.threadCpuTimeNanos();
+ long timeStart = SystemClock.uptimeMillis();
mDatabase.lock();
acquireReference();
@@ -91,7 +91,7 @@
* @throws android.database.sqlite.SQLiteDoneException if the query returns zero rows
*/
public long simpleQueryForLong() {
- long timeStart = Debug.threadCpuTimeNanos();
+ long timeStart = SystemClock.uptimeMillis();
mDatabase.lock();
acquireReference();
@@ -114,7 +114,7 @@
* @throws android.database.sqlite.SQLiteDoneException if the query returns zero rows
*/
public String simpleQueryForString() {
- long timeStart = Debug.threadCpuTimeNanos();
+ long timeStart = SystemClock.uptimeMillis();
mDatabase.lock();
acquireReference();