summaryrefslogtreecommitdiff
path: root/libs/androidfw/misc.cpp
diff options
context:
space:
mode:
author Suprabh Shukla <suprabh@google.com> 2024-03-02 07:07:59 +0000
committer Android Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com> 2024-03-02 07:07:59 +0000
commit0bb786e3f107e114944dac91324c97e376f74ec2 (patch)
treef9a2622f6d006f23d0c7010ab6da3139e36d8f7b /libs/androidfw/misc.cpp
parente7d727b2755140d63af0ad81c0f044b73bcb6c8e (diff)
Avoid obsolete uid-state change evaluations in NPMS
In some cases, where a uid undergoes quick consecutive state changes and the handler message has not completed execution, we can return early if we know a following handler message to evaluate the same rules is pending. We peek at UidStateCallbackInfos to infer this state as these are populated directly in the UidObserver callbacks before posting to the handler. The code avoids removing messages from the Handler as - it is a linear operation that may be slower. - the check on UidStateCallback happens later and returns from redundant handler message-processing without incurring much additional work. Also taking out some code out of the mUidRulesFirstLock lock. Test: atest CtsHostsideNetworkTests Test: FrameworksServicesTests:NetworkPolicyManagerServiceTest Bug: 327058756 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a0703d6dd4e906b9a38a1a4b497ff0c628d1411d) Merged-In: I764f714d3ce09699a0ab82b77c8b6a577cd9f9ab Change-Id: I764f714d3ce09699a0ab82b77c8b6a577cd9f9ab
Diffstat (limited to 'libs/androidfw/misc.cpp')
0 files changed, 0 insertions, 0 deletions