Revert "kernel: throne_tracker: move throne_tracker to kthread"

This reverts commit 6a6fc07cd4.
This commit is contained in:
Rifat Azad
2025-06-14 19:54:36 +06:00
parent ad290a51a0
commit bf35f73430

View File

@@ -14,13 +14,9 @@
#include "throne_tracker.h"
#include "kernel_compat.h"
#include <linux/kthread.h>
#include <linux/sched.h>
uid_t ksu_manager_uid = KSU_INVALID_UID;
static struct task_struct *throne_thread;
#define SYSTEM_PACKAGES_LIST_PATH "/data/system/packages.list"
#define SYSTEM_PACKAGES_LIST_PATH "/data/system/packages.list.tmp"
struct uid_data {
struct list_head list;
@@ -324,7 +320,7 @@ static bool is_uid_exist(uid_t uid, char *package, void *data)
return exist;
}
static void track_throne_function()
void track_throne()
{
struct file *fp =
ksu_filp_open_compat(SYSTEM_PACKAGES_LIST_PATH, O_RDONLY, 0);
@@ -419,23 +415,6 @@ out:
}
}
static int throne_tracker_thread(void *data)
{
pr_info("%s: pid: %d started\n", __func__, current->pid);
track_throne_function();
throne_thread = NULL;
pr_info("%s: pid: %d exit!\n", __func__, current->pid);
return 0;
}
void track_throne()
{
throne_thread = kthread_run(throne_tracker_thread, NULL, "throne_tracker");
if (IS_ERR(throne_thread)) {
throne_thread = NULL;
}
}
void ksu_throne_tracker_init()
{
// nothing to do