Turn HTC logo into a capacitive button - One (M7) General

I don't have the One yet and never seen it in real live but I was wonder whether it would be possible to turn the HTC logo into a menu button? On the One X the entire glass display is touch sensitive even the parts where there is no LCD

Impossible
Sent from my HTC One using xda premium

The logo definitely is in an area with touch sensing, but I don't claim to know whether or not the area can be defined as a button.

whmcal said:
Impossible
Sent from my HTC One using xda premium
Click to expand...
Click to collapse
Quite possible since the whole touch screen extends to where the capacitive buttons are, you can test this by going to a webpage and draging your finger down to the logo and see if it keeps scrolling
If it does then its very likely that someone could turn the logo into a button
Sent from my One X using Tapatalk 2

It doesn't keep scrolling if you drop off the screen onto the buttons or the logo.

Narom88 said:
It doesn't keep scrolling if you drop off the screen onto the buttons or the logo.
Click to expand...
Click to collapse
+1

AW: Turn HTC logo into a capacitive button
Check it out with adb get event.
That way we would know it for sure if it triggers an event when being touched.
Sent from my HTC One X using xda premium

im new to android so dont know what that is. But in developer options i enabled Show Touches and Pointer Location and they both show nothing happens when touching or dragging to that point.

AW: Turn HTC logo into a capacitive button
Narom88 said:
im knew to android so dont know what that is. But in devoloper options i enabled Show Touches and Pointer Location and they both show nothing happens when touching or dragging to that point.
Click to expand...
Click to collapse
That won't work as it can't show any touch on the logo as it's not a display.
Adb get event command is the best way to check it out.
Someone should do it
Sent from my HTC One X using xda premium

AW: Turn HTC logo into a capacitive button
The buttons are part of the digitizer, so its possible to map any point to a button, it has nothing to do with browser scrolling (it ends where the display ends)
insertcoined....

Put two fingers on the screen to Zoom in or out (on a photo or webpage), once you start zooming, slide both fingers to the capacitive buttons area & see if the zooming action still works.
On my One X, the whole area for the buttons still responds to the zooming in/out.

I've got use to it quite quickly and I'm starting to make mistakes when I go back to using the ONE-X. I like what they've done with the buttons.
Sent from my HTC One using xda premium

on our one x, we can customize s2w swipe distance to wake/lock the phone.
this is actually plausible IF the logo area is touch responsive

AW: Turn HTC logo into a capacitive button
shiningarmor said:
on our one x, we can customize s2w swipe distance to wake/lock the phone.
this is actually plausible IF the logo area is touch responsive
Click to expand...
Click to collapse
Yes, but someone has to find it out. I can check it tomorrow when I get my phone but maybe someone is faster
Sent from my HTC One X using xda premium

jonas2295 said:
Yes, but someone has to find it out. I can check it tomorrow when I get my phone but maybe someone is faster
Sent from my HTC One X using xda premium
Click to expand...
Click to collapse
malaysian htc one is bound for late april so..
cant do anything

This is quite an interesting idea, i didn't know that the whole area was a touch area and could be mapped, i hope someone manages to make the HTC logo a functional button

Sebianoti said:
This is quite an interesting idea, i didn't know that the whole area was a touch area and could be mapped, i hope someone manages to make the HTC logo a functional button
Click to expand...
Click to collapse
so confirmed the whole area is registering touches?
if so, ladies gentleman, we will have a central home button soon

OK - not sure if this helps or not - not started hacking phones yet, not rooted or su the One either.
adb shell getEvent -lt
(then lots of stabbing at the htc logo)
[ 22313.540611] /dev/input/event8: EV_SYN SYN_REPORT 00000000
[ 22313.610564] /dev/input/event8: EV_ABS ABS_X 00000018
[ 22313.610594] /dev/input/event8: EV_ABS ABS_Y 00000053
[ 22313.610594] /dev/input/event8: EV_ABS ABS_Z 000000fb
[ 22313.610594] /dev/input/event8: EV_SYN SYN_REPORT 00000000
[ 22313.680578] /dev/input/event8: EV_ABS ABS_X 00000017
[ 22313.680578] /dev/input/event8: EV_ABS ABS_Y 00000054
[ 22313.680608] /dev/input/event8: EV_ABS ABS_Z 000000eb
[ 22313.680608] /dev/input/event8: EV_SYN SYN_REPORT 00000000
[ 22313.751202] /dev/input/event8: EV_ABS ABS_X 0000000e
[ 22313.751202] /dev/input/event8: EV_ABS ABS_Y 00000055
[ 22313.751202] /dev/input/event8: EV_ABS ABS_Z 000000f4
[ 22313.751232] /dev/input/event8: EV_SYN SYN_REPORT 00000000
[ 22313.820574] /dev/input/event8: EV_ABS ABS_X 00000016
[ 22313.820574] /dev/input/event8: EV_ABS ABS_Y 00000052
[ 22313.820574] /dev/input/event8: EV_ABS ABS_Z 000000f9

