yashsingh1/xdaforums huggingface dataset:
[FYT Android Head Units] surfer63:
Because my methods check whether the call option and the call entry text is filled, before activating the hook. So I only hook it when those requirements are fulfilled.

Simply to

prevent errors in use due to incomplete data and people wouldn't know why

to enable user to hook e.g. 7 buttons, but leave the 8th button untouched.

Some people want to keep original behavior of the Mode/SRC button. Others really want to hook that button (or other buttons for that matter). That is why I check BEFORE I hook it.
[FYT Android Head Units] RoNeReR:
[MENTION=2550900]surfer63[/MENTION]

i test this code its better for mute option ( on dac mod )

find:

if (audioManager.isStreamMute(AudioManager.STREAM_MUSIC)) {
audioManager.adjustStreamVolume(0, 100, 0);
audioManager.adjustStreamVolume(1, 100, 0);
audioManager.adjustStreamVolume(2, 100, 0);
audioManager.adjustStreamVolume(3, 100, 1);
audioManager.adjustStreamVolume(4, 100, 0);
audioManager.adjustStreamVolume(5, 100, 0);
audioManager.adjustStreamVolume(6, 100, 0);
} else {
audioManager.adjustStreamVolume(0, 101, 0);
audioManager.adjustStreamVolume(1, 101, 0);
audioManager.adjustStreamVolume(2, 101, 0);
audioManager.adjustStreamVolume(3, 101, 1);
audioManager.adjustStreamVolume(4, 101, 0);
audioManager.adjustStreamVolume(5, 101, 0);
audioManager.adjustStreamVolume(6, 101, 0);
}

replace:

audioManager.adjustStreamVolume(3, 101, 1);
audioManager.adjustStreamVolume(0, 101, 0);
audioManager.adjustStreamVolume(1, 101, 0);
audioManager.adjustStreamVolume(2, 101, 0);
audioManager.adjustStreamVolume(4, 101, 0);
audioManager.adjustStreamVolume(5, 101, 0);
audioManager.adjustStreamVolume(8, 101, 0);

______________________________________________________

i also test the eq button work great.

find:

