yashsingh1/xdaforums huggingface dataset:
[Xposed Framework Modules] JayShortway:
AppContext 0.4.3

Hi everyone,

I have just released AppContext 0.4.3! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

In this version, I changed the way Services are hooked again. Toggling the experimental Services feature requires a reboot to take effect. I also moved the 'Ignore Recents' setting to Experimental. Moreover, app detection is improved for apps that quickly launch multiple Activities. I made yet another attempt at fixing the random crashes. I received 1 report saying the random crashes haven't yet occurred with this version, so I'm hopeful. But please keep reporting them if they happen, thanks! Lastly, I fixed some Xposed-related errors.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!
[Xposed Framework Modules] zzzhead:
Noticed that in app ops, appcontext is triggered frequently for run in background. I tried to disable it and all seems to work fine still.

Is it okay to disable run I'm background?
[Xposed Framework Modules] JayShortway:
I have never used App Ops myself, so I don't know why specifically AppContext is listed as running frequently in the background, but what I expect is happening is this. AppContext is a BroadcastReceiver, so it only does something when needed (i.e. let Tasker know an app has started). Android will (as far as I know) typically keep a BroadcastReceiver in cache, so it can act quickly when needed. I guess that's why it is seen as running in the background. If it still works if you disable 'run in background', I suspect Android restarts the BroadcastReceiver each time it is needed, resulting in slightly slower response times. So as long as it works, feel free to disable 'run in background', but it might make responses a bit slower. Please note I am not sure about the above, it is just what I suspect is happening.
[Xposed Framework Modules] Artieza:
Your app always in the background and holds ~13 mb. I don't like it. ? You don't need any broadcasts. You can hook everything and call static method into yourself directly.
[Xposed Framework Modules] JayShortway:
Yes there is room for optimization, and your suggestion is a good one. The 'communication' between AppContext and other apps was one of the first problems I had to solve, meaning I didn't know much about Xposed/Android internals, and I went with broadcasts. Now that AppContext seems to be more stable (very few reported crashes in the Play Console since 0.4.3, please let me know if your experience is different), I can shift the focus somewhat to optimization.
[Xposed Framework Modules] JayShortway:
Coming back to this, I don't see how you can call a static method from another process. If you do, please let me know.
[Xposed Framework Modules] Artieza:
I'm not sure what you are trying to do. I guess it's in the background because of ACTIVITY_CHANGED intents. I don't know how you pass it to Tasker.
[Xposed Framework Modules] JayShortway:
Yes those are the Intents needed to communicate from the Xposed module to the Tasker plugin, which then communicates with Tasker via a different Intent. I have a way in mind to reduce the number of Intents between the module and the plugin, but I don't think I can eliminate them.
[Xposed Framework Modules] Artieza:
You can push intent directly to Tasker.
[Xposed Framework Modules] JayShortway:
Thanks, that's indeed one of the ways I had in mind. Will require some internal refactoring before I can implement it though.
[Xposed Framework Modules] JayShortway:
AppContext 0.4.4

Hi everyone,

I have just released AppContext 0.4.4! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

This is a minor update, because I have been in London for the past week which means I didn't have much development time. There were still some minor bugs reported via Google Play. This version fixes all those. Further, some inconsistencies/imperfections in the UI have been corrected, including an old overflow/menu button on pre-Lollipop devices. I have also started some work on optimizations. Lastly, this version targets Android 8.0 Oreo. There is of course no Xposed for Oreo, but it's best to be ready :D.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!
[Xposed Framework Modules] JayShortway:
AppContext 0.4.5

Hi everyone,

I have just released AppContext 0.4.5! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

This is another minor update. Opening an existing Context now shows a Snackbar with 'Configure' button, allowing you to quickly adjust the configuration. I have made the Requirements-section a bit clearer and rewrote some of the Dialogs. Some minor optimizations are implemented, which are mainly foundations for further optimization later. Lastly, some minor bugs were fixed.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!
[Xposed Framework Modules] Gggggas:
Glad to see that this module is still active [emoji16] Great job Dev!
[Xposed Framework Modules] JayShortway:
I appreciate it, thanks! Have another update in the works already :D
[Xposed Framework Modules] Gggggas:
That's awesome dev , it's great having Devs like you here [emoji4]
[Xposed Framework Modules] JayShortway:
Yet another 5-star review disappeared before I could reply. This keeps happening, and I'm beginning to suspect Google Play. Although I wouldn't know why they'd remove reviews.

