yashsingh1/xdaforums huggingface dataset:
[FYT Android Head Units] j0hn83:
Use tasker on your phone to accomplish the same thing.

I don't think it will be possible (or certainly not easy) to get the Bluetooth dialer app to automatically dial a specific contact.

If you have a SIM card inserted in your head unit then it may be possible with tasker on the head unit via something like the Google phone app.

The head unit can make native calls with a SIM but cannot receive them.
[FYT Android Head Units] leo989:
Hi Mr Surfer63, You are such an genius.

Your app works smoothly but I am trying to simulate some key press by: input keyevent 3, input tap x y... but no luck (I have changed the method to "by system call")

I noticed that my head unit can't connect through adb by usb cable (adb devices command showed nothing, I am finding the way to fix it). Is it the reason that the "system call" does not work?

Is there any solution? Tks.
[FYT Android Head Units] surfer63:
Don't exaggerate please.

What do you mean with "input tap x y"?

You first need to enable adb access via the developer settings.
[FYT Android Head Units] Der_Mensch:
Hi, surfer63!

Thank you for this helpfull app. Just one question, may it be ported to QF001 (ROCO K706) platform?
[FYT Android Head Units] surfer63:
No, sorry. Like mentioned, it is purely for FYT.

It would need a complete rewrite for another unknow platform with unknown apps and activities.
[FYT Android Head Units] leo989:
I enable adb and I do terminal command successful from my laptop, ie: "adb shell input tap 400 500" or "adb shell input keyevent 3",

But I failed to do it inside FYTOnekey (I chose call method: by system call, and also try different command: adb shell input tap 400 500/shell input tap 400 500/input tap 400 500; I even tried to have the command with " " or without " ").

All command I send inside FYTOneky there is no feedback or no error notification.

Looking forward to having your instruction. Many thanks.
[FYT Android Head Units] leo989:
Dear Mr @surfer63 , could you please explain how to use "terminal command/script" inside FYTHWOnekey? I can see it is very powerful features, but I can not make it work. Looking forward to have an example . TKs.
[FYT Android Head Units] surfer63:
Have you read the Readme? That one contains examples.
[FYT Android Head Units] leo989:
Yes, I chose Call method : by system call, then "input keyevent 3", exit app, but it does not work.

(I even tried this script with/without "", tried "adb shell input keyevent 3"/"shell input keyevent 3",

If I send this scripts through a laptop (by adb command), it works normally.
[FYT Android Head Units] surfer63:
It might be broken then in the apk, or Amdroid 10 is more restrictive in its security. I will have a look.
[FYT Android Head Units] spoonzz666:
Thanks for app. Only the BAND button works and BT Phone works. Both are the "mode button" of my 2016 RAV4. I'm using a teyes cc3 360 head unit.

Unfortunately I'm only able to cycle between band and bt phone. Bt av, av, and video will not cycle. Any ideas what I could try?

Normally without the app, mode button will cycle through radio, music player, Bluetooth, video player.

I wish these manufacturers would just give us the option of what programs/apps to cycle through...
[FYT Android Head Units] surfer63:
Are you using NavRadio?

That stops the cycling of the apps and has nothing to with the app.

As I do not have a unit with buttons at all since 2½ years, I do not maintain the app anymore.
[FYT Android Head Units] drawz:
Is there a way to export/import settings? Or are they saved in a user accessible file somewhere?
[FYT Android Head Units] surfer63:
No, that's not possible. The settings are stored as application settings according the standard Android way. You can't access that.
[FYT Android Head Units] Santirx:
I was able to use the FytHWOnekey app to assign function to a steering wheel button in an FYT Android Unit I installed in my 2015 Porsche Macan. This steering wheel control button was hardcoded to change mode in the unit, which is not ideal as this button is assignable and used to control other functions in the car.

I was able, with the app, to kill the function of the button in the unit. And also able to configure it to skip media songs.

The issue I have (which is a minor issue honestly, but I would like to know if you have a potential solution), is that when I open the CarLink 2.0 application for CarPlay, every time I press the button, the screen blinks.

See video here (you can jump to minute 18:40 to see the blinking):

I configured BAND and all Carousel options with the ADB Shell command "shell:input keyevent 87" to skip media.

The blinking only happens with CarLink 2.0. All other functions work without blinking.

Any ideas?
[FYT Android Head Units] surfer63:
Carlink is supposed to only and always work in the foreground.

When you tap a re-assigned key, the FYTHWOneKEY app is started to take care of the redirection of the key. This takes only a few milli-seconds, but in those few milli-seconds, it "disturbs" carlink. After those few milli-seconds, the app is already closed again.

This can't be avoided as carlink is programmed like that.
[FYT Android Head Units] Santirx:
I got into the car without my phone so that CarLink 2.0 remains in the green connection screen, and pressed the source/mode button and it didn’t blink. Only when CarPlay is running it blinks.

So, the app doesn’t affect CarLink itself, but CarPlay when running on top of CarLink. I think that’s what you are saying, but wanted to confirm.
[FYT Android Head Units] surfer63:
DVD works. I tested that. Aux is my fault. I had read that you had verified. It is corrected on the Release page.

One thing that came to mind about the BT phone: I also need to check the activies itself. If you select a contact and select to call that contact, it really should start the BT phone.

If I capture that intent in the FytHWOneKey, then the functionality where you really want to start the BT app in phone mode, will now also start your own selected app. That is of course not what you want.

XFytTweaker works the other way around. It captures the entire function for the button and replaces it. It works on the button press itself.

In this app the called event is rerouted by an app using the same intent to start something else.
[FYT Android Head Units] IG_Vasilich:
Hi Surfer,

have you had a time to make another try to replace BT apps (with activities) in this app?
[FYT Android Head Units] surfer63:
No sorry. I did some initial work on a test app with a few buttons to start specific activities, but did not test it yet. I have been busy with JET the past week and I limit myself to up to max. 1½ hour "android fiddling" a day (next to a lot of reading, walking and 1-2 movies a week. And on top of that: I still have to work 8 hours a day :)).

