Loading apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1224,7 +1224,7 @@ public class DeviceIdleController extends SystemService IDLE_FACTOR = mParser.getFloat(KEY_IDLE_FACTOR, 2f); MIN_TIME_TO_ALARM = mParser.getDurationMillis(KEY_MIN_TIME_TO_ALARM, !COMPRESS_TIME ? 60 * 60 * 1000L : 6 * 60 * 1000L); !COMPRESS_TIME ? 30 * 60 * 1000L : 6 * 60 * 1000L); MAX_TEMP_APP_WHITELIST_DURATION = mParser.getDurationMillis( KEY_MAX_TEMP_APP_WHITELIST_DURATION, 5 * 60 * 1000L); MMS_TEMP_APP_WHITELIST_DURATION = mParser.getDurationMillis( Loading apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +8 −5 Original line number Diff line number Diff line Loading @@ -2182,17 +2182,18 @@ public class JobSchedulerService extends com.android.server.SystemService } final boolean jobExists = mJobs.containsJob(job); final boolean userStarted = areUsersStartedLocked(job); final boolean backingUp = mBackingUpUids.indexOfKey(job.getSourceUid()) >= 0; if (DEBUG) { Slog.v(TAG, "isReadyToBeExecutedLocked: " + job.toShortString() + " exists=" + jobExists + " userStarted=" + userStarted); + " exists=" + jobExists + " userStarted=" + userStarted + " backingUp=" + backingUp); } // These are also fairly cheap to check, though they typically will not // be conditions we fail. if (!jobExists || !userStarted) { if (!jobExists || !userStarted || backingUp) { return false; } Loading Loading @@ -2265,15 +2266,17 @@ public class JobSchedulerService extends com.android.server.SystemService final boolean jobExists = mJobs.containsJob(job); final boolean userStarted = areUsersStartedLocked(job); final boolean backingUp = mBackingUpUids.indexOfKey(job.getSourceUid()) >= 0; if (DEBUG) { Slog.v(TAG, "areComponentsInPlaceLocked: " + job.toShortString() + " exists=" + jobExists + " userStarted=" + userStarted); + " exists=" + jobExists + " userStarted=" + userStarted + " backingUp=" + backingUp); } // These are also fairly cheap to check, though they typically will not // be conditions we fail. if (!jobExists || !userStarted) { if (!jobExists || !userStarted || backingUp) { return false; } Loading cmds/statsd/Android.bp +8 −1 Original line number Diff line number Diff line Loading @@ -291,7 +291,14 @@ cc_binary { cc_test { name: "statsd_test", defaults: ["statsd_defaults"], test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], //TODO(b/153588990): Remove when the build system properly separates //32bit and 64bit architectures. multilib: { lib32: { suffix: "32", }, lib64: { suffix: "64", }, }, cflags: [ "-Wall", Loading cmds/statsd/src/FieldValue.h +11 −4 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ public: return false; } bool matches(const Matcher& that) const; }; Loading Loading @@ -360,7 +361,9 @@ struct Value { class Annotations { public: Annotations() {} Annotations() { setNested(true); // Nested = true by default } // This enum stores where particular annotations can be found in the // bitmask. Note that these pos do not correspond to annotation ids. Loading @@ -379,7 +382,9 @@ public: inline void setUidField(bool isUid) { setBitmaskAtPos(UID_POS, isUid); } inline void setResetState(int resetState) { mResetState = resetState; } inline void setResetState(int32_t resetState) { mResetState = resetState; } // Default value = false inline bool isNested() const { return getValueFromBitmask(NESTED_POS); } Loading @@ -395,7 +400,9 @@ public: // If a reset state is not sent in the StatsEvent, returns -1. Note that a // reset satate is only sent if and only if a reset should be triggered. inline int getResetState() const { return mResetState; } inline int32_t getResetState() const { return mResetState; } private: inline void setBitmaskAtPos(int pos, bool value) { Loading @@ -411,7 +418,7 @@ private: // there are only 4 booleans, just one byte is required. uint8_t mBooleanBitmask = 0; int mResetState = -1; int32_t mResetState = -1; }; /** Loading cmds/statsd/src/HashableDimensionKey.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,23 @@ bool filterValues(const vector<Matcher>& matcherFields, const vector<FieldValue> return num_matches > 0; } bool filterPrimaryKey(const std::vector<FieldValue>& values, HashableDimensionKey* output) { size_t num_matches = 0; const int32_t simpleFieldMask = 0xff7f0000; const int32_t attributionUidFieldMask = 0xff7f7f7f; for (const auto& value : values) { if (value.mAnnotations.isPrimaryField()) { output->addValue(value); output->mutableValue(num_matches)->mField.setTag(value.mField.getTag()); const int32_t mask = isAttributionUidField(value) ? attributionUidFieldMask : simpleFieldMask; output->mutableValue(num_matches)->mField.setField(value.mField.getField() & mask); num_matches++; } } return num_matches > 0; } void filterGaugeValues(const std::vector<Matcher>& matcherFields, const std::vector<FieldValue>& values, std::vector<FieldValue>* output) { for (const auto& field : matcherFields) { Loading Loading
apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1224,7 +1224,7 @@ public class DeviceIdleController extends SystemService IDLE_FACTOR = mParser.getFloat(KEY_IDLE_FACTOR, 2f); MIN_TIME_TO_ALARM = mParser.getDurationMillis(KEY_MIN_TIME_TO_ALARM, !COMPRESS_TIME ? 60 * 60 * 1000L : 6 * 60 * 1000L); !COMPRESS_TIME ? 30 * 60 * 1000L : 6 * 60 * 1000L); MAX_TEMP_APP_WHITELIST_DURATION = mParser.getDurationMillis( KEY_MAX_TEMP_APP_WHITELIST_DURATION, 5 * 60 * 1000L); MMS_TEMP_APP_WHITELIST_DURATION = mParser.getDurationMillis( Loading
apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +8 −5 Original line number Diff line number Diff line Loading @@ -2182,17 +2182,18 @@ public class JobSchedulerService extends com.android.server.SystemService } final boolean jobExists = mJobs.containsJob(job); final boolean userStarted = areUsersStartedLocked(job); final boolean backingUp = mBackingUpUids.indexOfKey(job.getSourceUid()) >= 0; if (DEBUG) { Slog.v(TAG, "isReadyToBeExecutedLocked: " + job.toShortString() + " exists=" + jobExists + " userStarted=" + userStarted); + " exists=" + jobExists + " userStarted=" + userStarted + " backingUp=" + backingUp); } // These are also fairly cheap to check, though they typically will not // be conditions we fail. if (!jobExists || !userStarted) { if (!jobExists || !userStarted || backingUp) { return false; } Loading Loading @@ -2265,15 +2266,17 @@ public class JobSchedulerService extends com.android.server.SystemService final boolean jobExists = mJobs.containsJob(job); final boolean userStarted = areUsersStartedLocked(job); final boolean backingUp = mBackingUpUids.indexOfKey(job.getSourceUid()) >= 0; if (DEBUG) { Slog.v(TAG, "areComponentsInPlaceLocked: " + job.toShortString() + " exists=" + jobExists + " userStarted=" + userStarted); + " exists=" + jobExists + " userStarted=" + userStarted + " backingUp=" + backingUp); } // These are also fairly cheap to check, though they typically will not // be conditions we fail. if (!jobExists || !userStarted) { if (!jobExists || !userStarted || backingUp) { return false; } Loading
cmds/statsd/Android.bp +8 −1 Original line number Diff line number Diff line Loading @@ -291,7 +291,14 @@ cc_binary { cc_test { name: "statsd_test", defaults: ["statsd_defaults"], test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], //TODO(b/153588990): Remove when the build system properly separates //32bit and 64bit architectures. multilib: { lib32: { suffix: "32", }, lib64: { suffix: "64", }, }, cflags: [ "-Wall", Loading
cmds/statsd/src/FieldValue.h +11 −4 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ public: return false; } bool matches(const Matcher& that) const; }; Loading Loading @@ -360,7 +361,9 @@ struct Value { class Annotations { public: Annotations() {} Annotations() { setNested(true); // Nested = true by default } // This enum stores where particular annotations can be found in the // bitmask. Note that these pos do not correspond to annotation ids. Loading @@ -379,7 +382,9 @@ public: inline void setUidField(bool isUid) { setBitmaskAtPos(UID_POS, isUid); } inline void setResetState(int resetState) { mResetState = resetState; } inline void setResetState(int32_t resetState) { mResetState = resetState; } // Default value = false inline bool isNested() const { return getValueFromBitmask(NESTED_POS); } Loading @@ -395,7 +400,9 @@ public: // If a reset state is not sent in the StatsEvent, returns -1. Note that a // reset satate is only sent if and only if a reset should be triggered. inline int getResetState() const { return mResetState; } inline int32_t getResetState() const { return mResetState; } private: inline void setBitmaskAtPos(int pos, bool value) { Loading @@ -411,7 +418,7 @@ private: // there are only 4 booleans, just one byte is required. uint8_t mBooleanBitmask = 0; int mResetState = -1; int32_t mResetState = -1; }; /** Loading
cmds/statsd/src/HashableDimensionKey.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,23 @@ bool filterValues(const vector<Matcher>& matcherFields, const vector<FieldValue> return num_matches > 0; } bool filterPrimaryKey(const std::vector<FieldValue>& values, HashableDimensionKey* output) { size_t num_matches = 0; const int32_t simpleFieldMask = 0xff7f0000; const int32_t attributionUidFieldMask = 0xff7f7f7f; for (const auto& value : values) { if (value.mAnnotations.isPrimaryField()) { output->addValue(value); output->mutableValue(num_matches)->mField.setTag(value.mField.getTag()); const int32_t mask = isAttributionUidField(value) ? attributionUidFieldMask : simpleFieldMask; output->mutableValue(num_matches)->mField.setField(value.mField.getField() & mask); num_matches++; } } return num_matches > 0; } void filterGaugeValues(const std::vector<Matcher>& matcherFields, const std::vector<FieldValue>& values, std::vector<FieldValue>* output) { for (const auto& field : matcherFields) { Loading