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

Commit 43321f13 authored by Kweku Adams's avatar Kweku Adams
Browse files

Handle price vs ctp inversion.

Handle cases where the adjusted price is lower than the cost to produce

Bug: 158300259
Test: N/A
Change-Id: I5f143849fd4fc1ed511c37e7cc98352b92350cb4
parent f9975966
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -146,8 +146,11 @@ class ProcessStateModifier extends Modifier {
                return 0;
            case PROC_STATE_BUCKET_FGS:
                // Can't get notification priority. Just use CTP for now.
                return ctp;
                return Math.min(ctp, price);
            case PROC_STATE_BUCKET_BFGS:
                if (price <= ctp) {
                    return price;
                }
                return (long) (ctp + .5 * (price - ctp));
            case PROC_STATE_BUCKET_BG:
            default: