[Q] Detect when a new window is shown - Xposed General

Hey guys.
I am trying to figure out when a new app is shown. I have tried hooking into the Activity class for onWindowFocusedChanged method which works under normal conditions.
For instance, my ROM has the ability to hold a button to kill foreground app. Works great. however, doing that, the onWindowFocusedChanged method is not called. So my module does not detect the focus is lost.
I am wondering if anyone else has any other ideas. AccessibilityService works perfectly. But uses a lot of CPU and other resources. Was thinking maybe Window.class or WindowManager.class would help as well. But not sure. Thanks guys for your time!

Can't you simply hook onResume or similar?

GermainZ said:
Can't you simply hook onResume or similar?
Click to expand...
Click to collapse
Only one problem left: "super" access -> http://forum.xda-developers.com/xposed/problem-invoke-super-methods-t2822375

defim said:
Only one problem left: "super" access -> http://forum.xda-developers.com/xposed/problem-invoke-super-methods-t2822375
Click to expand...
Click to collapse
I don't see how that is related in this case. Why would he want to call the super method explicitly?

GermainZ said:
I don't see how that is related in this case. Why would he want to call the super method explicitly?
Click to expand...
Click to collapse
eg for onResume the 1st call have to be super.onResume

defim said:
eg for onResume the 1st call have to be super.onResume
Click to expand...
Click to collapse
There's no reason to use beforeHookedMethod/replaceHookedMethod in this case, so the original method will call the super method, and afterHookedMethod can be used to e.g. send a broadcast without having to worry about it.

GermainZ said:
There's no reason to use beforeHookedMethod/replaceHookedMethod in this case, so the original method will call the super method, and afterHookedMethod can be used to e.g. send a broadcast without having to worry about it.
Click to expand...
Click to collapse
Yeas, with afterHookedMethod no problems, but i wanted to point to that, so he has not to do the same research as me

Thanks guys for your reply!
I did end up using an AccessibilityService. After much reading and testing, i have gotten the app to use .04 percent of the CPU in the last 5 hours. Pretty damn good! I am probably going to use this method anyhow.
I did hook onResume and onCreate, but some nothing would happen when some apps would show. For instance, the home screen of Apex launcher wouldn't trigger on onResume or anything like that. I even looked at the smali and it uses a LauncherActivity which extends the Activity class. So I was awfully confused. I tried it with both a before and after hooked method. I surely thought hooking onResume and onCreate would signify the opening of an app. But it didn't for all of them.
Thanks again for your replies!

Related

[APP][ROOT]ScreenToggle - turn off your screen (e.g. while plugged into hdmi)

