yashsingh1/xdaforums huggingface dataset:
[FYT Android Head Units] surfer63:
Your other code

findAndHookMethod("util.JumpPage", lpparam.classLoader, "activityByIntentName", String.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable {
String actionName = (String) param.args[0];
if (actionName == "com.syu.bt") {
Log.d(TAG, "bt intent received");
XposedBridge.log(TAG + " skipped com.syu.bt force launch");
param.setResult(null);
}
else
if (actionName == "com.syu.radio") {
Log.d(TAG, "RADIO intent received");
XposedBridge.log(TAG + " skipped com.syu.radio boot launch");
param.setResult(null);
}
}
});

Is that still valid?

If you prevent the BT app coming to top, you can't answer the call, can you? However, once you have taken the call, it should go back.

Maybe you can take the call if you have a steering wheel BT button, but I don't have steering wheel buttons.

The very, very few times I get a phone call in the car I mostly press the soft green button on my phone as it is closer to me than the head unit screen. In that case I don't need the BT app taking foreground at all.

But I assume that varies per user.

======

Did you test the radio?

Stopping the radio app from launching, doesn't stop the radio. I did even tests WITHOUT the radio app installed and it still starts playing. That is horrible, because you first need to start a mediaplayer to be able to stop the radio.

The radio app does not start or stop the radio from playing. The radio is always on and starts playing(=outputting sound) as soon as the linux layer audio drivers are up so before the gui (or whatever app) has launched. You can mute the radio by exiting the radio app or by starting a media player. I think we should search for the exit command in the radio app as that sends the mute command to the BD37033 controller. Once we have that (broadcast) command we can put it in the ACC_ON command.

I had a look at this before but for me it is so low prio. Users who test a lot (like you, edit and me) will do a lot of reboots and thereby always hear the radio. Other users only experience a cold boot once a month perhaps.

For me it is absolute low priority.
[FYT Android Head Units] surfer63:
[MENTION=520205]gtxaspec[/MENTION] and [MENTION=309187]edit[/MENTION] and possibly others:

I just uploaded an untested XSofiaTweaker to my google drive.

I'm still feverish and coughing my lungs out of my chest, so I'm not going to sit in a cold car.

I hope it will correct the mediaKey function in app/ToolkitApp.java. Gustdens modified code only sends media keys to the active media player. The original code uses an intent and androids default or last used media player will react, which is not necessarily the active one.

And if it doesn't work, please share the Xposed logs.

Note: This one is NOT in the Xposed repo. If it doesn't work simply install the one from the Xposed repo again.
[FYT Android Head Units] PoppaRoxie1986:
Regarding stopping the radio, I wonder if one could programmatically send a back key keypress event targeted to the radio app?

Also I have steering wheel buttons so taking/sending a phone call is not so much a problem if the Bluetooth app is not up front. Perhaps if there was a way to conditionally allow the Bluetooth app to come to the front maybe for a timed interval (i.e. upon receiving a phone call) for say 5-10 seconds to allow interaction with the app for those who don't have steering wheel buttons. Just a thought.
[FYT Android Head Units] surfer63:
I'm not sure if that is even allowed, security wise, but for me that is the "second" option.

The first option is to find the direct command to mute the radio audio stream. I do not even think it is too hard. Android has 4 audio channels. Our units have five, the fifth being the "non-android" hardware radio audio channel. SofiaServer also mutes the radio audio channel when switching to a media player or the phone app.

There are some ways to do that. I even found some example code for it.

We simply need an experienced java programmer. :(
[FYT Android Head Units] gtxaspec:
I did test my code, and it does work, preventing the the BT app from forcing to the top when you switch out of it. it still displays initially when you receive a call. Looking for alternative ways to hook it. As far as the radio, yes keeps playing, i realized this last night. I am looking for the code that silences the radio as well via the bd37033.

---------- Post added at 06:50 AM ---------- Previous post was at 06:49 AM ----------

i will test this morning! the media keys mod, is it an option, or is it enabled by default. I don't see any new commits to your git, i guess i'll find out =D
[FYT Android Head Units] PoppaRoxie1986:
I am in the process of getting a development setup where I can program inside my home rather than working in a cold truck. I have some java experience but my main languages are C++ and C# on Windows. Oh and surfer63 hope you are feeling better today.
[FYT Android Head Units] surfer63:
Just pushed the commits. Currently they are simply activated.

Why would you make that on/off switchable?

One thing I found where our good friend lbdroid was a little sloppy. He uses the "com.android.support:appcompat-v7:26.+" in the build.gradle. If your application uses Material Design (Android > 5.0), and you want to make your app run on older android versions you definitely need this, but it adds 1.5MB to your apk.

Guess what: 3 of the 4 Xposed apks do not even have a GUI.

And secondly: We only run on Android 6, no need for this appcompat library.

All apks were around 1.5MB. The GPSSpeedFixis now 95KB, the Nokill 109KB, The SofiaServerCustomKeymod 143 KB and the XSofiaTweaker 155 KB. (More than) 10x smaller!

I already wondered why so many Xposed modules containing more functionality were only max 200 KB. Now I know.

In the coming days I will update my modules and do a new pull request to lbdroids GPSSpeedFix repo.

Being an absolutely noob (and still am) I simply copied from him.
[FYT Android Head Units] gtxaspec:
It works! I just had to change

XposedHelpers.findClass("module.bt.HandlerBt",lpparam.classLoader);

To

XposedHelpers.findClass("module.bt.HandlerBt$3",lpparam.classLoader);

I was using the code displayed in jadx, I referenced the names that were decompiled using apktool d and it works perfectly now. This verison works best, with my original version Sofia server sporadically crashes when you the a call with the switch. No longer.

Thank you.
[FYT Android Head Units] surfer63:
I'm a hobby python and shell script programmer and before that long time applescript (when I was still on OS/X). I programmed in C for the last time in 1993.

The issue is indeed that I can easily "compose" complete programs in python and shell script, but I have to constantly copy from others and google all the time, to even be able to write anything at all in java.

But I assume that will improve due time.

Your basis of C++ is a better start for java.

Thanks. Feeling much better. Getting to work again tomorrow (sorry for the off topic)
[FYT Android Head Units] edit:
Would you be so kind and share the apk separately because I am still on sort of a Custom-Stock December that I made myself (removed some of the stock Joying apps) till you guys figure out the Play/Pause issues with the media players

Thank you !
[FYT Android Head Units] surfer63:
The "java.lang.NoSuchMethodError" again.

Thanks for testing. I'll look at it.
[FYT Android Head Units] akuma148:
Finally had time to update my Joying to GTX rom and the new JET.

I can say that the Mute button works great! Thanks!

I did notice that the BT Hang button was not available to map in the XSofiaTweaker. Will you be adding this in any future updates?

Thank you!
[FYT Android Head Units] surfer63:
Type cast error. Very sloppy of me.

I will correct it this weekend and I hope it is the only bug.
[FYT Android Head Units] surfer63:
I don't have steering wheel keys. I wasn't missing anything :)

I will add it, but I do have to find the command of course.

In the next version I will also make a separate subsettings screen for the hardware keys and for the SWI keys.
[FYT Android Head Units] RoNeReR:
thank u very much,
[FYT Android Head Units] surfer63:
It had nothing to do with functionality. It was only in showing the toast that you updated the value.

New version.

Note that this version is running behind with the "main stream" XSofiaTweaker. It is a somewhat older spin-off to enable a USB-DAC.

If we might get it working it will be merged back into the mainstream version.
[FYT Android Head Units] RoNeReR:
the gui not crash anymore but unfortunately not working,

the joying volume bar still exist, and the media volume on android setting still back to full
[FYT Android Head Units] surfer63:
I will look into it, but please note that it is low prio for me. Not because I do not have a usbdac myself, but you seem the only one left on this forum still interested. I (cross)posted also on the USB-DAC/audio thread and you are really the only one to respond and test.
[FYT Android Head Units] surfer63:
Can you share your Xposed logs?
[FYT Android Head Units] surfer63:
You have a very long list of errors in the AppSettings module all focusing around the notificationmanagerservice in the above line. These are not mine. Please do some checking there.

My errors are way below

java.lang.NoSuchMethodError: module.main.HandlerMain#mcuKeyVolUp()()#exact

which is again a stupid error. The java function need the () at the end but not when you call it in Xposed.

Please find here another update.
[FYT Android Head Units] RoNeReR:
the method mcuKeyVolUp not found, i think there is a problem with the findAndHookMethod that dont find static method , i try to play with it without success.

the good news is that the media volume stop automatic go to max when i turn on the xposed dac mod. so the only think to do is to vix the hook on mcukeys.

---------- Post added at 06:19 PM ---------- Previous post was at 06:04 PM ----------

i get the same error with the new apk. ( with double ( ) )
[FYT Android Head Units] surfer63:
In the mcuKeyVolMute ? Because I had forgotten that one.

I do not understand why you get the "mcuKeyVolUp not found". It has nothing to do though with being a private static method. I capture more of those.

Please share again (that specific part of) the Xposed logs.
[FYT Android Head Units] lob3s:
I'm also interested! I may have not seen that crosspost though. Is there anything specific to test, or just basic functionality of the usbdac xposed module?
[FYT Android Head Units] surfer63:
It should mimic the behavior of the previous AssassinsLament mod. In his case it was a direct mod of the SofiaServer. It checked for a usbdac.txt (or so) on the sdcard.

If available, the volume will no longer controller the internal output, but the output of the usbdac.

In my module, you do not need an external file. You simply enable or disable the setting in XSofiaTweaker.

But as you can read from above posts it does not work yet.
[FYT Android Head Units] RoNeReR:
this is the up to date errors,

the joying volume bar is still showing up,every trying to volume up or down give the attached error,

01-21 10:51:13.642 E/Xposed ( 1110): java.lang.NoSuchMethodError: module.main.HandlerMain#mcuKeyVolMute()()#exact

03-10 00:57:54.843 E/Xposed ( 2356): java.lang.NullPointerException: Attempt to invoke virtual method 'int android.media.AudioManager.getStreamVolume(int)' on a null object reference
03-10 00:57:54.843 E/Xposed ( 2356):	at org.hvdw.xsofiatweaker.XSofiaTweaker.setMediaVol(XSofiaTweaker.java:499)
03-10 00:57:54.843 E/Xposed ( 2356):	at org.hvdw.xsofiatweaker.XSofiaTweaker$4.beforeHookedMethod(XSofiaTweaker.java:177)
03-10 00:57:54.843 E/Xposed ( 2356):	at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:314)
03-10 00:57:54.843 E/Xposed ( 2356):	at module.main.HandlerMain.mcuKeyVolUp(<Xposed>)
03-10 00:57:54.843 E/Xposed ( 2356):	at dev.ReceiverMcu.onHandleMain(ReceiverMcu.java:1436)
03-10 00:57:54.843 E/Xposed ( 2356):	at dev.ReceiverMcu.onHandle(ReceiverMcu.java:259)
03-10 00:57:54.843 E/Xposed ( 2356):	at dev.ReceiverMcu.onReceive(ReceiverMcu.java:145)
03-10 00:57:54.843 E/Xposed ( 2356):	at util.SerialThread.run(SerialThread.java:76)

