Fix retrieval of query modules

Bug: 69872
Change-Id: I79bd2901c92c2afd3b294aa3c52f4cc35a6cf4d8
(cherry picked from commit 0a238ce1a06ff49c50d62e12ec252221a0d688d6)