From 589e7e42e316ddb6a2aeec61e31f7b2a42d96549 Mon Sep 17 00:00:00 2001 From: Lee Shombert Date: Wed, 28 Feb 2024 09:17:26 -0800 Subject: Do not disclose the database name in sqlite logs This only affects informational logs. Test: presubmit Bug: 325789335 Change-Id: I6c04fd8abbe8a66b8485a6151da7504b47c22f16 --- core/java/android/database/sqlite/SQLiteConnection.java | 2 -- core/java/android/database/sqlite/SQLiteOpenHelper.java | 8 +------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/core/java/android/database/sqlite/SQLiteConnection.java b/core/java/android/database/sqlite/SQLiteConnection.java index 4b3eb3a000ff..0d2a8cbd7795 100644 --- a/core/java/android/database/sqlite/SQLiteConnection.java +++ b/core/java/android/database/sqlite/SQLiteConnection.java @@ -379,8 +379,6 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen return; } - Log.i(TAG, walFile.getAbsolutePath() + " " + size + " bytes: Bigger than " - + threshold + "; truncating"); try { executeForString("PRAGMA wal_checkpoint(TRUNCATE)", null, null); mConfiguration.shouldTruncateWalFile = false; diff --git a/core/java/android/database/sqlite/SQLiteOpenHelper.java b/core/java/android/database/sqlite/SQLiteOpenHelper.java index 5e523c0112b1..78c8954cfe5f 100644 --- a/core/java/android/database/sqlite/SQLiteOpenHelper.java +++ b/core/java/android/database/sqlite/SQLiteOpenHelper.java @@ -377,8 +377,7 @@ public abstract class SQLiteOpenHelper implements AutoCloseable { if (writable) { throw ex; } - Log.e(TAG, "Couldn't open " + mName - + " for writing (will try read-only):", ex); + Log.e(TAG, "Couldn't open database for writing (will try read-only):", ex); params = params.toBuilder().addOpenFlags(SQLiteDatabase.OPEN_READONLY).build(); db = SQLiteDatabase.openDatabase(filePath, params); } @@ -425,11 +424,6 @@ public abstract class SQLiteOpenHelper implements AutoCloseable { } onOpen(db); - - if (db.isReadOnly()) { - Log.w(TAG, "Opened " + mName + " in read-only mode"); - } - mDatabase = db; return db; } finally { -- cgit v1.2.3-59-g8ed1b