From 3e504beb1e92c03163d71d85c41dd11fe74bcb2c Mon Sep 17 00:00:00 2001 From: Deep Date: Sat, 21 Nov 2020 13:43:32 -0500 Subject: [PATCH] Fix format issue for brave stats --- .../chrome/browser/local_database/DatabaseHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java b/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java index f19cff850fe7..d605b28f068e 100644 --- a/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java +++ b/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java @@ -297,7 +297,7 @@ public long insertSavedBandwidth(SavedBandwidthTable savedBandwidthTable) { } public long getTotalSavedBandwidthWithDate(String thresholdTime, String currentTime) { - int sum = 0; + long sum = 0; String selectQuery = "SELECT SUM(" + SavedBandwidthTable.COLUMN_SAVED_BANDWIDTH + ") as total FROM " + SavedBandwidthTable.TABLE_NAME + " WHERE " + BraveStatsTable.COLUMN_TIMESTAMP @@ -307,14 +307,14 @@ public long getTotalSavedBandwidthWithDate(String thresholdTime, String currentT Cursor cursor = db.rawQuery(selectQuery, null); if (cursor.moveToFirst()) - sum = cursor.getInt(cursor.getColumnIndex("total")); + sum = cursor.getLong(cursor.getColumnIndex("total")); cursor.close(); return sum; } public long getTotalSavedBandwidth() { - int sum = 0; + long sum = 0; String selectQuery = "SELECT SUM(" + SavedBandwidthTable.COLUMN_SAVED_BANDWIDTH + ") as total FROM " + SavedBandwidthTable.TABLE_NAME; @@ -322,7 +322,7 @@ public long getTotalSavedBandwidth() { Cursor cursor = db.rawQuery(selectQuery, null); if (cursor.moveToFirst()) - sum = cursor.getInt(cursor.getColumnIndex("total")); + sum = cursor.getLong(cursor.getColumnIndex("total")); cursor.close(); return sum;