03-10 00:57:58.292 E/Xposed ( 2356): java.lang.NullPointerException: Attempt to invoke virtual method 'int android.media.AudioManager.getStreamVolume(int)' on a null object reference
03-10 00:57:58.292 E/Xposed ( 2356):	at org.hvdw.xsofiatweaker.XSofiaTweaker.setMediaVol(XSofiaTweaker.java:499)
03-10 00:57:58.292 E/Xposed ( 2356):	at org.hvdw.xsofiatweaker.XSofiaTweaker$5.beforeHookedMethod(XSofiaTweaker.java:185)
03-10 00:57:58.292 E/Xposed ( 2356):	at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:314)
03-10 00:57:58.292 E/Xposed ( 2356):	at module.main.HandlerMain.mcuKeyVolDown(<Xposed>)
03-10 00:57:58.292 E/Xposed ( 2356):	at dev.ReceiverMcu.onHandleMain(ReceiverMcu.java:1437)
03-10 00:57:58.292 E/Xposed ( 2356):	at dev.ReceiverMcu.onHandle(ReceiverMcu.java:259)
03-10 00:57:58.292 E/Xposed ( 2356):	at dev.ReceiverMcu.onReceive(ReceiverMcu.java:145)
03-10 00:57:58.292 E/Xposed ( 2356):	at util.SerialThread.run(SerialThread.java:76)
[FYT Android Head Units] surfer63:
Find again a new test version here.

If this gives again the same errors I'm currently out of thoughts/options and need to dive a little bit deeper.
[FYT Android Head Units] gtxaspec:
hi [MENTION=2550900]surfer63[/MENTION], pull request sent.
[FYT Android Head Units] surfer63:
I saw it, thanks. Currently on business trip. I'm home again tonight and will pick up.
[FYT Android Head Units] amon101x:
Hey surfer.

thanks for your dedication to our headunits.

I have a question about the XSofiaTweaker module

When i enable the "Channel 4 for Google Voice" which benefits does it have? Will the Voice output on google apps like Maps, Android auto etc improve? Or what will be different?

Another question you can help me maybe which is not really related to your xposed tweaks: I use Headunit reloaded to use Android Auto on my Joying unit. The Play/Pause button and the Next/Previous function (turning of the knob) doesnt work. In the options of Headunit reloaded you can insert Keycodes for the related functions. Which means i have to get the keycodes for those functions of my Joying unit. But i dont know how?
[FYT Android Head Units] gtxaspec:
In the gtx ROM thread, someone posted some of the SQL key codes...try those.
[FYT Android Head Units] gtxaspec:
[MENTION=2550900]surfer63[/MENTION] would you be opposed to adding a menu item that backs up the shared prefs xml to the sdcard? And another to restore it back??? I can submit another pull if you are ok with that. =)
[FYT Android Head Units] surfer63:
No. It has nothing to do with "normal" TTS as used in navi apps and the like.

This will enable GVC to "talk back". It will not simply display some results, it can tell you the results.

The Joying normally mutes this channel, which means GVC will show you it is sunny and 21C instead of telling you (for example).
[FYT Android Head Units] surfer63:
That's fine with me, but actually I wanted to bring it one level deeper.

I wanted to:

- create another subSettings screen where you can define the display brilliance for night and day, to be written to /sdcard and /sys/fytver

- Save radio stations (there is a broadcast when saving/updating stations. This one could be intercepted.)

