yashsingh1/xdaforums huggingface dataset:
[Android Head-Units] TorstenH:
Because in the Junsun you just can remap the button if you don't use canbus and SWC is connected as resistance matrix to the head unit directly. The translation of can bus signal is hard coded.
[Android Head-Units] TorstenH:
Bernard, I attached version 2.6.2alpha to first post. It will check if required permissions are granted and can try to authorize itself during service start (first option in settings). I hope this will simplify installation procedure for you.
[Android Head-Units] Jetblack31:
Hi Torsten, thank you so much for this new version. I try to install it today and keep you posted.

Bernard
[Android Head-Units] TorstenH:
Thank you for your patience. As you know I just can test on a MTK8257 device so I'm curious if it will work as expected.
[Android Head-Units] Jetblack31:
Hi Torsten,

I installed the latest version. Unfortunately the app stops.

I looked to the log and found this:
[Android Head-Units] TorstenH:
Hi Bernard,

this seems to be a problem getting the current location.

I will try to investigate more in detail asap.

In meantime:

Please ensure you enabled GPS and AppSwitcher has location permission.

App switcher needs to detect your current location for the sunrise 🌅 and sunset 🌇 calculation.
[Android Head-Units] TorstenH:
First match on stackoverflow.com suggests to set location accuracy to high. I hope you can find the setting on your head unit (maybe via search in settings menu).
[Android Head-Units] TorstenH:
I attached 2.6.3alpha to first post.

It contains a fix for older Android versions according to

Android LocationListener, AbstractMethodError on onStatusChanged and onProviderDisabled

I have a simple activity with a button, that uses the LocationManager to try to get the current location: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState)...

stackoverflow.com

I hope it will run on your head unit, now.
[Android Head-Units] Jetblack31:
Hi Torsten,

Thank you, I'll try this new version tomorrow.

I will see also to get my android version.

Best,

Bernard
[Android Head-Units] TorstenH:
I'm very sorry for late reply but I've overseen your message.

I think you're completely right - those proxy apps may not work because you have a 8227L. I could try to provide you a fitting set of apps - but for doing this I need your help.

Install this app

Current Activity - Apps on Google Play

A useful tool for Android Developers

play.google.com

on your head unit. It will give us package name and activity name.

