You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Trigger with event
This commit is contained in:
@@ -23,8 +23,7 @@ public class CallbackHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static void triggerCallback(Event event) {
|
||||
event.isTriggered = true;
|
||||
private static void triggerCallback(Event event) {
|
||||
HashSet<EventListener> list = listeners.get(event);
|
||||
if (list != null) {
|
||||
for (EventListener listener : list) {
|
||||
@@ -35,6 +34,10 @@ public class CallbackHandler {
|
||||
|
||||
public static class Event {
|
||||
public boolean isTriggered = false;
|
||||
public void trigger() {
|
||||
isTriggered = true;
|
||||
triggerCallback(this);
|
||||
}
|
||||
}
|
||||
|
||||
public interface EventListener {
|
||||
|
||||
Reference in New Issue
Block a user