In any way, I'd like to thank the person who wrote the review for the in-app purchase! Also to answer your questions: you don't need to change any setting in Tasker and you can indeed disable Tasker's accessibility service, but it shouldn't matter if it's enabled. However, you do need to create your application contexts with the AppContext plugin.

edit:

So what happens is: I get a notification containing a new review, but when I tap to open it says the review can't be loaded and it might not exist anymore.
[Xposed Framework Modules] JayShortway:
Okay so I just got another 5-star review. (Thanks a lot!) This time, I was able to type a reply, but when I clicked to publish an 'error occurred' and the review was gone. Can anyone who wrote a 5-star review confirm it is gone on their side as well? Would like to get to the bottom of this, understandably. Thanks in advance.
[Xposed Framework Modules] JayShortway:
AppContext 0.4.6

Hi everyone,

I have just released AppContext 0.4.6! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

This is yet another minor update. I made the Requirements more descriptive and merged the 2 Tasker requirements ('installed' and 'enabled'). Also, you can now collapse the Requirements-section. I fixed a few bugs in the Dialogs and did some internal code restructuring. Also, I migrated to the Play Billing Library. This was quite a task actually and involved a lot of rewriting. If there happen to be any problems regarding in-app purchases made not being recognized, please do let me know!

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!
[Xposed Framework Modules] zzzhead:
Thanks for the update!
[Xposed Framework Modules] JayShortway:
Thanks for the report! It's a stupid coding error from me. I'll have it fixed in the next update.
[Xposed Framework Modules] JayShortway:
AppContext 0.4.7

Hi everyone,

I have just released AppContext 0.4.7! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

The Requirements-section now collapses automatically when all requirements are met. I also tested it with the

official

Xposed for Nougat and found no problems. Please let me know if it works for you as well. Furthermore, a crash preventing AppContext to be launched should be fixed now. Lastly, I fixed some minor bugs.

I'd also like to thank rovo89 for the release of the official Xposed for Nougat. I'm very excited about this!

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!
[Xposed Framework Modules] guillermorojaz:
Greetings.

I would like the screen to turn off after 20 seconds only on the desktop (nova launcher), keeping 5 minutes in the screen settings.

What command should I add?

Thank you.
[Xposed Framework Modules] JayShortway:
Hi,

You could try the following.

New Profile --> State --> Plugin --> AppContext --> tap 'running' --> select Nova Launcher and save.

Create this Enter Task:

Display --> Display Timeout --> choose 20 seconds.

That should do the trick. Please let me know if it works for you!
[Xposed Framework Modules] guillermorojaz:
.

Thanks for your time.

It works, but after a few reboots it ends up changing the display settings to 15 seconds, causing the screen to turn off at that time in all apps.

AGREGO:

After the power on or restart, without touching the screen or executing any application, I realize that the screen is suspended after 5 minutes, that is, Tasker does not correctly start the command to suspend the screen after 20 seconds.

He only does it after 5 minutes. If I touch the screen or execute an app immediately after the reboot is when the Tasker comes into action, but there is when the general configuration of the screen changes. In itself, it works correctly by letting you spend the time you have in the screen settings.

Excuse my bad English...
[Xposed Framework Modules] JayShortway:
Thanks for reporting back. It sounds like a bug in Tasker, but I'm not sure. You could try the following workaround.

New Profile --> State --> Plugin --> AppContext --> tap 'running' --> select Nova Launcher and save.

Create this Enter Task:

Display --> Display Timeout --> choose 20 seconds.

Create this Exit Task:

Display --> Display Timeout --> choose 5 minutes.

However, with this profile the display timeout you choose in Android's screen settings (probably) has no effect anymore.

This may be because BroadcastReceivers (which both Tasker and AppContext are) are delayed at startup. You can temporarily adjust the Enter and Exit Tasks (from the Profile above) as follows, to check.

Enter Task:

Alert --> Flash --> Text: "%acapp started."