Wanna turn your Screen off while watching videos over HDMI?
Or need a watchful Xoom but don´t want the screen to be on all the time?
Here´s the app you need!​
Description:
The App adds the posibility to turn off the lcd backlight to your xoom. Its nothing less then a shutdown-button for your display backlight.
The app toggles your lcd backlight to zero and back, said doesn´t just overlay your screen with black, like the other apps inside the market.
it turns off your screen light completly , but the screen stays responsible and the devices stays awake.
Use it instead of locking your xoom, if you need your device itself to be active but dont need the display to be on, e.g. while you´re watching videos over hdmi, use your xoom as a vnc server or something like that.
Click to expand...
Click to collapse
Use this awesome little App with some "starter app" of your choice.
For example, use the Shaking Shortcurt App, register ToggleScreenXoom.apk and you could turn your screen on/off with just shaking your device.
(tested on xoom [email protected] but should work on every rooted xoom)
Thanks to [email protected] for his work on this.
If you find this useful, hit the Thanks button. ​
Click to expand...
Click to collapse
The attached zip contains a regularly installable .apk
Just install it as every other .apk
DON´T FLASH THIS VIA RECOVERY!!
Click to expand...
Click to collapse
DUDE. That's what I've been searching for, don't know how I didn't find it, trying this tonight! Will update back with my results...
Update: Perfect solution. Works great, thanks!
App attached to first post!
does it work on xoom2?
Hello!
Fanstastic app.
Does it work on xoom2? with 3.2.2 rooted?
I used the old method that this thread started as, using market apps. Unfortunately it doesn't work with the Cornerstone version of the Eos roms. What exactly is app? Can you provide more detail? I don't just download apps to try them without some type of info...
I use the current method on cornerstone #16.
otis_bartleh said:
I used the old method that this thread started as, using market apps. Unfortunately it doesn't work with the Cornerstone version of the Eos roms. What exactly is app? Can you provide more detail? I don't just download apps to try them without some type of info...
Click to expand...
Click to collapse
description added to the first post.
jerrycycle said:
I use the current method on cornerstone #16.
Click to expand...
Click to collapse
Good to know...
aeros0ul said:
description added to the first post.
Click to expand...
Click to collapse
Cool, thanks, basically the same thing I have now with different apps. It's SwipePad that isn't working right with Cornerstone, I'll play around later. Thanks again for this...
otis_bartleh said:
Cool, thanks, basically the same thing I have now with different apps. It's SwipePad that isn't working right with Cornerstone, I'll play around later. Thanks again for this...
Click to expand...
Click to collapse
"Basically" the same as the old method, right. Just in one app without the need of configuration and with more flexibility to be launched by other apps.
Maybe you´ll try "Shaking Shortcurt". A nice app that lets you launch two other apps by shaking your xoom.
Yeah, think I'll try that instead of SwipePad. Since Swipepad rely's on the borders of the screen and Cornerstone alters the borders, I'm guessing that's the issue. Maybe the Shaking app won't have that issue.
Thanks again for the clarification, and the thread. I really can't believe this thread hasn't blown up!
Please excuse my ignorance but, how would I go about installing this??
Draxin said:
Please excuse my ignorance but, how would I go about installing this??
Click to expand...
Click to collapse
i dont understand your question.
just install the app and execute to turn off your screen and again (remember the position) to turn it back on.
or use a starter app like "Shaking Shortcut" to toggle the screen on and off by shaking your xoom.
aeros0ul said:
i dont understand your question.
just install the app and execute to turn off your screen and again (remember the position) to turn it back on.
or use a starter app like "Shaking Shortcut" to toggle the screen on and off by shaking your xoom.
Click to expand...
Click to collapse
Lol, sorry, haven't installed apps that i downloaded from a site before, only from the play store where everything gets taken care of for me, I had meant how to install this so that I could use it but i figured it out. Thank you very much, it works great.
aeros0ul said:
i dont understand your question.
just install the app and execute to turn off your screen and again (remember the position) to turn it back on.
or use a starter app like "Shaking Shortcut" to toggle the screen on and off by shaking your xoom.
Click to expand...
Click to collapse
Do we install by flashing zip file in recovery? Do we change the file to an apk? What is the way we should install the the file? Thanks
droidrev71 said:
Do we install by flashing zip file in recovery? Do we change the file to an apk? What is the way we should install the the file? Thanks
Click to expand...
Click to collapse
NO!!! don't flash in recovery, i say that, mainly cause I don't know what it will do... you can install the app while ics is running, I think I used astro but can't remember. What you just asked was the same thing I had wondered.
Draxin said:
NO!!! don't flash in recovery, i say that, mainly cause I don't know what it will do... you can install the app while ics is running, I think I used astro but can't remember. What you just asked was the same thing I had wondered.
Click to expand...
Click to collapse
You´re right. Thanks for the correction.
First post is edited to get it straight.
Does this only work on the xoom? I have an acer 510 and I want something like this. It sounds like this gets launched in conjunction with whatever app you launch. I'd rather that while on hdmi the tablet display is off entirely. Or maybe this does that as well.
So is this specific to the xoom?
sark666 said:
So is this specific to the xoom?
Click to expand...
Click to collapse
According to the readme provided in the zip file this application seems to be specific for the Xoom, or at least a few tegra 2 tablets.
That's disappointing. Why would manufacturer's assume that a user wants the display to stay on while using hdmi?! How about a sane default like leave hdmi output on and turn off tablet display after the normal inactivity duration. But allow a keyboard/mouse not to be recognized as tablet activity.
Could this be modified to work with more devices? Or say newer tegra 3 devices if it's chipset specific. But really, ics should have some application layer to control things like hdmi res, screen active etc...
Nice! Works in AOKP
First of all, this is a great app, and it works well in AOKP (build 37).
To trigger the app, I set my "home" softkey on my xoom (in Rom Control) to trigger the app when the key is held. Even though you can't see the softkeys when on hdmi, after a while, its exact location is easy to recall.
It is really convenient. Thanks for the much needed addition to a great device.

