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

Commit c55d812c authored by alinasuarez's avatar alinasuarez
Browse files

Listener on system side & Return correct values

A listener is needed on the system side to make sure the
CompleteEconomicPolicy class is updated when any factor in the
JobSchedulerEconomicPolicy or AlarmManagerEconomicPolicy is updated by
the user. Both economic policy classes should also return the correct
values for their factors: the value inputted by the user or the default
value if the user has not put in a new value.

Bug: 196083166

Test: Visually check output of 'adb shell dumpsys tare'

Change-Id: I0dbef4cb23fcfefeeee444bdca26015840270d3e
parent 8ac9f99c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ public class EconomyManager {
    /** @hide */
    public static final int DEFAULT_AM_REWARD_TOP_ACTIVITY_INSTANT = 0;
    /** @hide */
    public static final double DEFAULT_AM_REWARD_TOP_ACTIVITY_ONGOING = 0.01;
    public static final float DEFAULT_AM_REWARD_TOP_ACTIVITY_ONGOING = 0.01f;
    /** @hide */
    public static final int DEFAULT_AM_REWARD_TOP_ACTIVITY_MAX = 500;
    /** @hide */
@@ -372,7 +372,7 @@ public class EconomyManager {
    /** @hide */
    public static final int DEFAULT_JS_REWARD_TOP_ACTIVITY_INSTANT = 0;
    /** @hide */
    public static final double DEFAULT_JS_REWARD_TOP_ACTIVITY_ONGOING = 0.5;
    public static final float DEFAULT_JS_REWARD_TOP_ACTIVITY_ONGOING = 0.5f;
    /** @hide */
    public static final int DEFAULT_JS_REWARD_TOP_ACTIVITY_MAX = 15000;
    /** @hide */
+248 −27

File changed.

Preview size limit exceeded, changes collapsed.

+8 −0
Original line number Diff line number Diff line
@@ -66,6 +66,14 @@ public class CompleteEconomicPolicy extends EconomicPolicy {
        mMaxSatiatedCirculation = max;
    }

    @Override
    void setup() {
        super.setup();
        for (int i = 0; i < mEnabledEconomicPolicies.size(); ++i) {
            mEnabledEconomicPolicies.valueAt(i).setup();
        }
    }

    @Override
    public long getMinSatiatedBalance(final int userId, @NonNull final String pkgName) {
        long min = 0;
+241 −40

File changed.

Preview size limit exceeded, changes collapsed.