logd: clear all from non system user status request

pruneRows not necessarily ULONG_MAX when uid not system source,
allow for speed up for status response if pruneRows exhausted.

Change-Id: I38c76bb20215e3d96513a575e2e3bc85a5e5b41c
This commit is contained in:
Mark Salyzyn 2016-09-01 15:48:36 -07:00
parent 1eefca281e
commit 43a5f31e94
1 changed files with 5 additions and 2 deletions

View File

@ -508,7 +508,8 @@ bool LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
LogBufferElementCollection::iterator it;
if (caller_uid != AID_ROOT) {
// Only here if clearAll condition (pruneRows == ULONG_MAX)
// Only here if clear all request from non system source, so chatty
// filter logistics is not required.
it = mLastSet[id] ? mLast[id] : mLogElements.begin();
while (it != mLogElements.end()) {
LogBufferElement *element = *it;
@ -534,7 +535,9 @@ bool LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
}
it = erase(it);
pruneRows--;
if (--pruneRows == 0) {
break;
}
}
LogTimeEntry::unlock();
return busy;