Cache Magisk app ID for performance

This commit is contained in:
topjohnwu
2021-09-20 05:47:15 -07:00
parent 4f0bced53e
commit 82c7662cdf
3 changed files with 33 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ void revert_daemon(int pid, int client);
void revert_unmount(int pid = -1);
extern std::atomic<bool> denylist_enabled;
extern int cached_manager_app_id;
enum : int {
ENFORCE_DENY,

View File

@@ -276,6 +276,7 @@ static void inotify_handler(pollfd *pfd) {
} u{};
read(pfd->fd, u.buf, sizeof(u.buf));
if (u.event.name == "packages.xml"sv) {
cached_manager_app_id = -1;
exec_task([] {
mutex_guard lock(data_lock);
rebuild_map();