I hope to finish some JET things tonight for the mods and then I will continue again with this "project".
[FYT Android Head Units] IG_Vasilich:
you don't have to explain that your free time is limited :)

I just wasn't sure whether i have missed any update in last 2 weeks :)

Pls let me know if you have smth to test for me :)
[FYT Android Head Units] IG_Vasilich:
just FYI: i had to change touch screen, and while HU was disassembled, i reinsert flat cables from button board with "MODE" key, so now it works again. and HW key "MODE" seems to generate same event in SofiaServer, as the steering wheel button, configured as "MODE", because there is no difference whether i press SW button or HW button.
[FYT Android Head Units] feket663:
I have a Joying JY-UOS04N4G unit, and I use it with satisfaction. Only one problem I have from the beginning... I don't like the original music player, I prefer the Mortplayer, but I can't select this from steering whel. Few days ago I discovered this wonderful application, installed, and now my head unit is perfect for me. Thanks for development!
[FYT Android Head Units] surfer63:
[MENTION=2946605]IG_Vasilich[/MENTION]:

It took somewhat longer as I spent my time on other things. :)

Please try attached version. Please let me also know the difference between BT Phone and BT AV.

Edit: What I forgot to mention. I do not think there is an issue when starting the BT Phone or when dialing from a contact. I think the latter is done via a service in the BT app that listens to another intent.
[FYT Android Head Units] IG_Vasilich:
Unfortunately, switching to v1.1.1 hasn't changed anything: everything can be changed except BT Apps.

I cleared defaults for all apps, and got "please choose" requests for every app except both BT apps - those 2 just have been started without any question.
[FYT Android Head Units] surfer63:
I checked a bit deeper now and the BT apps are not called by packagename or intent, but by broadcast. It means that I have to use a broadcast receiver. That also means that I have to downgrade the SDKs and target up to max android 6 as it is not allowed to use general broadcast receivers on Android 7 and up (that is also how FYT does it).

To be continued.
[FYT Android Head Units] surfer63:
I can't check the BT broadcasts right now. Still thinking about it.

I still had my ACC_ON and ACC_OFF broadcasts in another unfinished app. I added these as well now: The ACC_OFF works fine. The ACC_ON is not called. I do not know why (at the moment).
[FYT Android Head Units] IG_Vasilich:
Hi [MENTION=2550900]surfer63[/MENTION]

Have you had time to check your another unfinished app? Is it somewhat, that others could use?