Display --> Display Timeout --> choose 20 seconds.

Exit Task:

Alert --> Flash --> Text: "%acapp stopped."

Display --> Display Timeout --> choose 5 minutes.

You should see a Toast message saying "Nova Launcher started." if and when Tasker recognizes Nova Launcher after a reboot. If everything works correctly, that should mean the Display Timeout is set at 15 seconds.
[Xposed Framework Modules] guillermorojaz:
Greetings.

Sorry I did not answer before. the classes have me on the edge.

Started working perfectly with the instructions:

New Profile --> State --> Plugin --> AppContext --> tap 'running' --> select Nova Launcher and save.

Create this Enter Task:

Display --> Display Timeout --> choose 20 seconds.

Apparently, a cache cleaner that I have installed (out of respect for the developer did not put his name) removes a process or folder that must be necessary for Tasker to start correctly. I had it configured so that every 1 hour it will execute cleaning. disable it, restart and perfect, tasker suspended and turn off the screen at 20 seconds, without changing the screen settings.

The ideal is to check which process is removing and uncheck it in the cleaning settings of the cleaner, so that everything works in complete order.
[Xposed Framework Modules] JayShortway:
[MENTION=6205176]guillermorojaz[/MENTION] I'm glad it's working! Interesting case you mention, possibly some sort of 'pending tasks' list was cleared from Tasker's cache? Good luck with your classes!
[Xposed Framework Modules] JayShortway:
Someone posted a 5-star review with a question, but it dissappeared before I could answer (again). So I'll answer here just in case.

The question was whether it is necessary to disable Tasker's accessibility service, before AppContext will work. This is not the case. AppContext will work no matter the state of Tasker's accessibility service. The upside of AppContext is that you >can< disable Tasker's accessibility service, but you're free to leave it enabled of course.
[Xposed Framework Modules] JayShortway:
Okay so there was another 5-star review which got deleted right away, but I think I've figured out a workaround.

If you want to give a 5-star review, please first give a 4-star review and then later update it to 5 stars. Thanks again to all reviewers!
[Xposed Framework Modules] Magissia:
"When launching an app" is a good thing, but what is returned if launching an app that is not tracked ? Do we get something to notify we switched to something we don't track ?
[Xposed Framework Modules] JayShortway:
I'm not sure what you mean, but you can set up a Context for when an app stops as well. So if you're interested in, say, Google Maps, you can set up 2 Event Contexts: one for when Google Maps starts, and one for when Google Maps stops (which is "switching to something we don't track", I think?). You can also set up 1 State Context for when Google Maps is running, and then add both an Enter and Exit Task (the Exit Task is run when Google Maps stops).

I hope this answers your question. If not, please let me know!
[Xposed Framework Modules] Magissia:
Hello, would it be possible to allow hiding of the launcher icon ? As this is rather "set and forget" and users can return to the xposed manager to open the config UI, an option to hide the icon would be nice.
[Xposed Framework Modules] JayShortway:
Hi, thanks for the feedback. It's a good suggestion, I'll see if I can add it to the next update.
[Xposed Framework Modules] JayShortway:
AppContext 0.4.7.1

Hi everyone,

I have just released AppContext 0.4.7.1! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

This is just a small maintenance release. Chinese (Traditional) translation is added, thanks to [MENTION=8666802]smailzhu[/MENTION]! Also, AppContext is now compiled for Android 8.1.0 (API 27).

Please report any bugs in this thread, or by sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!
[Xposed Framework Modules] thecoolkid:
The latest version (4.7.1) broke the detection for me on Resurrection Remix 6.0 (Oreo 8.1). I downgraded to 4.7 and it works fine ??*♂️
[Xposed Framework Modules] JayShortway:
Hey, thanks for your report. I have an idea about what the problem could be. Can I send you a test version via DM?
[Xposed Framework Modules] thecoolkid:
Of course, go ahead ?
[Xposed Framework Modules] JayShortway:
Thanks, I just sent it to you!
[Xposed Framework Modules] thecoolkid:
Unfortunately it still doesn't trigger in Tasker...
[Xposed Framework Modules] JayShortway:
Hmm that's too bad. I need to investigate further..
[Xposed Framework Modules] thecoolkid:
If you want me to test your changes I'm happy to help :)
[Xposed Framework Modules] JayShortway:
Thanks for the offer, I'll be sure to send it your way!
[Xposed Framework Modules] JayShortway:
Hi, just letting you know I sent you a DM with another test version.
[Xposed Framework Modules] thecoolkid:
Cool, I'll get right to it ?
[Xposed Framework Modules] Magissia:
Hello, is the package name variable set only when application gets in foreground or will it be set when going the "false" (left pointing red arrow) too ? If the second, is it possible to make a switch to set the variable only when going the "true" (green arrow) path ?

