Commit 05c39f0a authored by Ruchi Kandoi's avatar Ruchi Kandoi
Browse files

netd: Adds support for uid in idletimer netlink notification.


Change-Id: Ib85b85fc12b20436e0d788d5c3ec66306c632b57
Signed-off-by: default avatarRuchi Kandoi <kandoiruchi@google.com>
Bug: 20264396
parent a59c9282
......@@ -118,8 +118,10 @@ void NetlinkHandler::onEvent(NetlinkEvent *evt) {
const char *label = evt->findParam("INTERFACE");
const char *state = evt->findParam("STATE");
const char *timestamp = evt->findParam("TIME_NS");
const char *uid = evt->findParam("UID");
if (state)
notifyInterfaceClassActivity(label, !strcmp("active", state), timestamp);
notifyInterfaceClassActivity(label, !strcmp("active", state),
timestamp, uid);
#if !LOG_NDEBUG
} else if (strcmp(subsys, "platform") && strcmp(subsys, "backlight")) {
......@@ -165,10 +167,15 @@ void NetlinkHandler::notifyQuotaLimitReached(const char *name, const char *iface
}
void NetlinkHandler::notifyInterfaceClassActivity(const char *name,
bool isActive, const char *timestamp) {
bool isActive,
const char *timestamp,
const char *uid) {
if (timestamp == NULL)
notify(ResponseCode::InterfaceClassActivity,
"IfaceClass %s %s", isActive ? "active" : "idle", name);
else if (uid != NULL && isActive)
notify(ResponseCode::InterfaceClassActivity,
"IfaceClass active %s %s %s", name, timestamp, uid);
else
notify(ResponseCode::InterfaceClassActivity,
"IfaceClass %s %s %s", isActive ? "active" : "idle", name, timestamp);
......
......@@ -41,7 +41,7 @@ protected:
void notifyInterfaceLinkChanged(const char *name, bool isUp);
void notifyQuotaLimitReached(const char *name, const char *iface);
void notifyInterfaceClassActivity(const char *name, bool isActive,
const char *timestamp);
const char *timestamp, const char *uid);
void notifyAddressChanged(NetlinkEvent::Action action, const char *addr, const char *iface,
const char *flags, const char *scope);
void notifyInterfaceDnsServers(const char *iface, const char *lifetime,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment