Merge "Fix job scheduler constant"
This commit is contained in:
@@ -373,4 +373,57 @@ public class KeyValueListParser {
|
||||
proto.write(tag, mValue);
|
||||
}
|
||||
}
|
||||
|
||||
/** Represents an float config value. */
|
||||
public static class FloatValue {
|
||||
private final String mKey;
|
||||
private final float mDefaultValue;
|
||||
private float mValue;
|
||||
|
||||
/** Constructor, initialize with a config key and a default value. */
|
||||
public FloatValue(String key, float defaultValue) {
|
||||
mKey = key;
|
||||
mDefaultValue = defaultValue;
|
||||
mValue = mDefaultValue;
|
||||
}
|
||||
|
||||
/** Read a value from {@link KeyValueListParser} */
|
||||
public void parse(KeyValueListParser parser) {
|
||||
mValue = parser.getFloat(mKey, mDefaultValue);
|
||||
}
|
||||
|
||||
/** Return the config key. */
|
||||
public String getKey() {
|
||||
return mKey;
|
||||
}
|
||||
|
||||
/** Return the default value. */
|
||||
public float getDefaultValue() {
|
||||
return mDefaultValue;
|
||||
}
|
||||
|
||||
/** Return the actual config value. */
|
||||
public float getValue() {
|
||||
return mValue;
|
||||
}
|
||||
|
||||
/** Overwrites with a value. */
|
||||
public void setValue(float value) {
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
/** Used for dumpsys */
|
||||
public void dump(PrintWriter pw, String prefix) {
|
||||
pw.print(prefix);
|
||||
pw.print(mKey);
|
||||
pw.print("=");
|
||||
pw.print(mValue);
|
||||
pw.println();
|
||||
}
|
||||
|
||||
/** Used for proto dumpsys */
|
||||
public void dumpProto(ProtoOutputStream proto, long tag) {
|
||||
proto.write(tag, mValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -810,6 +810,8 @@ public class JobSchedulerService extends com.android.server.SystemService
|
||||
MAX_JOB_COUNTS_SCREEN_OFF.low.parse(mParser);
|
||||
MAX_JOB_COUNTS_SCREEN_OFF.critical.parse(mParser);
|
||||
|
||||
SCREEN_OFF_JOB_CONCURRENCY_INCREASE_DELAY_MS.parse(mParser);
|
||||
|
||||
MAX_STANDARD_RESCHEDULE_COUNT = mParser.getInt(KEY_MAX_STANDARD_RESCHEDULE_COUNT,
|
||||
DEFAULT_MAX_STANDARD_RESCHEDULE_COUNT);
|
||||
MAX_WORK_RESCHEDULE_COUNT = mParser.getInt(KEY_MAX_WORK_RESCHEDULE_COUNT,
|
||||
|
||||
Reference in New Issue
Block a user