Does it makes sense to monitor all apps with it compared to tasker's/automate's equivalent that actively checks application currently in foreground ? Will I still get a theoretical benefit in terms on battery usage/cpu cycles used ?

Thank you for this promising module.
[Xposed Framework Modules] JayShortway:
I'm assuming you're using a State Profile. As far as I know, Tasker only allows plugins to set variables when a State becomes active (true/green arrow), and not when it becomes inactive (false/red arrow). So AppContext only sets the package variable on the first app that activates the State. If you want to have the package variable set for multiple apps that start (or stop), you can use Event Profiles with AppContext. Using Event Profiles, the package variable will be set every time any selected app starts (or stops).

What is your use case, if I may ask?

You mean all apps you have installed? I'd say you do get an efficiency benefit over Tasker's application context. AppContext only does something when an app starts or stops, and Tasker is checking constantly (every x seconds) which app is in the foreground. So when you have an app open for some time, AppContext does nothing, while Tasker is still checking every x seconds what app is in the foreground. (I'm assuming that Automate's application context works the same as Tasker's, but I'm not as familiar with Automate.)

If you have any more questions, let me know!
[Xposed Framework Modules] Magissia:
Automate works the same way, constantly checking current foreground app.

Use case is change settings and frequency clock for specific apps, check if app data is up to date.
[Xposed Framework Modules] JayShortway:
Okay good to know, thanks!

Ah that's cool. I would say that AppContext does indeed provide better efficiency.
[Xposed Framework Modules] lauralbaby:
Hi, I'm getting a lot of crashes in Matlog for this app, I can't really tell if it's affecting anything, but here's an attachment.
[Xposed Framework Modules] Đấng Vô đối:
Thank you for your app. But, I use a task is Long Press Power Menu, it required Accessibility Settings, so if I disable Accessibility Settings, your app can do that task?
[Xposed Framework Modules] JayShortway:
Thanks for the log! I've seen this crash before, and I am about to release an update (0.4.7.2) which should fix it. Could you let me know if it does?

It doesn't really effect anything. AppContext still works from what I've gathered from my testing.

Also, what device and Android version are you on?
[Xposed Framework Modules] JayShortway:
Hi, AppContext allows you to create Profiles in Tasker that activate when you launch certain apps, without using Tasker's accessibility service. AppContext does not replace every use-case for accessibility services. What does Long Press Power Menu do? Does it intercept a long press on the power button to show a different menu?
[Xposed Framework Modules] lauralbaby:
No, it seems like it still works.

OnePlus 3t, ResurectionRemix, 8.1
[Xposed Framework Modules] JayShortway:
Thanks! It seems this happens only on Oreo.
[Xposed Framework Modules] JayShortway:
AppContext 0.4.7.2

Hi everyone,

I have just released AppContext 0.4.7.2! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

This is just a small maintenance release again. Chinese (Simplified) translation is added, thanks to [MENTION=8666802]smailzhu[/MENTION]! Also, there were some fixes to the Chinese (Traditional) translation, and lastly some general bugs have been fixed.

Please report any bugs in this thread, or by sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!
[Xposed Framework Modules] thecoolkid:
It doesn't work for me with latest Chrome Beta 68, other than that works great.
[Xposed Framework Modules] JayShortway:
Thanks for letting me know. I'll see if I can reproduce the issue.
[Xposed Framework Modules] JayShortway:
I can't seem to reproduce this issue. Both AppContext's State and Event Profiles work fine for me using Chrome Beta 68.0.3440.70 on Oreo 8.1. Could you tell me which Android version you are using?
[Xposed Framework Modules] thecoolkid:
Resurrection Remix 6.1 (android 8.1), I'm using state profile. Other apps seem to work. I got it setup to disable heads-up notifications in certain apps since that functionality isn't supported in this rom
[Xposed Framework Modules] JayShortway:
Could you test by adding an 'Alert → Flash' Action saying "%acapp running" to the top of your Enter Task?
[Xposed Framework Modules] thecoolkid:
Yes, I did just that. I added the flash also to the exit task.