Tetsumi06 said:
OK - not sure if this helps or not - not started hacking phones yet, not rooted or su the One either.
adb shell getEvent -lt
(then lots of stabbing at the htc logo)
[ 22313.540611] /dev/input/event8: EV_SYN SYN_REPORT 00000000
[ 22313.610564] /dev/input/event8: EV_ABS ABS_X 00000018
[ 22313.610594] /dev/input/event8: EV_ABS ABS_Y 00000053
[ 22313.610594] /dev/input/event8: EV_ABS ABS_Z 000000fb
[ 22313.610594] /dev/input/event8: EV_SYN SYN_REPORT 00000000
[ 22313.680578] /dev/input/event8: EV_ABS ABS_X 00000017
[ 22313.680578] /dev/input/event8: EV_ABS ABS_Y 00000054
[ 22313.680608] /dev/input/event8: EV_ABS ABS_Z 000000eb
[ 22313.680608] /dev/input/event8: EV_SYN SYN_REPORT 00000000
[ 22313.751202] /dev/input/event8: EV_ABS ABS_X 0000000e
[ 22313.751202] /dev/input/event8: EV_ABS ABS_Y 00000055
[ 22313.751202] /dev/input/event8: EV_ABS ABS_Z 000000f4
[ 22313.751232] /dev/input/event8: EV_SYN SYN_REPORT 00000000
[ 22313.820574] /dev/input/event8: EV_ABS ABS_X 00000016
[ 22313.820574] /dev/input/event8: EV_ABS ABS_Y 00000052
[ 22313.820574] /dev/input/event8: EV_ABS ABS_Z 000000f9
Click to expand...
Click to collapse
you definitely didn't hit anything else by mistake?
im sure someone who knows will be able to interpret properly, but it looks like it is registering an x y and z co ordinate with each time you pressed the "button"

It was throwing a constant series of event so I got ready to ^C with one hand and stabbed at HTC with the other and posted up a few events from the end of this session. If anyone has a more reliable command to test with I'll give that a go.
Sent from my HTC One using xda app-developers app

Related

Wimax 4G won't start up (logcat in post)