I am asking because my unit lost all android settings last week, so before i do my standard thing with Automate and switching off player after ACC_OFF i thought i ask you how far are you with your apps :)
[FYT Android Head Units] surfer63:
I just started working again on it Yesterday. At this moment it is a bit borked, but I hope to put a new version on-line this evening.
[FYT Android Head Units] surfer63:
It was a big disappointment. Something was completely wrong, so I moved back quite some commits. That took some time.

Changelog:

Beta due to new combined MODE button functionality

Modify BT rotating mode again. Can't test myself.

Implemented ACC_OFF and ACC_ON functionality; ACC_ON only functions with nokill mainserver mod.

Releases: https://github.com/hvdwolf/FytHWOneKey/releases/

And another huge bug. Sorry. I pulled back the release.
[FYT Android Head Units] surfer63:
Changelog:

V 1.2.1 Beta due to new combined MODE button functionality

Modify BT rotating mode again. Can't test myself.

Implemented ACC_OFF and ACC_ON functionality; ACC_ON only functions with nokill mainserver mod.

Releases: https://github.com/hvdwolf/FytHWOneKey/releases/
[FYT Android Head Units] IG_Vasilich:
will it work if i put the package name in nokill.txt in SofiaServer?
[FYT Android Head Units] surfer63:
Maybe. I did not test yet.

======

And a bit off topic: I still have an unfinished apk that

lets you select the packages you want to keep "alive"

unzip the main server apk to a temp location

adapt the unkill_app.txt

zip it again

copy the modded one to /system again

But I haven't looked at that one for a very long time as the later PX5 ROMs simply "restore" the state they were in before deep sleep. If I had my navigation and music player active, they will return after deep sleep. Another reason why I don't care anymore about the nokill version.

As far as I can remember the Sofia did not do this.
[FYT Android Head Units] IG_Vasilich:
Tested version 1.2 right now. Results:

1. App crashes when trying to change the setting "ACC_ON: send play command to active player". After restarting the app the setting seem to be changed. But if i try to change it - app crashes again.

2. App crashes when pressing MODE button and BT app should be started. subsequential presses on MODE after that do what expected - except BT phone and BT music. After manual app restart i got the same "APP was crashed" android message when BT phone should be started.

3. It appears that ACC_OFF doesn't work for my Sofia unit. in my SOfiaServer i see

public static void accStatusFor3Others(int accOn) {
if (accOn != FinalRemoteToolkit.OFF) {
JumpPage.broadcastByIntentName("com.glsx.boot.ACCON");
} else {
JumpPage.broadcastByIntentName("com.glsx.boot.ACCOFF");
}
}

, but in your code my accoff event name is commented out. IS there any reason for it?

I assume that when app crashes on settting play for ACCON, there happens something bad inside, so the ACCON event also doesn't work for me , though the intent name for ACCOn is in your code. ?

All this was tested on SofiaServer without modifying nokill_app.txt. Joying FYT6021 with latest firmware (01.2018).

If i can help to debug anything - let me know.

---------- Post added at 15:09 ---------- Previous post was at 15:04 ----------

if Deep sleep is the state that comes after ca. 10 minutes ACC_OFF signal, then - Sofia restores active apps, if those apps are either Navi, or are present in the nokill list or player_app list.
[FYT Android Head Units] surfer63:
Sorry for being so sloppy. I currently have 4 development trees next to each other "to try all kind of things".

1. Indeed. Must be something small. The code that does the setting, is diffferent from the code that reads the setting and "does something". ACC_ON can still work, but I will check.

2. I still can't test that and need to theoretically approach that.

3. Sorry. I knew the "com.glsx.boot.ACCOFF" was the old way FYT did it. I had not realised that it was still used on the Sofia. So obviously I still need this one for Sofia and the other for the PX5 and 9853i.

You can certainly help with BT as I can't test that myself. I thought I had a "simulation mode" working, but it is not working at all.
[FYT Android Head Units] surfer63:
Version 1.2.2

Changelog:

Beta due to new combined MODE button functionality and ACC_OFF and ACC_ON functionality

Note: The BT functions in rotating MOD/SRC button/option still do not function. The others in this rotating carousel MOD/SRC button/option do function.

In 1.2.2:

Fix crash in ACC_ON settings

reactivate Sofia ACC_OFF intent (different from PX5 / 9853i)

Create simple About screen

From 1.2/1.2.1 (Not yet modified in 1.2.2):

Modify BT rotating again. Can't test myself.

Implemented ACC_OFF and ACC_ON functionality; ACC_ON only functions with nokill mainserver mod.
[FYT Android Head Units] IG_Vasilich:
Will check it tonight.

BTW, is there any chance to send "play" intent to the app, defined as substitution for e.g. Media app?

Right now the player starts, but doesn't start to play, so i need one more movement towards HU (to press Play in appeared player).
[FYT Android Head Units] surfer63:
I have seen that. Same as using the EQ button (for example) as Next button (as I don't have steering wheel buttons).

That's is exactly what I'm try to get working for many days already and for which I now asked a question on stackoverflow, although that is just an example app to show my problem.

If I get that working, I will release it immediately because that is what I myself really need/want ;)
[FYT Android Head Units] IG_Vasilich:
1. I have tested new app -- same behavior on trying to run BT. But no crashes anymore when trying to set play on ACCON.

Still - neither ACCON nor ACCOFF do what those are expected to. So maybe you send the message in unusual way? (i haven't check the source code yet).

2. Somewhen I made small app (my second one for android) to check the "next" behavior for specific player. both behaviors (intent and MediaKey) worked for me (and for any player), so if you want to check how i did it - see attach
[FYT Android Head Units] surfer63:
How does it work? If I press down or up or down&up nothing happens for my player.

Sorry, it does work when using mediakeyevent.

Edit: And it does work in my example app, so I applied it now as well in my FytHWOneKey.

You are simulating keypresses, so I guess my error was that I first have to send the KeyEvent.ACTION_DOWN and then the KeyEvent.KEYCODE_MEDIA_NEXT (which is a result from the simulated push button down; up is the release of the button)

I can't test right now in the car as I'm not at home the next 2 days, which is a bit frustrating right now ;)

private void sendMediaKeyEvent() {
AudioManager am = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
KeyEvent event = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_MEDIA_NEXT, 0);
am.dispatchMediaKeyEvent(event);
finish();
}

As I do not use a gui for the execution I need to give a finish() to close the app.
[FYT Android Head Units] IG_Vasilich:
I have seen that most of the players react on the ACTION_UP event (that is why i made separate events to try in the app).

Have you tested the way you send pause/play keyevent via shellexec? It seems that is doesn't work on my Sofia (tested with AIMP, JetAudio and FYT music player)
[FYT Android Head Units] surfer63:
By now I tried at least 4 different "shellExec" methods, but none of them work with the "input keyevent <keyevent>".

The weird thing is that it did work from the Xposed modules.
[FYT Android Head Units] IG_Vasilich:
Can you use the method i suggested (MediaKeyEvent, just use Pause or Play as event)?
[FYT Android Head Units] surfer63:
Changelog 1.3.0:

Beta due to new combined MODE button functionality and ACC_OFF and ACC_ON functionality

Note: The BT functions in rotating MOD/SRC button/option cannot be tested by myself. The other functions in this rotating carousel MOD/SRC button/option do function.

Add "Media Key" option to EQ button (Thanks to IG_Vasilich): If you have a unit with hardware buttons, this EQ button is pretty useless for everyday operation. So I made it possible to assign a "Media Key Event" to it if you don't want to use it for assigning an app to it (default option). This means you can assign next/previous/play/pause/toggle-playpause to it. Especially on a car without steering wheel keys and with hardware buttons on the unit this is really helpful (that is: to me in my car with my unit)

Alter mediaplayer pause/start to ACC_OFF/ACC_ON function to same function used for EQ button.

Add receiver for BT functions for MOD/SRC carousel button. Does it work? I don't know as I can't test it.

Minor modifications/additions to explaining Readme on github page.

That "secondary" function of next/previous/play/pause/toggle-playpause can easily be extended to any of the currently configured buttons (apart from those nasty BT mod/src functionalities probably).
[FYT Android Head Units] IG_Vasilich:
back from vacations.

Tested 1.3.0. Results:

ACCON/OFF work.

BT Phone works (first i see BT phone UI, but then comes the app i configured in OneKey app)

