Merge "Allow modifying minimum consumption limit."

This commit is contained in:
Kweku Adams
2022-10-31 18:54:23 +00:00
committed by Android (Google) Code Review
4 changed files with 24 additions and 10 deletions

View File

@@ -117,7 +117,8 @@ public class AlarmManagerFragment extends Fragment implements
mKeys = new String[][]{
{
EconomyManager.KEY_AM_INITIAL_CONSUMPTION_LIMIT,
EconomyManager.KEY_AM_HARD_CONSUMPTION_LIMIT
EconomyManager.KEY_AM_MIN_CONSUMPTION_LIMIT,
EconomyManager.KEY_AM_MAX_CONSUMPTION_LIMIT,
},
{
EconomyManager.KEY_AM_MAX_SATIATED_BALANCE,

View File

@@ -118,7 +118,8 @@ public class JobSchedulerFragment extends Fragment implements
mKeys = new String[][]{
{
EconomyManager.KEY_JS_INITIAL_CONSUMPTION_LIMIT,
EconomyManager.KEY_JS_HARD_CONSUMPTION_LIMIT
EconomyManager.KEY_JS_MIN_CONSUMPTION_LIMIT,
EconomyManager.KEY_JS_MAX_CONSUMPTION_LIMIT,
},
{
EconomyManager.KEY_JS_MAX_SATIATED_BALANCE,

View File

@@ -117,9 +117,13 @@ public class TareFactorController {
new TareFactorData(mResources.getString(R.string.tare_initial_consumption_limit),
EconomyManager.DEFAULT_AM_INITIAL_CONSUMPTION_LIMIT_CAKES,
POLICY_ALARM_MANAGER));
mAlarmManagerMap.put(EconomyManager.KEY_AM_HARD_CONSUMPTION_LIMIT,
new TareFactorData(mResources.getString(R.string.tare_hard_consumption_limit),
EconomyManager.DEFAULT_AM_HARD_CONSUMPTION_LIMIT_CAKES,
mAlarmManagerMap.put(EconomyManager.KEY_AM_MIN_CONSUMPTION_LIMIT,
new TareFactorData(mResources.getString(R.string.tare_min_consumption_limit),
EconomyManager.DEFAULT_AM_MIN_CONSUMPTION_LIMIT_CAKES,
POLICY_ALARM_MANAGER));
mAlarmManagerMap.put(EconomyManager.KEY_AM_MAX_CONSUMPTION_LIMIT,
new TareFactorData(mResources.getString(R.string.tare_max_consumption_limit),
EconomyManager.DEFAULT_AM_MAX_CONSUMPTION_LIMIT_CAKES,
POLICY_ALARM_MANAGER));
mAlarmManagerMap.put(EconomyManager.KEY_AM_REWARD_TOP_ACTIVITY_INSTANT,
new TareFactorData(mResources.getString(R.string.tare_top_activity),
@@ -306,9 +310,13 @@ public class TareFactorController {
new TareFactorData(mResources.getString(R.string.tare_initial_consumption_limit),
EconomyManager.DEFAULT_JS_INITIAL_CONSUMPTION_LIMIT_CAKES,
POLICY_JOB_SCHEDULER));
mJobSchedulerMap.put(EconomyManager.KEY_JS_HARD_CONSUMPTION_LIMIT,
new TareFactorData(mResources.getString(R.string.tare_hard_consumption_limit),
EconomyManager.DEFAULT_JS_HARD_CONSUMPTION_LIMIT_CAKES,
mJobSchedulerMap.put(EconomyManager.KEY_JS_MIN_CONSUMPTION_LIMIT,
new TareFactorData(mResources.getString(R.string.tare_min_consumption_limit),
EconomyManager.DEFAULT_JS_MIN_CONSUMPTION_LIMIT_CAKES,
POLICY_JOB_SCHEDULER));
mJobSchedulerMap.put(EconomyManager.KEY_JS_MAX_CONSUMPTION_LIMIT,
new TareFactorData(mResources.getString(R.string.tare_max_consumption_limit),
EconomyManager.DEFAULT_JS_MAX_CONSUMPTION_LIMIT_CAKES,
POLICY_JOB_SCHEDULER));
mJobSchedulerMap.put(EconomyManager.KEY_JS_REWARD_APP_INSTALL_INSTANT,
new TareFactorData(mResources.getString(R.string.tare_app_install),