- Save multiple settings (key tone, night/day display brillance, radio stations, XSofiaTweaker settings, and more? to sdcard or share to GDrive, Dropbox, etc.

But please write this function, as I did not really implement anything yet.

My current focus is to be able to make it possible to add your own navi app to the navi_app.txt lists as we still see many users not understanding why their navi app does not lower other streams, or why their navi app is not heard when the radio plays.
[FYT Android Head Units] surfer63:
XSofiaTweaker 1.13 released

I just released 1.13 of XSofiaTweaker

Added option to prevent Bluetooth phone app from staying "full screen on top" during a call (thanks to gtxaspec)

Options to prevent Canbus overlays from being displayed on changes in heating/airco, door(s) opening finalized (CANbus functionality is useful, but these overlays are sometimes quite annoying)

Remove appcompat layer library. Size reduction from 1.4MB to 195KB.

Note that I still have specified XSofiaTweaker as Beta. You need to activate that in the Xposed Installer Settings.
[FYT Android Head Units] gtxaspec:
great! i'll see what i can whip up next few days...

question, display brightness as I know is controlled via /sys/class/leds/lcd-backlight/brightness, ex echo 50 > /sys/class/leds/lcd-backlight/brightness ... and to enable or disable the backlight is echo 1 > /sys/fytver/bl_en or echo 0 to disable. pretty easy.

now if you happen to know how to modify:

cat /sys/fytver/backlightctrl <

set-backlight-max=255

set-backlight-min=63

that would be great to know...right now we are forced to set through the carsettings backlight current setting. it uses the syu jni interface command:

ToolsJni.cmd_105_set_bl_adj(1);

to set these values...

edit- ok figured it out:

on /dev/block/mmcblk0p13

address 000002b0:

000002b0 ff ff ff ff ff ff ff ff ff ff ff ff 64 00 0b 00 |............d...|

0x64 = 100 max brightness

0x0b = 11 min brightness

just like you would set in car settings backlight current popup...
[FYT Android Head Units] gtxaspec:
need another set of eyes on this... I'm trying to prevent Sofia Server from silencing the REAR channels (42,43) when the bluetooth is on, as in, bluetooth PHONE audio (not a2dp) from all .

the following method

@Override
public void field2Ic(int[] arrn) {
if ((DataSound.sBalDst >> 16 & 255) == 1) {
int n = ToolkitMath.clamp(DataSound.sBalDst >> 8 & 255, 0, 16);
int n2 = ToolkitMath.clamp(DataSound.sBalDst & 255, 0, 16);
int n3 = ToolkitMath.clamp(DataSound.sFadeDst >> 8 & 255, 0, 16);
int n4 = ToolkitMath.clamp(DataSound.sFadeDst >> 8 & 255, 0, 16);
CmdSound3702.write3702(41, BALANCE_FADE_TABLE[n]);
CmdSound3702.write3702(40, BALANCE_FADE_TABLE[n2]);
CmdSound3702.write3702(43, BALANCE_FADE_TABLE[n3]);
CmdSound3702.write3702(42, BALANCE_FADE_TABLE[n4]);
return;
}
int n = ToolkitMath.clamp(DataSound.sBalDst, 0, 16);
int n5 = ToolkitMath.clamp(DataSound.sFadeDst, 0, 16);
int n6 = n;
int n7 = n5;
if (DataBt.sPhoneWork != 0) {
n6 = n;
n7 = n5;
if (DataMain.sPhoneFront) {
n6 = 8;
n7 = 0;
}
}
n = Math.max(n6, n7);
n5 = Math.max(16 - n6, n7);
int n8 = Math.max(n6, 16 - n7);
n7 = Math.max(16 - n6, 16 - n7);
CmdSound3702.write3702(41, BALANCE_FADE_TABLE[n]);
CmdSound3702.write3702(40, BALANCE_FADE_TABLE[n5]);
CmdSound3702.write3702(43, BALANCE_FADE_TABLE[n8]);
CmdSound3702.write3702(42, BALANCE_FADE_TABLE[n7]);
}

i need to replace the variables n7 and n8. can this be done using xposed? or even to repeat the last two lines with different variables (n7/n8)
[FYT Android Head Units] surfer63:
Apart from the radio stations capture, this could actually better be done in the JET apk. It has nothing(!) to do with Xposed (apart from the radio stations broadcast which I can't do in JET, but when saved from Xposed I could still backup it from JET)

Next to that: users not using Xposed could benefit from this as well.

And finally: I can easily do this in Thunkable/App-Inventor, both on (rooted) stock Joying as well as on the GTX, and I have big difficulties doing this in java.
[FYT Android Head Units] Astur_Torque:
Hi again,

As you know I'm currently on 5.1 version, but I'm thinking about moving to GTX ROM

On 5.1 I could program me keys, maybe because of canbus, but i'm not sure if I can program this
[FYT Android Head Units] surfer63:
XSofiaTweaker 1.14 released

Just released XSofiaTweaker 1.14

Added German translation thanks to mitchum67

No functional changes
[FYT Android Head Units] joshnat:
[MENTION=2550900]surfer63[/MENTION] any chance of a speed dependent volume module? This exists for MTCD but my guess is that Sofiaserver is very different.
[FYT Android Head Units] surfer63:
Yes, I have seen it in the MTCSound Xposed module (and also in the XMTC Xposed module I think) and I had a look at the code (they're both on github). It is slightly different on the Sofia 3GR, but not too much. All these apps use the same kind of java code.

I already had a go at the usb-dac part (not functioning) and this would use the same functions but then unmodified. But it also requires the GPS speed.

It is on my wish/todo list but not on the top line, and as I mentioned a couple of days ago: I will slow down as I hardly use my car and spend more time in my car testing, than driving it. With the additional "bonus" of having a flat battery 3x in 3 weeks (not dead, but so empty that my car wouldn't start. You don't notice it when only using the android part which can run on the last drop of juice in your battery). I'm a bit done with it. And as I have both USB cables stretched behind my dash, it is a terrible job to remove it from my car (in case I'm not using my car for 10+ days for example, which happens on regular base)

Edit: It is in the mtce-util module from Malaysk and friends, and in the Petrows RK3066 app (also available on github and the play store)
[FYT Android Head Units] gtxaspec:
[MENTION=2550900]surfer63[/MENTION], how do you plan to handle running system call's as root? I just changed shellexec to rootexec in the code for the meantime to run my commands on acc_off.
[FYT Android Head Units] surfer63:
Do you mean in the XSofiaTweaker or in my JET apk?

And for the XSofiaTweaker: I don't think it matters as the SofiaServer already runs with full system access.

(Edit: jumping too fast from one thread to another :))
[FYT Android Head Units] gtxaspec:
When i try to run a sample command that requires root access, (ex. pkill systemui) nothing happens.

With the change in the code from shellexec to rootexec, the root is requested and the command runs successfully.
[FYT Android Head Units] surfer63:
OK, so for ACC_OFF, ACC_ON and Resume the call needs to be changed. We can arrange that.
[FYT Android Head Units] gtxaspec:
Another option would be to have a switch to run all system calls as root, globally? So if the user needs a button press to run a root command, it's available as well. Would that make sense?
[FYT Android Head Units] surfer63:
Yes, that might be a good option. It is easy implementable.
[FYT Android Head Units] gtxaspec:
hey [MENTION=2550900]surfer63[/MENTION], just a question to a fellow Xposed explorer,

the following method:

public void field2Ic(int[] indices) {
if (((DataSound.sBalDst >> 16) & 255) == 1) {
int fl = ToolkitMath.clamp((DataSound.sBalDst >> 8) & 255, 0, 16);
int fr = ToolkitMath.clamp(DataSound.sBalDst & 255, 0, 16);
int rl = ToolkitMath.clamp((DataSound.sFadeDst >> 8) & 255, 0, 16);
int rr = ToolkitMath.clamp((DataSound.sFadeDst >> 8) & 255, 0, 16);
write3702(41, BALANCE_FADE_TABLE[fl]);
write3702(40, BALANCE_FADE_TABLE[fr]);
write3702(43, BALANCE_FADE_TABLE[rl]);
write3702(42, BALANCE_FADE_TABLE[rr]);
return;
}
int bal = ToolkitMath.clamp(DataSound.sBalDst, 0, 16);
int fade = ToolkitMath.clamp(DataSound.sFadeDst, 0, 16);
if (DataBt.sPhoneWork != 0 && DataMain.sPhoneFront) {
bal = 8;
fade = 0;
}
fl = Math.max(bal, fade);
fr = Math.max(16 - bal, fade);
rl = Math.max(bal, 16 - fade);
rr = Math.max(16 - bal, 16 - fade);
write3702(41, BALANCE_FADE_TABLE[fl]);
write3702(40, BALANCE_FADE_TABLE[fr]);
write3702(43, BALANCE_FADE_TABLE[rl]);
write3702(42, BALANCE_FADE_TABLE[rr]);
}

do you think it's possible to prevent the if statement

if (DataBt.sPhoneWork != 0 && DataMain.sPhoneFront) {
bal = 8;
fade = 0;
}

from having any effect? I know it works, becaquse i got it working by smali editing the sofia server to remove that if statement. I'd rather do it using xposed.