Chrome Beta 68.0.3440.70 doesn't trigger the flash at all. Even if I force close it and restart. All other apps trigger flash with their name and the flash when exciting them.
[Xposed Framework Modules] JayShortway:
Ah okay that's weird. Could you take a logcat of starting and stopping Chrome Beta using the AppContext version I had sent you previously via DM?
[Xposed Framework Modules] .:Addicted:.:
I also noticed same thing. I'm on 8.1 july update. Stock ROM. Latest chrome (stable not beta)

Other apps triggering fine. Chrome has some issues.
[Xposed Framework Modules] JayShortway:
Thanks for your report. I have sent you a DM with a version of AppContext with logging enabled. Could you take a logcat if you have the time? Thanks in advance.
[Xposed Framework Modules] thecoolkid:
I did and surprisingly this version works with chrome ? it's really weird. Anyway here's the log:
[Xposed Framework Modules] JayShortway:
Haha okay that's confusing. Thanks for the log. I will inspect it and investigate further.
[Xposed Framework Modules] thecoolkid:
Hi. Just to let you know, I updated my ROM today to the latest version (Resurrection Remix 20180722) and the version 0.4.7.2 is working with chrome again. So I suspect either I had a problem with my previous build or there was a problem with Resurrection Remix ROM that had since been fixed. Anyway no need to beat yourself up about that particular issue ?
[Xposed Framework Modules] JayShortway:
Ha that's great to hear, thanks for letting me know! Still weird, but I'm happy the problem went away :)
[Xposed Framework Modules] .:Addicted:.:
I'm using this to kill Instagram as soon a it's opened if certain condition is met. Also to log Instagram usage time. But problem is when i open Instagram, tasker kills it just fine using root. But when i open Instagram again, app context doesn't detect Instagram. So launch action doesn't work until i close & open Instagram again.

Anything workaround for that? I also noticed if i open & close apps fast, sometimes detection fails
[Xposed Framework Modules] JayShortway:
Hi, thanks for your report!

I suspect this has to do with Tasker killing Instagram using root. It is possible that Instagram never 'stops' (but is killed), and therefore AppContext is never notified of Instagram stopping, which results in AppContext not acknowledging Instagram starting again (because it never knew Instagram had stopped). Does this makes sense?:p

Could you try to kill Instagram with Tasker without using root?

Do you know a reproducible case where this happens?

Please let me know how it goes!
[Xposed Framework Modules] .:Addicted:.:
1. Tasker kill app feature doesn't work without root.

Can you suggest better method to kill Instagram?

For now instead of killing, I'll change action to go home.

2. That i have seen a lot of times. I use tasker to hide status bar for some apps. Device default color profile for camera apps & photo editing apps. I can confirm that. Will try to capture log with that issue.

Btw as you mentioned appcontext doesn't recognise app started if it didnt see app being stopped. Can you implement something like app focused & lost focus like xposed edge(even with that i was unable to achieve perfect app launch detection)

Edit1: tried "am kill" method with root which didn't kill Instagram. "am force-stop" with root method gave me same result as tasker's default kill app with root.
[Xposed Framework Modules] JayShortway:
You could try to simulate a Back-button press. AutoInput should be able to do it, or you can use the following shell command (probably needs root).

input keyevent 4

A log would be very helpful, thanks!

That is an interesting approach. I'll look into that.
[Xposed Framework Modules] dima-82:
Thanks for this module. I use it to de/activate GPS as soon as a navigation app starts/stops.

Are you still activelly working on this module? The above mentioned features would be nice.
[Xposed Framework Modules] JayShortway:
I'm glad you find it useful! :)

I am still working on it, but currently a bit short on time. I'm planning to do some maintenance work soon though.