From 98aa95966234ffbbfda7fa2ff08d2e255f8f2eb2 Mon Sep 17 00:00:00 2001 From: tornaco Date: Tue, 5 Apr 2022 20:13:19 +0800 Subject: [PATCH] [app] mavel rule ext: support action delay --- android/internal/Thanox-Internal | 2 +- .../thanos/android/noroot/ThanosProviderService.java | 6 ++++++ .../src/main/assets/prebuilt_profile/executor_delay.json | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/android/internal/Thanox-Internal b/android/internal/Thanox-Internal index 0dd79333b..5a2e2ba50 160000 --- a/android/internal/Thanox-Internal +++ b/android/internal/Thanox-Internal @@ -1 +1 @@ -Subproject commit 0dd79333b976d98b89543525fc43c15d473f214d +Subproject commit 5a2e2ba5039cf62d51fe52857f3c1226a53dbafc diff --git a/android/modules/module_noroot_support/src/main/java/github/tornaco/thanos/android/noroot/ThanosProviderService.java b/android/modules/module_noroot_support/src/main/java/github/tornaco/thanos/android/noroot/ThanosProviderService.java index d1ceb2e15..c492b9118 100644 --- a/android/modules/module_noroot_support/src/main/java/github/tornaco/thanos/android/noroot/ThanosProviderService.java +++ b/android/modules/module_noroot_support/src/main/java/github/tornaco/thanos/android/noroot/ThanosProviderService.java @@ -27,6 +27,7 @@ import android.os.Binder; import android.os.Handler; import android.os.Process; +import android.os.UserHandle; import androidx.annotation.Nullable; @@ -92,6 +93,11 @@ public Intent registerReceiver(@Nullable BroadcastReceiver receiver, IntentFilte return new Intent(); } + public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user, IntentFilter filter, String broadcastPermission, Handler scheduler) { + XLog.w("ShellProcessContext, drop registerReceiver call..." + receiver); + return new Intent(); + } + @Override public ContentResolver getContentResolver() { XLog.w("ShellProcessContext, drop getContentResolver call..."); diff --git a/android/modules/module_profile/src/main/assets/prebuilt_profile/executor_delay.json b/android/modules/module_profile/src/main/assets/prebuilt_profile/executor_delay.json index 59a7f4645..7836a82bf 100644 --- a/android/modules/module_profile/src/main/assets/prebuilt_profile/executor_delay.json +++ b/android/modules/module_profile/src/main/assets/prebuilt_profile/executor_delay.json @@ -1,12 +1,12 @@ [ { "name": "Delayed action example", - "description": "Execute the action delay 2s: show a short toast and log the event 2s after app switched.", + "description": "Execute the action delay 2000 ms: show a short toast 2s after app switched.", "priority": 1, + "delay": 2000, "condition": "frontPkgChanged == true", "actions": [ - "actor.delayed(2000, \"ui.showShortToast(\\\"App switched 2s ago\\\")\")", - "actor.delayed(2000, \"log.log(to)\")" + "ui.showShortToast(\"App switched 2s ago to: \" + thanos.getPkgManager().getAppInfo(to).getAppLabel())" ] } ] \ No newline at end of file