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

Commit 87e893a4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix wrong array index bound in NotificationUsageStats"

parents 476d58c6 ea50f804
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import org.json.JSONException;
import org.json.JSONObject;

import java.io.PrintWriter;
import java.lang.Math;
import java.util.ArrayDeque;
import java.util.Calendar;
import java.util.GregorianCalendar;
@@ -718,7 +719,7 @@ public class NotificationUsageStats {
        }

        void increment(int imp) {
            imp = imp < 0 ? 0 : imp > NUM_IMPORTANCES ? NUM_IMPORTANCES : imp;
            imp = Math.max(0, Math.min(imp, mCount.length - 1));
            mCount[imp]++;
        }