Repository navigation
|
I don't know how the accessibility service works and how it was implemented, but I absolutely love the foreground/background activity routing feature to reduce correlation of apps behind a VPN. When switching apps very quickly (for example in recent apps screen), I am worried that the last app might still send something for a second while in background and while a new app is in foreground. Could this happen or do you use some hook that prevents this because it runs before any new app becomes active and before the current active app is put in the background? |
Replies: 1 comment 1 reply
|
I found the code using the accessibility service. It looks for event type |
I found the code using the accessibility service. It looks for event type
AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEAREDorAccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED.A quick AI search says these events are only happening after
onResumeleaving some time for a newly started app to make a connection while the other app is still connected. See android lifecycle here https://www.geeksforgeeks.org/android/activity-lifecycle-in-android-with-demo-app/.rethink-app/app/src/main/java/com/celzero/bravedns/util/BackgroundAccessibilityService.kt
Lines 74 to 80 in fd2ee1c