Tasker (And AutoRemote)

Anyone sideload these 2 apps yet? Especially now that Autoremote allows direct communication via BlueTooth...
nikkobenson said:
Anyone sideload these 2 apps yet? Especially now that Autoremote allows direct communication via BlueTooth...
Click to expand...
Click to collapse
Way ahead of you, except tasker won't install. Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]
I got Locale installed but it seems to crash when I try to add conditions.
Llama seem to work, it seems I can at least change volumes based on times of days, its a start. Not sure what profiles I would need with a watch but Llama might be the best bet right now
dipole said:
Way ahead of you, except tasker won't install. Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]
I got Locale installed but it seems to crash when I try to add conditions.
Click to expand...
Click to collapse
Damn.
autoremote
nikkobenson said:
Damn.
Click to expand...
Click to collapse
Okay I am wondering how to connect other devices? I know wrong place to
ask but am asking anyway?
I have not had problems installing autoapps just can't get other devices to connect or see it on search of nearby devices?

[Q] How to disable popup warning AFTER charging?

Hi,
I recently got a wireless charging receiver for the phone and now I get this annoying popup which says to close the micro usb properly to prevent water damage.
This happens also sometimes during charging in the middle of the night.
Can anyone tell me how to disable the popup? To make it clearer, it is not the flashing text that appears when the phone is connected to the charger. ( this can be disabled via xposed module)
The one I am talking about is more like a text with a white background picture.
"for protection against water damage firmly seal the charging cover before use"
Anyone else with the "problem" ?
I am on NEE-I9295XXUBMK2.
Thanks for the help in advance.
[edit]
this also happens when I disconnect the device from USB.
No one with this problem?
colida said:
No one with this problem?
Click to expand...
Click to collapse
I second that!
I have found battery_cover_notice.xml in systemui\res\layout
There is an battery_cover_notice_image and an battery_cover_notice_message
The Pic is help_img_usb.png in folder systemui\res\drawable-hdpi
Now you can try and delete the battery_cover_notice.xml from the SystemUI
Darkman said:
I have found battery_cover_notice.xml in systemui\res\layout
There is an battery_cover_notice_image and an battery_cover_notice_message
The Pic is help_img_usb.png in folder systemui\res\drawable-hdpi
Now you can try and delete the battery_cover_notice.xml from the SystemUI
Click to expand...
Click to collapse
I tried and it worked ( at least the popup doesn't appear anymore) but I do not have a notification area at the top anymore. No clock, Signal or anything.
Perhaps it's because of the odex file? Didn't touch that.
I will try it again. Might be, I did something wrong.....
Thanks
okay thanks for feedback...
I will investigate this....
So is there no non-root way of disabling this?
colida said:
Anyone else with the "problem" ?
Click to expand...
Click to collapse
I am.
No solution found so far.
Only I remember - that started after OTA update from Samsung in later 2013.
On original software I didn't have such warning.
Before and after is 4.2.2 Android, I didn't notice any changes, so I am lookiing for old firmware to download...
p.s. I also have wireless charger from "indiegogo"
shafty023 said:
So is there no non-root way of disabling this?
Click to expand...
Click to collapse
No sorry
Cloud it be that this notice is a toast with a custom theme? You could check it with my app EnhancedToast, and hide it if it is a toast. Enable logging in the app and watch it.And yes, root is required for Xposed. Btw, the Google edition don't show it at all
defim said:
Cloud it be that this notice is a toast with a custom theme? You could check it with my app EnhancedToast, and hide it if it is a toast. Enable logging in the app and watch it.And yes, root is required for Xposed. Btw, the Google edition don't show it at all
Click to expand...
Click to collapse
^Mostly what I was going to say, so thanks.
You should check EnhancedToast if you can, and you could always switch ROM's - I'm loving the CM 10.2 ROM, which doesn't have the warning, and offers a lot of other advantages. If a notification comes up in the bar, long-press it and see if comes up with the "app info" button - it could be run through some sort of stock app that you could disable or uninstall altogether.
Hi everyone! I'm new on the forum and in smartphones as well. Rooted GT-i9252 last week. Starting to develop app in future.
:cyclops:
tiskael said:
^Mostly what I was going to say, so thanks.
You should check EnhancedToast if you can, and you could always switch ROM's - I'm loving the CM 10.2 ROM, which doesn't have the warning, and offers a lot of other advantages. If a notification comes up in the bar, long-press it and see if comes up with the "app info" button - it could be run through some sort of stock app that you could disable or uninstall altogether.
Click to expand...
Click to collapse
Did I switch ROM when I rooted my phone? Is it the same thing?
tiskael said:
If a notification comes up in the bar, ...
Click to expand...
Click to collapse
No notifications, just message on bottom of the screen.
tiskael said:
I'm loving the CM 10.2 ROM, which doesn't have the warning
Click to expand...
Click to collapse
Any good source to learn more of ROMs? What do I lose if I dump the original, what do I get with some other ROM?
How should I backup? Meaning there's lot's of data:
- contacts and messaging and that stuff
- pictures, music, videos etc
- OS (?)
- ROM
- Apps (downloaded and system)
Maybe someone could explain the best practice to backup ROM,OS and apps.
Thanks in advance, Kaptah.
Kaptah said:
Hi everyone! I'm new on the forum and in smartphones as well. Rooted GT-i9252 last week. Starting to develop app in future.
:cyclops:
Click to expand...
Click to collapse
Welcome
Did I switch ROM when I rooted my phone? Is it the same thing?
Click to expand...
Click to collapse
What method of rooting your phone did you use? They are not the same thing, but it is possible to do them both at the one time. If everything looks different, then yes, you would have changed your ROM while rooting.
Any good source to learn more of ROMs? What do I lose if I dump the original, what do I get with some other ROM?
How should I backup? Meaning there's lot's of data:
- contacts and messaging and that stuff
- pictures, music, videos etc
- OS (?)
- ROM
- Apps (downloaded and system)
Maybe someone could explain the best practice to backup ROM,OS and apps.
Thanks in advance, Kaptah.
Click to expand...
Click to collapse
Check the link below, it's a good place to start.
http://www.android.gs/root-galaxy-s4-active-international-i9295-and-att-i337-models/
colida said:
Hi,
I recently got a wireless charging receiver for the phone and now I get this annoying popup which says to close the micro usb properly to prevent water damage.
This happens also sometimes during charging in the middle of the night.
Can anyone tell me how to disable the popup? To make it clearer, it is not the flashing text that appears when the phone is connected to the charger. ( this can be disabled via xposed module)
The one I am talking about is more like a text with a white background picture.
"for protection against water damage firmly seal the charging cover before use"
Anyone else with the "problem" ?
I am on NEE-I9295XXUBMK2.
Thanks for the help in advance.
[edit]
this also happens when I disconnect the device from USB.
Click to expand...
Click to collapse
Install Xposed installer, and then Wanam Xposed, the option you want you can find in the sound options there...
Bartbig said:
Install Xposed installer, and then Wanam Xposed, the option you want you can find in the sound options there...
Click to expand...
Click to collapse
I did not find this option ...
araignee said:
I did not find this option ...
Click to expand...
Click to collapse
Sorry, my mistake, i checked, but its in the Lockscreen options, almost at the bottom, @ power options there you can "Hide Wireless Charging Dialog"i think that's what you need...
You installed "Wanam xposed"?
Bartbig said:
Sorry, my mistake, i checked, but its in the Lockscreen options, almost at the bottom, @ power options there you can "Hide Wireless Charging Dialog"i think that's what you need...
You installed "Wanam xposed"?
Click to expand...
Click to collapse
OK I've found the option but it's not the one I was looking for. This one seems to remove the message when you plug your phone to the power supply. Maybe I'm wrong. Anyway thanks a lot for your help.
colida said:
No one with this problem?
Click to expand...
Click to collapse
This problem appeared/reappeared when i upgraded from 4.2.2 to 4.3 (ML2)
After rooting ( http://forum.xda-developers.com/showthread.php?t=2690133 )
and disabling KNOXagent it still gives this warning, which it did not do after the 4.2.2 Active Root.
This is merely an annoyance but if someone figures out a quick way to disable it that would be grand.
i have this issue too. cant wait for a fix for this. just updated to 4.3 a few days ago and having to tap the bubble everytime is just annoying. why the hell would they add these rediculous notifications? its not like att or samsung will stand behind the "waterproof" claim anyway..... water damage weather the door is open or closed means your screwed no matter what.
I've personally tried using the "EnhancedToast" module for xposed and the prompts do not register as toast events. It has to be something else.

Xposed module for AA

Hi,
I only like to start a thread about the development of an Xposed module for tweak AA.
Someone is interested on it?
Reagards!
manos78 said:
Hi,
I only like to start a thread about the development of an Xposed module for tweak AA.
Someone is interested on it?
Reagards!
Click to expand...
Click to collapse
Oh yes - I would be very interested. I just have to wait for another 1-2 months until my car (A4) with AA/CarPlay support will be delivered.
Unfortunately I am not a developer but I'd be one of your first supporters and I will gladly test anything you guys develop .
Since Android Auto has a lot of limitations, an exposed module would be the best way to get rid of them.
Not a lot of replies. Looks like there are still not enough people who have Android Auto . We'll have to wait until it catches on I guess.
yes - I think so, too. But I am also still hoping, that manos78 will start the development anyway
Absolutely. For example here maps for Android Auto would be awesome
would also love to see some android auto mods
Me too !
Let me know if I can help by anyway
I'm interested.
I've got a Pioneer AVH-4200NEX on the way, so I'll be looking at doing some Xposed work, depending on what functionality is missing. Not everything can be done via Xposed (like making Waze work over AA), but it would be good to get an idea of what sort of additional functionality people are looking for on the AA platform.
agentdr8 said:
I've got a Pioneer AVH-4200NEX on the way, so I'll be looking at doing some Xposed work, depending on what functionality is missing. Not everything can be done via Xposed (like making Waze work over AA), but it would be good to get an idea of what sort of additional functionality people are looking for on the AA platform.
Click to expand...
Click to collapse
Hey, it would be great to get rid of the limitation of only viewing few entries in a list when scrolling... I believe this is tracked via GPS, so it would be great to feedback a velocity of 0 to this process only.
manos78 said:
Hi,
I only like to start a thread about the development of an Xposed module for tweak AA.
Someone is interested on it?
Reagards!
Click to expand...
Click to collapse
I'm not a developer. But I'd love to try anything new.
donverse said:
Hey, it would be great to get rid of the limitation of only viewing few entries in a list when scrolling... I believe this is tracked via GPS, so it would be great to feedback a velocity of 0 to this process only.
Click to expand...
Click to collapse
Is this in specific apps only, or all AA-enabled ones?
(
agentdr8 said:
Is this in specific apps only, or all AA-enabled ones?
Click to expand...
Click to collapse
I would like to request this aswell. I know this happens on spotify and iheartradio for sure, its annoyi lng to the point i unplug my,phone and use it via bluetooth audio streaming to get to yhe play list i would like to when on a road trip on driving long miles with out stopping to change my play list its crazy that they do this for safety but ends up. Us plaaying with phone dissconnected due to the dam moving locks. (typed,on,my mobile device. Please excuse the typos)
agentdr8 said:
Is this in specific apps only, or all AA-enabled ones?
Click to expand...
Click to collapse
Yep I only know about spotify and gmusic as well. You just end up using your Phone in the Hand, there's really no point in this restriction
Sent from my LG-D802 using XDA-Developers mobile app
donverse said:
Yep I only know about spotify and gmusic as well. You just end up using your Phone in the Hand, there's really no point in this restriction
Click to expand...
Click to collapse
Is there an error message shown when you've hit this limitation? I've found "Unlimited browsing is disabled because car is not parked." in the AA apk, but I'm not sure if that's the proper verbiage when it's limiting listview scrolling.
agentdr8 said:
Is there an error message shown when you've hit this limitation? I've found "Unlimited browsing is disabled because car is not parked." in the AA apk, but I'm not sure if that's the proper verbiage when it's limiting listview scrolling.
Click to expand...
Click to collapse
Yes. If you've reached the tap limit you'll get a "you cannot continue browsing unless you're parked" message.
Sent from my Nexus 6P using Tapatalk
agentdr8 said:
Is there an error message shown when you've hit this limitation? I've found "Unlimited browsing is disabled because car is not parked." in the AA apk, but I'm not sure if that's the proper verbiage when it's limiting listview scrolling.
Click to expand...
Click to collapse
Im sure it that setting. They all seem to have this scrolling limit once you get past say...5 items or so.
I can post photo next time i am in my truck and have another phone to take the photo
chevyguy128 said:
Im sure it that setting. They all seem to have this scrolling limit once you get past say...5 items or so.
I can post photo next time i am in my truck and have another phone to take the photo
Click to expand...
Click to collapse
I still have my NEX on my workbench, so I can test this out later tonight. I believe it's in the AA SDK, so that individual apps don't have to determine if the vehicle is in motion or not. Shouldn't be too hard to work around.
Here's a request:
Would like to manage what apps show up on Android Auto (headunit)
For example, sideloaded apps currently do not show up
http://forum.xda-developers.com/and...o-general/to-loaded-app-android-auto-t3246489

3.5.3 debload?

Is there a working debload script for the 3T?
http://forum.xda-developers.com/showpost.php?p=69805724&postcount=3
ahmedradaideh said:
http://forum.xda-developers.com/showpost.php?p=69805724&postcount=3
Click to expand...
Click to collapse
Have you test this? Its safe too use it?
Schrotty35 said:
Have you test this? Its safe too use it?
Click to expand...
Click to collapse
It messed up Google search for me , so I am not recommending it.
I recommend manual de-bloat through Titanium Backup ★ root. It's much safer way to do it.
All the (well, 2 of them so far I've seen) debloating apps sure seem like oddball arbitrary choices. Some of the choices are things not only I use, but I think are used by the phone and are possibly able to screw up regular operations by removing them. I think @jemeljsh is pretty much on the spot when he says to just use TB to freeze things first , and then see if things look OK.
The whole "debloating" concept is a) arbitrary and b) individual (or did I just say the identical thing twice? ; . I'm in favor of some personal debloating (damnit, everything I say sounds weird now), but not from someone else's list.
ahmedradaideh said:
http://forum.xda-developers.com/showpost.php?p=69805724&postcount=3
Click to expand...
Click to collapse
It's safe, only hiccup I found after flashing is that something breaks the app locker settings screen. It still works protecting apps but you can no longer add/remove app or even disable app locker. Would love to work out what part broke it.
Sent from my ONEPLUS A3003
wozn said:
It's safe, only hiccup I found after flashing is that something breaks the app locker settings screen. It still works protecting apps but you can no longer add/remove app or even disable app locker. Would love to work out what part broke it.
Click to expand...
Click to collapse
If it broke the App Locker settings screen, I'd personally consider it NOT safe, but that's me

Categories

Resources