Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4cc6930 authored by Ruchir Rastogi's avatar Ruchir Rastogi
Browse files

Fix AppBreadcrumbReported bug with isolated uid

In MetricsManager::onLogEvent, we check whether the uid in
AppBreadcrumbReported is the same as the logger's uid. However, because
we map uids within LogEvents from isolated uids to host uids prior to
this, we should convert the logger uid to the host uid as well.

Test: m
Bug: 154124933
Change-Id: I9dba4327dd8f1102c651ca84b5ef7b48be9cf84d
parent 74918ad9
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -384,7 +384,10 @@ bool MetricsManager::eventSanityCheck(const LogEvent& event) {
            VLOG("APP_BREADCRUMB_REPORTED had error when parsing the uid");
            return false;
        }
        int32_t loggerUid = event.GetUid();

        // Because the uid within the LogEvent may have been mapped from
        // isolated to host, map the loggerUid similarly before comparing.
        int32_t loggerUid = mUidMap->getHostUidOrSelf(event.GetUid());
        if (loggerUid != appHookUid && loggerUid != AID_STATSD) {
            VLOG("APP_BREADCRUMB_REPORTED has invalid uid: claimed %ld but caller is %d",
                 appHookUid, loggerUid);