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

Commit b730e714 authored by Julia Reynolds's avatar Julia Reynolds Committed by android-build-merger
Browse files

Merge "Catch the SQLiteFullException in NotificationUsageStats." am:...

Merge "Catch the SQLiteFullException in NotificationUsageStats." am: 41537638 am: b73b5757 am: f1ddec0a
am: c50c5b0c

Change-Id: I7e091c671fb39317c9283af2f258b7d913029b4c
parents e9635f17 c50c5b0c
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteFullException;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Handler;
import android.os.HandlerThread;
@@ -1272,9 +1273,13 @@ public class NotificationUsageStats {
                sNumWrites = 0;
                sLastPruneMs = nowMs;
                long horizonStartMs = nowMs - HORIZON_MS;
                try {
                    int deletedRows = db.delete(TAB_LOG, COL_EVENT_TIME + " < ?",
                            new String[]{String.valueOf(horizonStartMs)});
                    Log.d(TAG, "Pruned event entries: " + deletedRows);
                } catch (SQLiteFullException e) {
                    Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
                }
            }
        }