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

Commit 3ebe1215 authored by Mark Punzalan's avatar Mark Punzalan
Browse files

Handle multi-user when disabling MediaMetrics service.

This logic was added in I740b4f5acb88821197e3c4023a4032babd48ec5a but
didn't work for multi-user. Some tests in CtsVoiceInteractionTestCases
where failing on Automotive (in a multi-user environment) because of
additional delays in the test trying to access the MediaMetrics service.

Real world impact: For any secondary user (NOT user 0), the first time
the hotword is spoken after the HotwordDetectionService process starts,
detection fails because the delay causes a timeout in detection. This is
not just a one-time occurrence, as the process may occasionally get
restarted.

Bug: 214488187
Test: `atest CtsVoiceInteractionTestCases` on a raven_car build
Change-Id: If5c721c9acfc78f1cbc35c3056adad95a4604f8b
parent 43eceebc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <unordered_map>

#include <binder/Parcel.h>
#include <cutils/multiuser.h>
#include <cutils/properties.h>
#include <utils/Errors.h>
#include <utils/Log.h>
@@ -343,7 +344,8 @@ bool BaseItem::isEnabled() {
        // now.
        // TODO(b/190151205): Either allow the HotwordDetectionService to access MediaMetrics or
        // make this disabling specific to that process.
        if (uid >= AID_ISOLATED_START && uid <= AID_ISOLATED_END) {
        uid_t appid = multiuser_get_app_id(uid);
        if (appid >= AID_ISOLATED_START && appid <= AID_ISOLATED_END) {
            return false;
        }
        break;