BT AV doesn't work (shows BT AV UI, and not the app i condifured in OneKey)

the rest works as expected.

Now questions:

1. ACC ON/OFF - work, but after unit restart i have to think about starting OneKey app. Any chance to implement autostart feature there? (i have edited nokill.txt in Sofia, so expect to get it running always after first start)

2. Some apps take longer to initialize (at least 1st time), so i get music from my first playing again after switching to another music player (because another music player is not yet active?). Sorry for being lazy and not checking source code, but it seems that OneKey sends "Play" event directly after starting the configured app, correct?

Nevertheless -thanks for your app.
[FYT Android Head Units] surfer63:
ACCON/OFF should work on Sofia, but it doesn't work on PX5/9853i. As of Android 8 it is no longer allowed to use that broadcast unless it is a system app signed with the same system signing.

I'm currently experimenting with the "android.hardware.usb.action.USB_DEVICE_ATTACHED" as that should be called as well when the unit boots and when it gets back from sleep. Of course you need to have something attached on USB.

I removed the "android.permission.RECEIVE_BOOT_COMPLETED" but will add it back.

So actually it should be something like (pseudo code):

if boot_completed received or ACCON received
startup_functions
usb_check = false
else if (USB_attached received AND usb_check not false)
startup_functions
[FYT Android Head Units] surfer63:
[MENTION=10056655]winaxe[/MENTION]:

With regard to your PM question about being able to start an app by activity like the BT Music activity in the BT app: The functionality is already in the app but not working properly on all platforms so it is hidden.

Currently my prio is focused on a java project for the pc (Linux/Windows/MacOS), but mostly on "being outside".

However, a year ago (or so) I created the "BTMusicStarter" apk. A plain simple micro apk which does nothing else than starting the BT app in "music mode". It was created because the CarWebGuru launcher does not have easy accessible means to start apps by secundary activities: It only shows an icon for the main activity. My micro apk simply gives you another icon to start the app. You can install it from my JET apk, but I attached it now here as well.

You can use that as well as a "kickstarter" to do what you want as long as "start app by activity" is not available yet.
[FYT Android Head Units] angelparras:
[MENTION=2550900]surfer63[/MENTION] It is possible to change the steering wheel key functions for opening spotify and waze with src button?

Whe i change the MODE functions, the MODE button only opens the main app but never change between apps, when i press the MODE button it changes but reopens the same app.

I think the systems needs to know that he is on determinated app to change to the next app.

I mean, the SRC button is not personalizable (cutmizable) for me.

Could you help.
[FYT Android Head Units] surfer63:
No, actually not. It has already been asked before. FYT has actually hardcoded this. They check what is on your unit: DVD-player, CAN-bus, and the "normal" apps. Based on that FYT creates a carroussel of options. It is too difficult to "break" that.
[FYT Android Head Units] angelparras:
Does not exist any folder or place inside the internal memory who allows this commands and change it, or map it to relevant apps.

I mean, actually FYT needs to know in which app i am right now to create a carrousel, so now, i want to change the route of this carrousel and put it in only two apps.

I am explaining?
[FYT Android Head Units] surfer63:
No, It simply checks which JOYING apps are available (installed) and which navigation app, if assigned via the settings..

It doesn't care at all whether you use Spotify, VinylMusic Player, Folder player, Magic Earth, OsmAnd+, Maps, etc. etc.
[FYT Android Head Units] knad78:
Thank you for the app.

My Joying HU (Android 10 UIS7862) has CAN module and the only steering wheel button I can change is MODE (with your app).

Is there a way to add EQ "secondary" function of next/previous/play/pause/toggle-playpause to "BAND" button? For some reason when I press MODE - it triggers BAND configuration.

Thank you.
[FYT Android Head Units] surfer63:
I actually do not know. On Sofia/PX5/sc9853i all underlying calls worked the same. I don't think they work differently on a uis7862 as user @warata also uses the app on his uis7862.

Anyway: I wanted to do a new release as I found a mini bug in the app. It had to do with how the radio is called, but that can indirectly influence the Mode button as the mode button also has the radio it its carrousel options.

Note that the Mode submenu has multiple options, but actually every button, whether directly called or via the Mode/SRC button, does for that specific app the same call.