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

Commit e4c96034 authored by Charles Chen's avatar Charles Chen Committed by Automerger Merge Worker
Browse files

Merge "Only allow the system to bind to the visual query detection service."...

Merge "Only allow the system to bind to the visual query detection service." into udc-dev am: c8114221 am: b823d500

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23153163



Change-Id: I01765548531fa23077d831b8938328554ba8b75d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1fb65f41 b823d500
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -4504,10 +4504,11 @@ public final class ActiveServices {
                        + ", uid=" + callingUid
                        + ", uid=" + callingUid
                        + " requires " + r.permission);
                        + " requires " + r.permission);
                return new ServiceLookupResult(r.permission);
                return new ServiceLookupResult(r.permission);
            } else if (Manifest.permission.BIND_HOTWORD_DETECTION_SERVICE.equals(r.permission)
            } else if ((Manifest.permission.BIND_HOTWORD_DETECTION_SERVICE.equals(r.permission)
                    || Manifest.permission.BIND_VISUAL_QUERY_DETECTION_SERVICE.equals(r.permission))
                    && callingUid != Process.SYSTEM_UID) {
                    && callingUid != Process.SYSTEM_UID) {
                // Hotword detection must run in its own sandbox, and we don't even trust
                // Hotword detection and visual query detection must run in its own sandbox, and we
                // its enclosing application to bind to it - only the system.
                // don't even trust its enclosing application to bind to it - only the system.
                // TODO(b/185746653) remove this special case and generalize
                // TODO(b/185746653) remove this special case and generalize
                Slog.w(TAG, "Permission Denial: Accessing service " + r.shortInstanceName
                Slog.w(TAG, "Permission Denial: Accessing service " + r.shortInstanceName
                        + " from pid=" + callingPid
                        + " from pid=" + callingPid