Wimax won't start since I went to ACS from dk28 quantum. No idea why. Anyone?
Edit: Sorry this post is a little sloppy. 2 dif logs but I don't think the one in this post will help. Yes I had 4g with dk28 (quantum rom). No matter what version of acs ..eb13 or ec05 or flashin is fixing this. I really don't want to go back to stock. Hoping for some insight before I take the last resort.
Log Collector version: 1.1.0
Device model: SPH-D700
Firmware version: 2.2.1
Kernel version: 2.6.32.9
[email protected] )
#1 Sat Mar 26 23:06:04 CDT 2011
Build number: SRF 1.1.0/Twilight Zone 1.1.0
ng/com.android.vending.TabbedAppBrowser paused=false}
03-30 21:25:43.809 V/InputDevice( 2908): ID[0]=0(0) Up(1=>0)
03-30 21:25:46.476 D/BatteryService( 2908): update start
03-30 21:25:46.506 D/BatteryService( 2908): updateBattery level:27 scale:100 status:4 health:2 present:true voltage: 3671 temperature: 270 technology: Li-ion AC powered:false USB powered:false icon:17302163
03-30 21:25:46.553 V/InputDevice( 2908): ID[0]=0(0) Dn(0=>1)
03-30 21:25:46.556 V/WindowManager( 2908): Dsptch > Window{48448308 com.android.vending/com.android.vending.TabbedAppBrowser paused=false}
03-30 21:25:46.576 D/SyncmlService( 2987): mBatteryReceiver: action - android.intent.action.BATTERY_CHANGED
03-30 21:25:46.599 V/NotificationService( 2908): notification manager receiver action = android.intent.action.BA
D/alogcat ( 6016): stopped
D/alogcat ( 6016): starting ...
V/WindowManager( 2908): Dsptch > Window{483ca3a0 StatusBar paused=false}
I/NotificationService( 2908): mScreenOn: true, mNotificationPulseEnabled: true, mInCall: false
I/NotificationService( 2908): turning off
I/NotificationService( 2908): mScreenOn: true, mNotificationPulseEnabled: true, mInCall: false
I/NotificationService( 2908): turning off
V/WindowManager( 2908): Dsptch > Window{483ca3a0 StatusBar paused=false}
V/WindowManager( 2908): Dsptch > Window{484038e0 StatusBarExpanded paused=false}
V/WindowManager( 2908): Dsptch > Window{484038e0 StatusBarExpanded paused=false}
I/WimaxService( 2908): ------WakeLock will be acquired----------------
D/WimaxService( 2908): + Received { what=0 when=4281182 arg1=1 arg2=1000 }
I/WimaxService( 2908): [setWimaxEnabledBlocking] Workmode = 0
I/WimaxHandler( 4958): WimaxStateReceiver: android.net.wimax.WIMAX_STATUS_CHANGED
I/WimaxHandler( 4958): WimaxStateReceiver: Wimax Status 2
I/WimaxService( 2908): wimax ON ---mModeWhieAPsleep = 1 mModemReset = false mEnableUSB = false mIsDMmode = false mbUSBTethered = false
D/StatusBarPolicy( 2908): received mWimaxStatus: 2
D/SyncManager( 2908): failed sync operation authority: gmail-ls account: Account {[email protected], type=com.google} extras: [ignore_settings=true sendwithoutsync=true ignore_backoff=true sendwithoutsyncMessageId=1364762305589411840 force=true expedited=true sendwithoutsyncConversationId=1364762305589411840 ] syncSource: 3 when: 7048379 expedited: true, SyncResult: stats [ numIoExceptions: 1]
D/SyncmlService( 2987): mBatteryReceiver: action - android.intent.action.BATTERY_CHANGED
V/NotificationService( 2908): notification manager receiver action = android.intent.action.BATTERY_CHANGED
W/PowerManagerService( 2908): Timer 0x7->0x3|0x0
D/SyncmlService( 2987): mBatteryReceiver: action - android.intent.action.BATTERY_CHANGED
V/NotificationService( 2908): notification manager receiver action = android.intent.action.BATTERY_CHANGED
D/dalvikvm( 6016): GC_FOR_MALLOC freed 5763 objects / 738616 bytes in 31ms
D/SyncmlService( 2987): mBatteryReceiver: action - android.intent.action.BATTERY_CHANGED
V/NotificationService( 2908): notification manager receiver action = android.intent.action.BATTERY_CHANGED
E/WimaxService( 2908): Failed to start Wimax.
D/StatusBarPolicy( 2908): received mWimaxStatus: 4
I/WimaxService( 2908): ------release WakeLock----------------
I/WimaxHandler( 4958): WimaxStateReceiver: android.net.wimax.WIMAX_STATUS_CHANGED
I/WimaxHandler( 4958): WimaxStateReceiver: Wimax Status 4
D/SyncmlService( 2987): mBatteryReceiver: action - android.intent.action.BATTERY_CHANGED
V/NotificationService( 2908): notification manager receiver action = android.intent.action.BATTERY_CHANGED
V/WindowManager( 2908): Dsptch > Window{483f6c58 TrackingView paused=false}
V/WindowManager( 2908): Dsptch > Window{483f6c58 TrackingView paused=false}
E/imdg81* ( 2908): IsShutDownStarted()
E/imdg81* ( 2908): IsShutDownStarted()
V/WindowManager( 2908): Dsptch > Window{484e5808 AtchDlgrg.jtb.alogcat/org.jtb.alogcat.LogActivity paused=false}

Random Clock Face! Please...