findAndHookMethod("util.JumpPage", lpparam.classLoader, "eq", new XC_MethodHook() {

replace:

findAndHookMethod("module.main.HandlerMain", lpparam.classLoader, "mcuKeyAudio", new XC_MethodHook() {

____________________________________________________

i find a hidden feature to change the volume bar to another one, there is 5 different style of volume bar include vertical style.

u can find them under ui folder with the name UiVol*

i hope to find a way to use them.
[FYT Android Head Units] gtxaspec:
Nice work!!! Do you happen to have a unit with brightness button? That one would be nice to patch as well. I'm still looking into figuring out how to separate the SWI buttons from the panel buttons too.
[FYT Android Head Units] RoNeReR:
i have the brightness button . but i cant find the method to hook.
[FYT Android Head Units] surfer63:
I don't know the code either, bit it gives you 3 steps to reduce brightness of your screen. It is the one button I don't want to hook, so that is why I did not look into it.
[FYT Android Head Units] RoNeReR:
If we find way to hook it maybe we can add more steps and gui for brightness
[FYT Android Head Units] surfer63:
I just added the code to XSofiaTweaker. I will release a new version tomorrow morning.

(Just came home tonight from a short vacation)
[FYT Android Head Units] surfer63:
XSofiaTweaker 1.26 released

Improved mute function for USB DAC mode (RoNeReR)

Improved and correct hook for the EQ button (RoNeReR)

Re-enable EQ button in the preferences

Add double-tap and triple-tap also to EQ button
[FYT Android Head Units] Wilk7:
The media player I use (MediaMonkey) will not start playback by itself after an ACC Off/On, it will wait for a play/pause, next, back button. This is how it is designed to work. What is the command for a delay of say 5 seconds before issuing the play/pause command?

Thanks
[FYT Android Head Units] surfer63:
sleep 5
[FYT Android Head Units] Wilk7:
:

as easy as that! thanks. Will give it ago. Will it put the HU in sleep or just wait for 5 seconds before it will execute the next command (play/pause)?
[FYT Android Head Units] surfer63:
It will simply wait 5 seconds.

You can try in a terminal.
[FYT Android Head Units] Wilk7:
Thanks, Like you said it wait 5 seconds. Problem is I was aiming to sent a play/pause command after the App started.
[FYT Android Head Units] IG_Vasilich:
you said that you want to react to ACC_ON, not to "the App started".

for ACC_ON you can use several commands - just use semicolon as delimiter. e.g.

sleep 5;input keyevent 126
[FYT Android Head Units] surfer63:
In that case you need:

am start <your app>; sleep 5; input keyevent 126

the keyevent 126 is the android system wide play command. 127 for pause
[FYT Android Head Units] Wilk7:
Think the biggest problem is my inability to explain what I need.

The App I am using (MediaMonkey) starts up correctly after an ACC-ON, up to the same position of the last song in the playlist when the car ignition was turned off (ACC-Off). This takes a while but less than 5 seconds. But won't start playing the song until I press a Play/Pause or previous or next button. It isn't a big issue as I do have Steering Wheel controls. But it would be nice if the HU can send a command to do that after the App has opened fully (5 seconds). Just need a second keyevent 126 after 5 seconds of ACC-On, by that time MediaMonkey should be ready. I can built an external timer that do this on the steering wheel button (resistor key feed) but will be much more elegant with software.

Thanks for your and Surfer's input.
[FYT Android Head Units] doyouknowthemuffinman:
Celsius to Fahrenheit?

Hello! Semi-Noob here. I recently got a 10in Intel Sofia 3GR generic unit off of aliexpress and have been reading through the forums for a few days and have successfully flashed Stock joying android software and mcu update from Jan 2018 to my unit as well as root it and get the app with all of the mods from Surfer installed. Now I have ONE big question that i haven't seen talked about (maybe because it is so simple) but how can i change my system settings from Celsius to Fahrenheit? I can download a weather app and it defaults to F but my AC controls and in the info bar on HU is in C. Any help would be awesome and thank you all for the awesome work and easy instructions!
[FYT Android Head Units] IG_Vasilich:
[MENTION=2550900]surfer63[/MENTION]

does your GPSSpeedFix fork still pollutes Xposed log, or have you already fixed it?

has lbdroid described why he removed several-point approximation in his Xposed GPSSpeedFix module ? i thought that several users have tested it and found that 3 point approximation still works better than no approximation?
[FYT Android Head Units] surfer63:
I do not know which version you are using, but the version I install from my JET apk, and which I assume is also in the GTX ROMs, is from my github.

That one uses a speedfix based on 3 measurements, using moving average. The no approximation was tested by myself and [MENTION=309187]edit[/MENTION] and was indeed not an improvement although it is slightly faster in displaying accelerations/decelerations..

It only logs one message in case it can't correctly hook the gps method. All other logging has been removed.
[FYT Android Head Units] IG_Vasilich:
[MENTION=2550900]surfer63[/MENTION]

thanks.

i meant this issue https://github.com/lbdroid/GPSSpeedFix/issues/3 with logging
[FYT Android Head Units] surfer63:
Sorry, I misunderstood. No, it has not been solved as far as I know. I looked at it at that time but did not find a solution at all. As you can see lbdroid did not want to look into it either as he only gave some "best guess" as to what the error is. If it is in Xposed we can't solve it right now as we have only one version which we can use in the current Sofia circumstances.

(Edit: And I do not at all agree with lbdroids comment about reverting a change. If it is not a plain blunder/error, you should leave it in so other developers can see which possibilities and mayby not working options already have been tried. That's is also my experience with C and python projects I have worked in). It is NEVER a goal to have a clean as possible development tree)
[FYT Android Head Units] IG_Vasilich:
then i suggest to change line 58

if ((int) param.args[4] < 1) param.args[5] = lastAcceptableBearing;

to

if ((float) param.args[4] < 1) param.args[5] = lastAcceptableBearing;

to get rid of that error logging.

The problem in that issue that param.args[x] is an object (for that case of type Float), and there is no standard conversion from object Float to primitive type int. On the other side, standard conversion float->int just cuts fractional part of value, not rounding it, so casting Float to float will give same result when comparing to value of 1.
[FYT Android Head Units] surfer63:
Thanks. I will modify it tonight.

As your java knowledge is obviously much better than mine, please be so kind to assist us :)

I only started java to get something done, because nobody else did (after having resisted it for the last 8-10 years)
[FYT Android Head Units] IG_Vasilich:
[MENTION=2550900]surfer63[/MENTION]

i haven't tested it at my HU yet (i still have an old firmware, but yesterday my HU forgot all the andtoid setings without any reason, so it is good time to flash latest firmware on it (as i lost all my settings anyway) and then test Xposed modules).

I am also not an experienced Java dev (have written my first android program in March), but it seems to have many common points with c/c++, c# and ObjectPascal i use often at work, so i already started to study SofiaServer decompiled app to try to do some changes in XSofiaTweaker for my taste :) or write own module for my custom needs.

So i am interested whether my suggestion will help or not, before suggesting more changes :)
[FYT Android Head Units] surfer63:
That was indeed the error. It is now solved. Thanks a lot.
[FYT Android Head Units] surfer63:
Release of GPSSpeedFix 1.12

Fix int/float bug in GPSSpeedFix (thanks to IG_Vasilich)

Those on a Joying ROM with Xposed installed can install the new version from my JET apk, as JET automatically loads the latest version from my binary repository.

Those on GTX V9a3 can also use JET to install the latest version.

Those on GTX V9a2 or earlier need to manually replace GPSPeedFix.apk in /system/app/GPSSpeedFix
[FYT Android Head Units] edit:
Would you be so kind to link me to the new GPSSpeedFix. apk or attach it here please.

Thank you.
[FYT Android Head Units] gtxaspec:
great work! if you would be so kind as to document or share any changes to the sofia server, it would be appreciated. doing double the work later on sucks =D

thanks again!

---------- Post added at 12:16 PM ---------- Previous post was at 11:56 AM ----------

@surfer63, did you make any progress on an "app selector" interface in XSofiaTweaker? I was setting up a friends unit the other day, and noticed without my notes I had forgotten which specific activities and such and package names to type in... would be super useful.

---------- Post added at 12:19 PM ---------- Previous post was at 12:16 PM ----------

https://github.com/hvdwolf/Joying-RootAssistant/tree/apk/Xposed
[FYT Android Head Units] surfer63:
Not yet. I tried several approaches based on what' availble as "examples". If I do the examples it works. If I implement it in the XSofiaTweaker it doesn't. I even decompiled the Thunkable/appinventor extension, but can't get that to work either. It must be something small and I must almost be at the solution, but I still don't understand java enough.

About 2 weeks ago, I stopped. Also because of the PX5. I will pick up again.
[FYT Android Head Units] IG_Vasilich:
maybe you can share your code that doesn't work, so we can look at it? sometimes fresk look of another dev can help to find obvious quirks that you can't find after some hours of looking into it (my experience from work :) ).
[FYT Android Head Units] surfer63:
I will do a summary. Currently the code contains "outcommented" parts, added parts and again removed parts. I don't have all tried options anymore: when it didn't work I removed it and tried the next.

And like every "good" programmer: I did not note down all tried efforts :)

Although some efforts are also "somewhere" in the github commits as I committed something working and outcommented the not working code (instead of removing it).
[FYT Android Head Units] IG_Vasilich:
How i understand how can it be implemented:

Assumptions: it will be used for max. 3-4 buttons (Source/Mode, maybe navi, radio, music?), so we can make 4 independent blocks for that and connect them as needed.

Implementation:

private static final BUTTON_EVENT_MODE = 1;
private static final BUTTON_EVENT_MUSIC = 2;
private static final BUTTON_EVENT_NAVI = 3;
private static final BUTTON_EVENT_RADIO = 4;

private static final APP_SELECTOR_BLOCK_COUNT = 4;

private static int[APP_SELECTOR_BLOCK_COUNT] AppSelector_Counter;
private static int[APP_SELECTOR_BLOCK_COUNT] AppSelector_ButtonCode;
private static String[APP_SELECTOR_BLOCK_COUNT][] AppSelector_Commands;
...
private void OnButtonPress_Mode{
if ( !CallAppSelectorForButton(BUTTON_EVENT_MODE) ) {
do whatever it should do now;
}
}

private void OnButtonPress_Navi{
if ( !CallAppSelectorForButton(BUTTON_EVENT_NAVI) ) {
do whatever it should do now;
}
}
...
private boolean CallAppSelectorForButton(int buttonEvent) {
for (int i = 0; i < APP_SELECTOR_BLOCK_COUNT; i++) {
if (AppSelector_ButtonCode[i] == buttonEvent)
CallAppSelector(i);
}
}

private void CallAppSelector (int index) {
AppSelector_Counter[index]++;
if (AppSelector_Counter[index] >= AppSelector_Commands[i].length)
AppSelector_Counter = 0;
RunCommands(AppSelector_Commands[index][AppSelector_Counter[index]]);
}

don't nail me on the code that is not java-conform - it is just to understand whether this will work or not, or to get the idea how it can be implemented.
[FYT Android Head Units] surfer63:
I'm not sure if we talk about the same. Currently you have to fill in a text in the "call option text" like "com.rhmsoft.pulsar" or "com.syu.radio" or "com.google.android.apps.maps".

Actually we want a (background) function that collects the installed apps into an array with name and package name. This is immediately explained in the top of this article and which also gives an example code,

or like in this example: https://github.com/StackTipsLab/Adv...e/master/ListInstalledApps/src/com/javatechig

Or like is done in this MTC Xposed module XMTC: https://github.com/agentdr8/XMTC

Or what my JET apk is doing via "top-left menu" -> "Display my installed Apks (with package names)", but via visual building blocks instead of direct java.

These are only a few examples. There are many more.

Is your code referring to the same?

And why do you reduce it to only 4 buttons? Once the background functionality has picked up the apps, you can use it for every button, not matter single-tap, double-tap or triple-tap?
[FYT Android Head Units] IG_Vasilich:
No, my code was attempting to describe so called carousel mode i would like to use for Source button - right now there are 6 sources that change every button press, and i want to be able to select my own apps/commands.

Sorry for misunderstanding, it has nothing to do with enumerating apps.
[FYT Android Head Units] surfer63:
That one is also used in the XMTC xposed module. Maybe you can have a look at that to compare.
[FYT Android Head Units] surfer63:
another problematic issue here is that we use the auto-create functionality of the SettingsFragment. I really have no idea how to populate a dropdown list which was not part of the Settings, into the automatically populated SettingsFragment.

When looking at the XMTC module he does quite some additional programming to create such a Settings screen. If we do that for about 10 buttons times 3 options, it will be a lot of programming.

Next to that: It would take me hours on end and I don't want to spend that much time on it.

I almost forgot, but that was the major reason why I stopped working on it.
[FYT Android Head Units] Redbullssg:
One lesson learned, I will not reboot from the Xposed menu ever again, lol. Scared the hell out of me. Thought my speakers were going to blow! Has anyone ever experienced that?
[FYT Android Head Units] surfer63:
Not from Xposed, but if you do a reboot like you are used from linux or so from the terminal. You will get a loud "DOING" (or so) when doing the shutdown and the startup.

With regard to the reboot itself from Xposed: You have the full reboot and the system or soft reboot. The soft reboot only restarts the graphical part. That is enough for all Xposed changes, apart from the GPSSpeedFix which is also based on some kernel "things".

And it is also much faster than a complete reboot.
[FYT Android Head Units] Redbullssg:
The thing is I've done many hard reboots, from various apps, as well as the main.. I've done it twice through the Xposed app, hard reboot and both times, when shutting down and when starting up the speakers popped so loud I thought they were going to blow. The first time I just thought it was a fluke, until the second time and did the same exact thing.
[FYT Android Head Units] gtxaspec:
Latest gpsspeedfix didn't work for me. Anyone else verify??
[FYT Android Head Units] surfer63:
I can't test myself as my sofia is out of the car. I can only "wave" the gps reciever in the air to simulate movement. And in that case I did not get errors in the logs.

But can you specify what doesn't work?

speed is erroneous or zero or you get other error messages in the logs or ....?
[FYT Android Head Units] surfer63:
Version 40 has 2 bugs. I will release a bugfix tonight.
[FYT Android Head Units] surfer63:
Today I made some big steps forward on the XSofiaTweaker.

Completed all settings (except BACK key. I'm still in doubt whether I should enable this one, and MUTE key (I actually forgot that one :))

Added toast message upon change: You updated key "NAVI_CALL_ENTRY" to value "com.mapfactor.navigator"

Completed all calls in the right way

Make changes of settings immediately active (FINALLY! And on hindsight so much easier than I worked on)

Still to test:

- ACC_ON/ACC_OFF

- improve EQ buttton action. It does work but has the same strange side effects the MEDIA button had (not anymore): it works, it disables the hardware keys for 2 minutes, it mutes the sounds for 2-3 seconds, and it enables sound and hardware keys again.

This version can be downloaded/installed via my JET apk.

(my github repo is at same version)

ToDo:

- integrate USB DAC functionality (AssassinsLament (aka ROLF) SofiaServer mod)

- (perhaps) Get list of installed apps and choose from list to start app for certain hardware button.
[FYT Android Head Units] gtxaspec:
I am researching how some Xposed mods do changes on the fly without rebooting. if I am successful I will send the changes back to you. Just FYI.
[FYT Android Head Units] surfer63:
What do you mean with changes?

If I now change the call option (package name or pkg name/intent or systemcall, etc) or the string belonging to that call option, it can be used immediately. You do no longer need to soft reboot.

If I want to change the MEDIA key (for example), I can immediately use the changes.
[FYT Android Head Units] gtxaspec:
Ahh, I didn't realize. I will test soon.
[FYT Android Head Units] surfer63:
I had completely forgotten to add the MODE/SRC button. It was in the code, but not in the settings.

I just added it to my repo but also to the apk which can be downloaded from my JET apk.

The SofiaServerNoKill and SofiaServerCustomKeyMod can now be downloaded from http://repo.xposed.info/module-overview inside the Xposed installer on your unit.

The package name is determined by the app/build.gradle and not from the AndroidManifest.xml, which were different in my case (which is quite stupid, but I'm still learning).

This also means that I will remove them from my JET apk in the next release.
[FYT Android Head Units] dyabolikarl:
Looking good my man!

Question do you have to type in the whole package name and activity to load it or do you have an app / activity picker that way we are not typing forever?

Looking to try it out this week sometime :)
[FYT Android Head Units] surfer63:
Currently you have to type in the whole package name, optionally with the intent if you want it to immediately start a specific activity, like google voicesearch in Google search.

If you simply want to start the app, then the package name is enough. This is already slightly less than the old launcher.sh. Android has a function that you specify the package name and it will return the "launch intent". Gustden couldn't use that.

As mentioned a few posts up on my ToDo list: "- (perhaps) Get list of installed apps and choose from list to start app for certain hardware button."

The big issue is not the list itself., but how to present it in the settings. The settings work fully automatic without any programming if your preferences file is OK. That is very,very nice in android/java.

So I can't build in a check, like if "by package name" selected, then show list of package names.
[FYT Android Head Units] dyabolikarl:
No problems :). Just trying to make everything clear to me before I do things.
[FYT Android Head Units] akuma148:
Will there be an option in xsofiatweaker to be able to map soft keys (steering wheel buttons) to any function? My car has more buttons than available mappable joying hardware keys in the steering wheel control app.
[FYT Android Head Units] surfer63:
I don't have that option as the sofiaserver app doesn't have that option.

Joying has its own app for that called "Steer Wheel Study". I think you can only start it from the CarSettings app where it is on the first tab: Steering Wheel Study (or something like that)
[FYT Android Head Units] akuma148:
Yeah, that's the app I was talking about, the Joying Steering Wheel Study app. That's what I use to map my soft keys (steering wheel buttons) to the Joying hard buttons and then use custom key mod to customize the button presses. I mapped all the keys available in the app, but I have one extra button that is unused and can't map to anything else besides mute. So hopefully the mute button can be mapped in the future, and that will fix my issue.

Thanks for all the great work!
[FYT Android Head Units] surfer63:
I just added the MUTE button. I did not have time to test yet. I will try tomorrow afternoon and release it if functional.

I made some more alterations as well so I want to test first.
[FYT Android Head Units] akuma148:
NIce, can't wait. I will have to wait till the weekend to update my head unit for xposed.
[FYT Android Head Units] surfer63:
XSofiaTweaker, 19 February

Added MUTE button under system keys 3rd option (mutes 5 audio channels: the 4 Android channels and the radio audio).

Changed hookmethod for ACC_ON and ACC_OFF back to "beforehooked": works better.

Put other settings in alphabetical order

Can be downloaded via my JET apk
[FYT Android Head Units] surfer63:
As mentioned here I also released a USB dac version.
[FYT Android Head Units] gtxaspec:
Hi [MENTION=2550900]surfer63[/MENTION], some feedback for you:

bt_phone doesn't work for me, same issue as before. I think it is hooking the wrong method. I have tried replacing it with btPageDialByKey and it works fine.

home, back and mute capture requires a restart

thanks!
[FYT Android Head Units] surfer63:
I will change the bt_phone. I already changed the text for the home, back and mute capture. It is coupled to the lowest level and really need a soft reboot (a.k.a gui restart a.k.a zygote restart).

But next to that: I also think the unit overrules "something" when it comes to the leds. They are already on when android has hardly booted, and the GUI is far from being loaded. It looks like the MCU does also something on a lower level.

There is something wrong with the ACC_ON and ACC_OFF even though they worked before.

I did all kind of tests with shell scripts, which really work fine when coupled to other keys (BAND, MEDIA, NAVI and the like), but do not work with ACC_ON and ACC_OFF.

I hardly had time this evening (friends over), but I will look into it tomorrow. I did upload some slightly modified XSofiaTweaker version though which can be downloaded from my apk.

It has:

some textual changes

reduced number of "CALL method" options. After all, the sys_call, script and broadcast call are in fact identical. They all start from the sys call.

HOME key capture was enabled by default. Not anymore.