(no, I'm not from Italy :-)

Open the app (e.g. Radio) and note package name (i think it's always com.ts.MainUI) and activity (2nd line).

Do this with all apps you need and send me the result...
[Android Head-Units] elalvaro19:
hello! Perfect, this weekend I am attaching the name of the activity and the package
[Android Head-Units] Jetblack31:
Hi Torsten !

Some news: the latest version does not crash anymore on my HU. That's great. However, I meet a problem: if I want to set the log entry for button press, I can edit the field but I cannot fold back the keyboard so that it is not possible to validate the field...

I've tried to reboot the HU with no success.

When using other apps, like Waze, I can fold the keyboard by a finger sweep...

Thanks,

Bernard
[Android Head-Units] TorstenH:
Have you tried to use the back key on the left side of the head unit? There should be also a back key available on the status bar.
[Android Head-Units] Jetblack31:
Hi, thank you! Many thanks, I succeeded in configuring the button press. It works but there is one issue : When I press the short press button just once, most of the time the window opens, the first app is highlighted and it stays stuck, meaning the delay bar is frozen and as a consequence the app is not launched. If I press again, the second app is highlighted and then the delay decreases and the app is launched. So there's a problem only if I press just once on the short press button.

The long press button is Ok.

Bernard
[Android Head-Units] TorstenH:
Step by step...

For a test: Could you please swap the configuration, make the long press button the short press button and vice versa?

Please ensure "On button press log entry" contains a string which will never occur in the log.

On first click: Is the delay bar starting to getting shorter before it stuck or is it not getting smaller and staying at 100%?
[Android Head-Units] TorstenH:
Added version 2.6.4alpha to first post to fix bug (see 2nd post)
[Android Head-Units] Jetblack31:
Hi,

Ok I'll do the test and keep you posted.

On first click: the delay bar is not getting smaller, staying stuck at 100%.

Bernard
[Android Head-Units] Jetblack31:
Hi,

I've just done the test with 2.6.4.

First I have a can adapter for SWC.

I swap the config and it works fine now!! Short press is configured to the MEDIA key, long press to the NAVI key (allowing to come back to the car launcher page).

Note that before with version 2, it worked well with short press associated to the NAVI key (actually it did work well only with this config).

Some more info: the app tried to grant the READLOGS permission and said I have to do it using adb. But it works. Perhaps it's because I granted version 2 with adb before?

So for now it seems that all is working fine! Thank you Torsten!

I have a suggestion for an improvement. As you may remember I have a CAN adapter and there is no info about 'long press' or saying the key is released. I have 2 buttons available I assign to short press and long press.

I'd like to have "on button press" feature to quickly switch between media and navi apps. Would it be possible to add the following feature: a double click (eg les than 0.2s) on a key switch between media and navi apps. So I could assign the function to the mute key, or even to the short (or long) press button key (in this case a double click less than 0.2s should be ignore for these key functions).

Thank you very much,

Bernard
[Android Head-Units] TorstenH:
Why you had to swap the key config needs further investigation of the log files. In your case it has to be ensured the "on button press log entry" never occurs (partially) in the log because this is the trigger to stop the countdown. You may want to share a picture of your current config.

Self authorize was successful. Getting this message is still a bug which will be fixed in next version.

You're welcome.
[Android Head-Units] Jetblack31:
Ok, I'll do a picture of my config.

But now I'm a bit confused about the button press functions!

Could you remind me the role of:

- short press: open the window to select an app

- long press: go back to the launcher page (HOME) ?

- on button press: ??

Thank you

Bernard
[Android Head-Units] TorstenH:
It should be already possible to switch between latest navi and latest media app with one click because the order of the apps gets arranged dynamically based on last usage.

For this the "Smart list" option needs to stay enabled.

I will think about that doubleclick feature but I have to test it this would be a stable and reliable solution.
[Android Head-Units] TorstenH:
For head units without can box:

on button press: gets logged as soon as you push down the SWC button

short press: gets logged as soon as you release the button after a short period of time

long press: gets logged as soon as you release the button after a longer period of time.

on button press stops the countdown if the dialog is already open. This is why I asked you if you added a text which may occur in the log.

short press switches to next app in horizontal list and resets the countdown.
[Android Head-Units] TorstenH:
New version 2.6.5alpha attached to first post.

Bug fixed which shows wrong message after successful self authorization.

@Jetblack31 aka Bernard: thank you for testing.
[Android Head-Units] Jetblack31:
Ok thank you, I thought that the "on button press" was to assign a key to switch between last media and last navi apps. I thought I read that there was such a feature in the app. My mistake.

Below you'll find the picture of my current config. With this config it works well. However, if I swap the short and long press, le delay bar stays stuck if I press once.

Other point. I notice since I load the last versions that my HU doesn't go into sleep mode anymore. Instead, it reboots each time I switch on the car. Have you any clue? I've never faced sleep mode issue since I have my unit.

Thanks!

Bernard
[Android Head-Units] TorstenH:
For testing you could change Dialog delay to 1.5 seconds or so. I think 0.5 is too less.

It would be required to investigate the log and check if nDealPkey = = 11 gets fired multiple times with one click.

I don't have sleep mode issues in context with AppSwitcher. Unfortunately feeback from other users is very rare but currently I have no idea why it should disturb sleep mode....
[Android Head-Units] Jetblack31:
I'm aware of the smart list option, it's great. But I prefer a fixed list of Apps, so that I know exactly the order of the apps and I can move to a specific apps without looking to the HU screen, just by clicking, once, twice or more times depending on the app I want.
[Android Head-Units] TorstenH:
Ah. I remind your requirement. With smart list only one click is needed to switch between navi and media. But you know that already..... 😂
[Android Head-Units] Jetblack31:
I've already try with a 2-second delay and it stays stuck also. For the moment it's ok, it works, I just need to get used with the swap in the 2 keys!

I'll check the log for key 11 but I'm sure it fires only once when pressed.

It may not be Appswitcher that disturbs sleep mode, it may be a coincidence. I will dig this later.
[Android Head-Units] Jetblack31:
And what about a "super smart list" feature where the fist app is the last navi/media app and the rest of the list is a fixed list of apps? :cool:
[Android Head-Units] Jetblack31:
I've tried 2.6.5:

- no wrong message after self granting READLOGS 😀

- sleep mode is back to normal 😁

- delay bar stays stuck if I swap the keys

- I set Smart List: the list stays fixed. I suppose Appswitcher is not aware of the last apps ?? 🙁

- I've tried the dimming feature: it's 2pm here and in automatic mode, the screen is dimmed! so there is a problem 😅

- I've tried to toggle Force fullscreen and dark/night mode. It doesn't work. I obtain messages in windows like suCommandException and error during self authorization, cannot run su

Hope it can help ;)

Bernard aka Jetblack
[Android Head-Units] TorstenH:
Please check log for:
[Android Head-Units] TorstenH:
Is message reagarding missing READ_LOGS appears again after stop and restart AppSwitcher service? Or after reboot?
[Android Head-Units] Jetblack31:
No, I wanted to say that it works well, Appswitcher is happy and not saying READ_LOGS permission is missing 👍👍
[Android Head-Units] TorstenH:
Maybe the app doesn't have the permission to read usage statistic.

Again a permission you need to grant via adb:

pm grant com.thf.AppSwitcher android.permission.PACKAGE_USAGE_STATS

I will add a self authorization in future.
[Android Head-Units] TorstenH:
That would mean the app can't run su commands and self authorization shouldn't work for READ_LOGS, too.
[Android Head-Units] Jetblack31:
I understand but sure it works for READ_LOGS. Perhaps it's because I granted with adb in the past?

As soon as I go ti my car, I'll try to grand usage statistics

Jetblack
[Android Head-Units] TorstenH:
Difficult to identify the problem without the chance to try it by myself. If you reinstall AppSwitcher it should ask again for the permission.
[Android Head-Units] Jetblack31:
Yes, each time I reinstalled Appswitcher it asks to grant the READ_LOGS permission. And for the latest version it said it was ok and happy.
[Android Head-Units] TorstenH:
As expected. And after self authorization and a reboot? Asks again, too? Or are you getting already an error during self authorization?
[Android Head-Units] Jetblack31:
Now there is no error for READ_LOGS self authorization anymore.

After reboot or if I restart AppSwitcher, there are no errors and it doesn't ask for self-authorization anymore
[Android Head-Units] TorstenH:
I attached version 2.6.6alpha to first post. It checks for usage stats permission on service start.
[Android Head-Units] TorstenH:
I'm sure you know that the button to activate has three options: off (sun), on (moon) and auto (sun/moon).

If you set to auto you will see this in the status bar:

Requirement for the calculation of sunset/sunrise is the location information to derive the timezone. So it needs to be ensured that the app has the location permission.

In auto mode you should find an entry like this in Android log:

Would be good to know if you can find such an entry and if we see a location.

If it doesn't work it may be related to the same problem which let the app crash on your device.
[Android Head-Units] Jetblack31:
HI torsten,

I'll keep you informed of all tests I plan to do tomorrow because for the moment my HU doesn't want to boot anymore. It's stuck at the splash screen stage... So let's it sleep tonight, and see tomorrow!
[Android Head-Units] TorstenH:
Oh no. Terrible news. I hope this has nothing to do with the failed su command...
[Android Head-Units] Jetblack31:
😨😰

I hope so too.

But I remember that once I try some su command and I had to install all my HU :(

Let's see tomorrow...

See what I did here: https://xdaforums.com/t/junsun-junsunsleepconfigurator.4459019/post-87668741
[Android Head-Units] TorstenH:
Added version 2.6.7alpha

Added check if device is 825X_Pro before executing su commands which may be harmful for other devices.
[Android Head-Units] TorstenH:
Weak consolation but I added a check in latest version 2.6.7alpha if device is a 825X_Pro before executing a su-remount command.

Would be really good to know if there is a way to write to vendor/system partition without such bad effects.
[Android Head-Units] Jetblack31:
Thank you Torsten. I think I will re-install my HU and Appswitcher but I will just configure 2 keys, a static list of Apps and no extra features 😅

A few hours of work and it will work again ;)
[Android Head-Units] TorstenH:
A few hours sounds hard...

Nevertheless I found a save way to make system partition writable but I think you don't want to try it. 😁
[Android Head-Units] Jetblack31:
I'm ready to try anything you want ;)

I can do it just after flashing the FW, that's fast.

If it fails, I can restore a fresh FW in 10 min!

Installing apps and customizing the UI and apps takes a lot of time :(

By the way, if you know how to make a full backup of the HU allowing a fast recovery, please tell me 🙏
[Android Head-Units] TorstenH:
That would be really amazing.

It would be perfect if you could execute two commands in adb shell and send me the output messages.

su @#zxcvbnmasdfghjklqwertyuiop1234567890,.

mount -o rw,remount /vendor

If 2nd command is failing because /vendor is not a separate partition then is has to be:

mount -o remount,rw -t ext4 /dev/block/platform/bootdevice/by-name/vendor /vendor

If one of the commands are working we can check if the /vendor partition is writable:

chmod 644 /vendor/build.prop

I just know tools which work on rooted devices. Which launcher are you using? Doesn't it have a backup functionality?
[Android Head-Units] TorstenH:
Now, I know why self authorization with su is failing here:

"Force fullscreen" peforms a remount command for all partitions. If that fails su binary is not accessible anymore and further su errors just a logical consequence.

If we can fix that I could adjust JunsunSleepConfigurator, too.
[Android Head-Units] Jetblack31:
Hi, morning ! I use AGAMA!

I'm lookin for a FW and keep you informed!

Bernard
[Android Head-Units] TorstenH:
Agama has an option to backup the layout and the set colors. I backuped the file created by Agama to an USB stick. But after last fw update the backup file wasn't deleted so it was easy to recover without the need to fiddle around with the color pickers.
[Android Head-Units] Jetblack31:
Yes I saved the settings of AGAMA but I didn't put them on a USB key 😢

But I was thinking of a more complete backup of the HU including all apps and settings.

Bernard
[Android Head-Units] TorstenH:
Please try to load the settings after firmware installation. Maybe the file is still there.

I know what you mean. But I think for a full backup root is required to use tools like titanium backup.
[Android Head-Units] TorstenH:
Merci beaucoup

That is awesome!

But why didn't you tell me you are a Linux professional?!

The bottom line is:

Mounting the vendor partition this way is not harmful for your device so I will adjust AppSwitcher to use the tested command.

As soon as it's done I will come back to you...
[Android Head-Units] Jetblack31:
Hi,

I'm not a linux professional but I learnt enough to survive in the digital world :-)

I stay tuned, many thanks.

Do not hesitate if you need further infos using adb shell on my HU.

Bernard
[Android Head-Units] TorstenH:
Attached version 2.6.8alpha to first post.

Command to remount vendor partition changed.

"Forced fullscreen system property" can now be changed on non-Mtk8257 devices.
[Android Head-Units] Jetblack31:
Hi Torsten,

I reinstalled AppSwitcher on my fresh install.

- AppSwitcher Starter. Stops working at first launch, works well after.

- AppSwitcher. Smooth install.

* 1 st press on the first bar : it asked for granting "foreground sth". said ok, open a parameter window and I changed the switch to authorize.

* 2 nd press on the first bar : it asked for granting "READ_LOGS". said ok, open a window, I said Ok, do it!. It works

* 3 rd press on the first bar : it asked for granting "usage statistics". said ok, open a parameter window and I changed the switch to authorize.

Following that, I configure some apps, my keys and... it works, and the smart list works ! :cowboy:

So I decided to explore more options :)

I tried "Force Full screen" but it was impossible to change the switch.

I tried Dark Mode and something wrong happened.

First I obtained a window with a message :

And following that, in some applications, the font size was decreased. See the pictures below. Even the Android bar and menu has changes with smaller fonts and menu. The icons in the Appswitcher popup are also smaller.

I rebooted but it didn't change anything. How can I recover the normal text size ?
[Android Head-Units] TorstenH:
Can you disable dark/night mode?
[Android Head-Units] Jetblack31:
Yes I can, I did it, I rebooted and nothing changed, the font is small :(

Previously, with the former install, before I broke the HU 😂, I switched dark mode with no impact on the font size. (but nothing became in dark mode...)

That's not a big issue, I can flash the FW again and I won't touch the dark mode button anymore, even if I would like to have dark mode on my HU !

Thank you,

Bernard
[Android Head-Units] TorstenH:
Is the forced fullscreen system property disabled?

Dark mode switch is only changing system property "ui_night_mode", same which can be changed in Android developer settings. The message regarding Automate can be ignored but indicates that the ui_night_mode was changed.

I think it has something to do with the fullyscreen property.
[Android Head-Units] Jetblack31:
That's weird. First I was not able to disable Forced Fullscreen by pressing the switch. So I disabled Dark Mode and then it was possible to disable Forced Fullscreen. I rebooted but with no change for the font size.

After reboot I noticed that both Forced Fullscreen and Dark Mode were back to enable...

Also, in addition to the small fonts, I have also a sound each time I press a key (never heard that before) and the keyboard does not pop up if I want to change key setting for the press button...
[Android Head-Units] TorstenH:
Could you check via ADB if file /vendor/build.prop is available?
[Android Head-Units] Jetblack31:
Torsten,

Hi,

I'll do it tomorrow and keep you informed.

Thank you very much for your great app and for your support!

Jetblack
[Android Head-Units] TorstenH:
Thank you for your perseverance, it's not something you take for granted.

I'm working hard to fix bugs as quickly as possible, which is why we're now at 2.6.9alpha.

I will re-test dark mode and fullscreen on my device tomorrow morning.

TorstenH
[Android Head-Units] TorstenH:
I've seen the /vendor/build.prop contains stuff like display orientation, notification sound...

Currently I see three possible root causes:

#1. The /vendor/build.prop is missing

#2. The content of /vendor/build.prop is messed up

#3. File authorizations are incorrect set.

If we have one of those problems I would be really confused because they should occur on the Mtk8257, too.
[Android Head-Units] Jetblack31:
Ok I'll test that. I'm perseverant too. I know that developing a reliable application is a heck of a job. I have been developing MaxPV on Github (jetblack31/maxpv) for 3 years now and it is not perfect yet and there is a lot of work to do ;)

Manay thanks,

Bernard
[Android Head-Units] Jetblack31:
Hi Torsten,

Bad news, my HU works but lost wifi connection and 4G connection on top of the other weird behaviours.

As I use the HU wifi AP to connect adb I cannot investigate the current issue but for sure it seems it has something to do with the config files.

So what do you suggest? should I flash a fresh FW and re-install Appswitcher ?

Bernard
[Android Head-Units] TorstenH:
Unfortunately without adb we are lost and I think you have to flash again. :-(

I attached 2.6.10alpha to first post which. Please use this for next test.

I was able to comprehend several bugs you reported (no countdown on first start, not clickable UI, ...) which are fixed, now. This is the reason I was so silent this morning...

You can test all functions except fullscreen properly (see next post) AND night mode.
[Android Head-Units] TorstenH:
I reworked the coding in context of the fullscreen property because in some circumstances the switch wasn't in sync with the real status. This is fixed, but I realized that changing the property had no effect on my device. So I've done the steps manually via adb:

Copy build.prop to download folder:

cp /vendor/build.prop /sdcard/Download

Manually added this line to the copy:

forfan.force_direct=0

Switched to su context:

su @#zxcvbnmasdfghjklqwertyuiop1234567890,.

Mounted /vendor with rw:

mount -o rw,remount /vendor

Replaced the original file:

cp /sdcard/Download/build.prop /vendor

Set file permissions:

chmod 644 /vendor/build.prop

Checked if the changed file is in place with file explorer and rebooted the device.

After reboot the file was resetted and my new line missing.

I used another approach to remount:

su @#zxcvbnmasdfghjklqwertyuiop1234567890,.

remount /vendor

Adb session was reset and I simply connected again and proceeded with the copy:

cp /sdcard/Download/build.prop /vendor

chmod 644 /vendor/build.prop

After reboot the change persists.

AppSwitcher_2.6.10alpha uses the "remount /vendor" command. But it may be useful to perform the described steps on your device, too.
[Android Head-Units] TorstenH:
Night mode:

Maybe it makes sense to change to night mode via Android Developer settings manually. Just to see if that's the reason for font change.

To display the Developer settings you have to click several times on build number in the settings app. Let me know if you need further instruction doing this.
[Android Head-Units] Jetblack31:
Hi Torsten,

Thank you for your hard work on issues related to 8667.

I should have time tonight to flash my device and will try all what you suggested.

Concerning the developper mode, I know how to access it, it's quite simple on my unit. However I don't remember having seen something related to night mode there.

Stay tune :)

Bernard
[Android Head-Units] TorstenH:
I would be happy if the app becomes more universal and can be uses on non-Mtk8257 devices, too.

Looking forward to hear from you.

Torsten

Here you can find the "Night mode":

Please note this will not darken all apps. E.g. Settings app stays white.
[Android Head-Units] Jetblack31:
Hi Torsten,

I contacted your through a conversation.

Bernard