Alright guys, we have so many clock faces to pick from and I have a few favorite ones. The problem is is do not want to keep swapping them, and I alwasy favor one more then the other. We really need a randomizer, which will give the user an ability to set the change interval, from either 1.) every set amount of time, 2.) every time the screen turns on(for ambilent off users).
An advanced feature could be to pick which clock faces to put into the randomizer. Anyways, I am not a developer capable of such a feat, but I would pay more money then most app faces cost right now. I would help fund the development of it, ofcouse giving me the option to beta it
Thanks
smugyou said:
Alright guys, we have so many clock faces to pick from and I have a few favorite ones. The problem is is do not want to keep swapping them, and I alwasy favor one more then the other. We really need a randomizer, which will give the user an ability to set the change interval, from either 1.) every set amount of time, 2.) every time the screen turns on(for ambilent off users).
An advanced feature could be to pick which clock faces to put into the randomizer. Anyways, I am not a developer capable of such a feat, but I would pay more money then most app faces cost right now. I would help fund the development of it, ofcouse giving me the option to beta it
Thanks
Click to expand...
Click to collapse
I have been using Wear Facelift from the Playstore, it lets you choose which faces you want to have randomised and how often. Worked very well under Kitkat, not optimized for Lollipop yet, but hopefully will be soon.
Hope that helps
Dont know how to get rid of smiles that are in the task below, apologises.
Created using tasker and Watchmaker, using a profile that runs the task every morning, also using autowear to swipe to also run the task. Sets a random face every morning.
All that is needed is setup a couple of variables and a If statement each watch face. If you need help let me know
Watchran (78)
Run Both Together
A1: Bluetooth [ Setn ]
A2: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A3: Variable Set [ Name:%Lastwatchface2 To:%Lastwatchface Do Mathsff Appendff ]
A4: Variable Set [ Name:%Lastwatchface To:%Watchface Do Mathsff Appendff ]
A5: Variable Randomize [ Name:%Watchface Min:1 Max:19 ]
A6: If [ %Watchface eq %Lastwatchface | %Watchface ~ %Lastwatchface2 ]
A7: Goto [ Type:Action Number Number:4 Label: ]
A8: Else
A9: If [ %Watchface ~ 1 ]
A10: WM Change Watch [ Configuration:breitling custom Orange Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A11: End If
A12: If [ %Watchface ~ 2 ]
A13: WM Change Watch [ Configuration:BUNK3R WATCH red Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A14: End If
A15: If [ %Watchface ~ 3 ]
A16: WM Change Watch [ Configuration:fav1 Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A17: End If
A18: If [ %Watchface ~ 4 ]
A19: WM Change Watch [ Configuration:Tron Identity Disc5 Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A20: End If
A21: If [ %Watchface ~ 5 ]
A22: WM Change Watch [ Configuration:Joker 1 Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A23: End If
A24: If [ %Watchface ~ 6 ]
A25: WM Change Watch [ Configuration:Untitled watch Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A26: End If
A27: If [ %Watchface ~ 7 ]
A28: WM Change Watch [ Configurationpulence Damien Hirst Tribute Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A29: End If
A30: If [ %Watchface ~ 8 ]
A31: WM Change Watch [ Configuration:Ferrari Scuderia V.yos Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A32: End If
A33: If [ %Watchface ~ 9 ]
A34: WM Change Watch [ Configuration:CAT 2 Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A35: End If
A36: If [ %Watchface ~ 10 ]
A37: WM Change Watch [ Configuration:slipknot Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A38: End If
A39: If [ %Watchface ~ 11 ]
A40: WM Change Watch [ Configuration:Hamilton V3 Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A41: End If
A42: If [ %Watchface ~ 12 ]
A43: WM Change Watch [ Configuration:Aviary Racer LG Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A44: End If
A45: If [ %Watchface ~ 13 ]
A46: WM Change Watch [ Configurationmega x-33 Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A47: End If
A48: If [ %Watchface ~ 14 ]
A49: WM Change Watch [ Configuration:Black Shield Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A50: End If
A51: If [ %Watchface ~ 15 ]
A52: WM Change Watch [ Configuration:Black Hole Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A53: End If
A54: If [ %Watchface ~ 16 ]
A55: WM Change Watch [ Configuration:Sun Flare Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A56: End If
A57: If [ %Watchface ~ 17 ]
A58: WM Change Watch [ Configurationmega 3 Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A59: End If
A60: If [ %Watchface ~ 18 ]
A61: WM Change Watch [ Configurationpulence Rotor Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A62: End If
A63: If [ %Watchface ~ 19 ]
A64: WM Change Watch [ ConfigurationERRELET Turbine Racing alternative Package:slide.watchFrenzy Name:WM Change Watch Timeout (Seconds):0 ]
A65: End If
Thanks for the app. Works well so far!
Thanks for this app :3

LockScreen ameliorations and corrections

Hello,
I'm just sharing my way to automaticaly "swipe to unlock", "show notifications", etc... when display turns on by only using Tasker (no Secure Settings, etc... needed)
Here is the tasker code to simply auto-swipe the screen if the phone is not in your pocket when display turns on :
Code:
Profile: Auto Unlock (25)
Event: Display On
Enter: Unlock screen (7)
A1: If [ %Proximity ~ False ]
A2: Run Shell [ Command:input swipe 560 1840 520 1000 250 Timeout (Seconds):0 Use Root:eek:n Store Output In: Store Errors In: Store Result In: ]
A3: End If
Profile: Proximity (2)
State: Proximity Sensor
Enter: Set Proximity (5)
A1: Variable Set [ Name:%Proximity To:True Do Maths:eek:ff Append:eek:ff ]
Exit: Unset Proximity (27)
A1: Variable Set [ Name:%Proximity To:False Do Maths:eek:ff Append:eek:ff ]
Here is the tasker code to auto-swipe the screen if the phone is not in your pocket when display turns on and display not unwanted notifications when unlocked :
Code:
Profile: Auto Unlock (25)
Event: Display On
Enter: Unlock screen (7)
A1: If [ %TIMES > %LastNotificationTime + 1 & %Proximity ~ False ]
A2: Run Shell [ Command:input swipe 560 1840 520 1000 250 Timeout (Seconds):0 Use Root:eek:n Store Output In: Store Errors In: Store Result In: ]
A3: Status Bar [ Set:Expanded ] If [ %Notification eq True ]
A4: Variable Set [ Name:%Notification To:False Do Maths:eek:ff Append:eek:ff ]
A5: End If
Profile: New Notification (26)
Event: Notification [ Owner Application:* Title:* ]
Enter: Show/hide Notifications (8)
A1: Variable Set [ Name:%LastNotificationTime To:%TIMES Do Maths:eek:ff Append:eek:ff ]
A2: Variable Set [ Name:%Notification To:False Do Maths:eek:ff Append:eek:ff ]
A3: Variable Set [ Name:%Notification To:True Do Maths:eek:ff Append:eek:ff ] [COLOR="Green"]If [ %NTITLE !~R .*alarm.* ][/COLOR]
Profile: Proximity (2)
State: Proximity Sensor
Enter: Set Proximity (5)
A1: Variable Set [ Name:%Proximity To:True Do Maths:eek:ff Append:eek:ff ]
Exit: Unset Proximity (27)
A1: Variable Set [ Name:%Proximity To:False Do Maths:eek:ff Append:eek:ff ]
IMPORTANT NOTES :
- Please let me know if it works or if it is buggy on your device : nobody's perfect...
- This will swipe automaticaly each time anything is setting the display to "on" (double tap the screen, power button,etc... but also an app).
- Root is required but unlocked bootloader in not needed
- You can replace the If [ %NTITLE !~R .*alarm.* ] part of the code with something like If [ %NTITLE !~R .*ring.* & %NTITLE !~R . *mail.* ] to add/edit new notification title filters (regex).
- This code will work nearly every time but depends of you phone's velocity (no problem on my axon 7 A2017G)
News
25-10-2016 -> I'm currently testing a third release showing/hiding notifications by swiping your hand above the device ...
Reserved space
Thanks for sharing this!
toastyy said:
Thanks for sharing this!
Click to expand...
Click to collapse
My pleasure...

Screen density: Minimum width (dp) & Display size (dpi)! Tablet texting issue.

Below is a list of the Minimum width (dp) settings I have tested and documented and their corresponding Display size values (dpi). The UI mode has been noted and an asterisk notes a maximum or minimum for a display mode (phone, phablet, or tablet). (Please correct me if I am using the incorrect terms anywhere here.)
Enable Developer Options - Find "Minimum width"
[ ] Minimum width (portrait) / Display size (custom)
[ ] 550 / 418 Phone
[ ] 575 / 400 Phone
[ ] 595 / 387 Phone
[ ] 598 / 385 Phone*
[ ] 600 / 384 Phablet* (Chrome tabs)
[ ] 625 / 368 Phablet
[ ] 650 / 354 Phablet
[ ] 675 / 341 / Phablet
[ ] 700 / 329 Phablet
[ ] 717 / 321 Phablet*
[ ] 720 / 320 Tablet* (Chrome tabs)
[ ] 725 / 317 Tablet
Click to expand...
Click to collapse
Note About Google Assistant, Texting, and these display settings:
I always change my screen density as I prefer the tablet display mode and hate the oversized screen elements. This time I ran into an issue that drove me nuts. Changing from phone to phablet or tablet UI mode changes Google Assistant mode from phone to tablet. This can cause Google Assistant to go from sending texts on command to saying, "I don't know how to text yet."
Google Assistant Settings - Note: "Phone" changes to "Tablet"
Retraining the Voice model after increasing Minimum width past phone modes does not seem to fix the issue. Rebooting doesn't seem to help. Changing the Minimum width then retraining (possibly after a requisite reboot) DOES reenable Google Assistant texting. It also seems that if Google Assistant is trained while in Phone mode, increasing the Minimum width to any of the above settings without rebooting afterwards will allow Google Assistant to text until the phone is next rebooted.
(I'll clean this text up later.)
I have submitted a Feedback Request about this. Do the same if this annoys you too.
What smallest DPI u recommend for this device? Mine defaults to 411... Curious since I'm having some touch issues.
galaxys said:
What smallest DPI u recommend for this device? Mine defaults to 411... Curious since I'm having some touch issues.
Click to expand...
Click to collapse
I'm currently set at 720/320. I tried keeping it at the highest phone UI dp but it drove me nuts within an hour. I have touch issues too (near the edges, making folders/groups), but benefits versus costs for me still come down to tablet mode.
Looks like the touch issues should be resolved in a future update.
Is there any way to keep it in phone mode with the lower DPI settings?
Best I found for retaining phone UI is:
433 DPI / 532 dp Smallest Width
..

Useful Tasker script for rooted head units

Device needs to be rooted!
This does not work with apps from the supplier as radio, phone, player, video etc. These are nearly all included in the com.car.ui and I did not yet find a way to get them "catched".... may be there is another way... Would be nice if someone could point it to me.
Target of this script with Tasker:
I just wanted to reduce touch screen using while driving.
To start may be a player with a click on a button is one thing, but I may don´t want to stay in this app.
In this case I need to click the Home button and choose another app. On a head unit without hardware buttons sometimes hard to get the home button clicked.
But If I need to play around with the settings of the app, I don´t want to get rejected to the home screen during changing the app settings....
So the target was to create a task which:
Moves the app to background after a short time
To not move the app to background while touching the screen
To move the app to background if there is no touch within a predefined time.
I found a way to get back to the home screen if I opened a player (in this case DAB-Z from realzoulou) by using shell commands.
Example:
Code:
DAB_RETURN (3)
A1: Variable Clear [ Name:%Touch Pattern Matching:eek:ff Local Variables Only:eek:ff ]
A2: Wait [ MS:100 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A3: Variable Clear [ Name:%Dab Pattern Matching:eek:ff Local Variables Only:eek:ff ]
A4: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A5: Run Shell [ Command:cat /proc/$(pidof -s com.zoulou.dab)/oom_adj Timeout (Seconds):0 Use Root:eek:n Store Output In:%Dab Store Errors In:%Dab_false Store Result In: Continue Task After Error:eek:n ]
A6: Wait [ MS:100 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A7: Run Shell [ Command:getevent -c 1 /dev/input/event1 Timeout (Seconds):5 Use Root:eek:n Store Output In:%Touch Store Errors In:%Touch_false Store Result In: Continue Task After Error:eek:n ]
A8: If [ %Touch Set ]
A9: Goto [ Type:Action Number Number:1 Label: ]
A10: Else
A11: Run Shell [ Command:cat /proc/$(pidof -s com.zoulou.dab)/oom_adj Timeout (Seconds):0 Use Root:eek:n Store Output In:%Dab Store Errors In:%Dab_false Store Result In: Continue Task After Error:eek:n ]
A12: Wait [ MS:100 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A13: If [ %Dab !~ 3 ]
A14: Go Home [ Page:1 ]
A15: Else
A16: End If
A17: End If
To use it for other apps you need to find the package name by using the shell:
Open ADB on your PC, connect to your Android in the same WiFi by:
adb connect [IP-Addresse]
adb shell
top (this command does not stop. You need to press "q" on your keyboard to stop it)
The output shows all running apps on your device. You need to search for the app name you want to use with this script.
Code:
cat /proc/$(pidof -s [app-name])/oom_adj
For DAB-Z it is:
Code:
cat /proc/$(pidof -s com.zoulou.dab)/oom_adj
This command returns the status of DAB-Z:
1 = App in foreground
0= App not running, or in background
Other apps can show different states. You need to find the status by using your PC for each app you want to get managed by this task.
The shell command:
Code:
getevent -c 1 /dev/input/event1
fetches touch events on the screen....
and waits in my script 5 sec, stores a touch in %Dab and keeps it empty if there was no touch on the screen.
If you touch it, the variable will be filled with a "0" (zero), otherwise the shell throws an exception which is the trigger to go back to the home screen.
Have fun with it.

Categories

Resources