Jump to content

Recommended Posts

[Note: This post is on an esoteric topic, and is only suitable for people who enjoy tinkering with their phones. Please don't try any of this if you aren't willing to erase everything on your Pro1]

Project Treble made it possible in theory to run new versions of Android without requiring any OEM updates. If you've tried this in the past then you know the usability results can be 'mixed' 😉 The good news is that the Pro1 ships with fairly good Treble support, and you can find some information about how well it works while running an Android 10 generic system image (GSI) at https://github.com/phhusson/treble_experimentations/wiki/F(x)tec-Pro1.

As part of my work on LineageOS I have been fixing some of the Treble bugs in the stock firmware. So far I have fixes for the keyboard shift and Fn key mapping, and the keyboard slider behavior, and I hope to have a fix for the keyboard backlight behavior soon as well. If you'd like to try these fixes with a GSI, you can find my patched vendor.img and boot.img files at https://drive.google.com/drive/folders/1ey6g1N1ORYZ34oRXLYsF4zCCL6_KGRCi Note that the slider behavior fix only works with recent Android 10 GSI builds, e.g. https://ci.android.com/builds/submitted/6124690/aosp_arm64-userdebug/latest/aosp_arm64-img-6124690.zip. It does NOT work with the 'release' GSI builds that were published in October 2019.

Edited by Sean McCreary
Tweaked wording
  • Thanks 10
Link to post
Share on other sites
17 minutes ago, silversolver said:

Personally I see no advantage to 10 over 9, but those who wish to use Desktop mode certainly would differ with me on this. Thank you for sharing your experiment!

Not a huge advantage, but night mode is a little bit better implemented in 10. Also it is the new and shiny one that may have some security patches android 9 does not.

  • Like 1
Link to post
Share on other sites
5 hours ago, EskeRahn said:

Very interesting. Did you try it with FinQwerty? I suppose that would fix the keyboard issues with Fn (=Yellow arrow)

The trouble with the Fn key is a Treble bug, and the patched vendor.img has that fix. I haven't tried installing the FinQwerty app while running an Android 10 GSI, but it ought to work. Note that the GSI builds posted at ci.android.com do not include GMS.

Link to post
Share on other sites
17 minutes ago, Sean McCreary said:

The trouble with the Fn key is a Treble bug, and the patched vendor.img has that fix. I haven't tried installing the FinQwerty app while running an Android 10 GSI, but it ought to work. Note that the GSI builds posted at ci.android.com do not include GMS.

Thanks, yeah thought so. I do not know if there are some reasons why @Anssi Hannula got the source but not the .apk linked on his page.

Of course I (or anyone) could just take the current from a phone for a test but would prefer an official link.
But I merely tried to signal, that the fn thing most likely would be fixed by that. Of course the lack of backlight-support is not as easy.

Link to post
Share on other sites
18 minutes ago, EskeRahn said:

Thanks, yeah thought so. I do not know if there are some reasons why @Anssi Hannula got the source but not the .apk linked on his page.

Of course I (or anyone) could just take the current from a phone for a test but would prefer an official link.
But I merely tried to signal, that the fn thing most likely would be fixed by that. Of course the lack of backlight-support is not as easy.

In a pinch you can always try to enable the keyboard backlight manually with the command:

Quote

echo 1 > /sys/class/leds/keyboard-backlight/brightness

This is inconvenient and doesn't work on stock, but it is better than nothing.

  • Like 3
  • Thanks 1
Link to post
Share on other sites
26 minutes ago, EskeRahn said:

Thanks, yeah thought so. I do not know if there are some reasons why @Anssi Hannula got the source but not the .apk linked on his page.

Of course I (or anyone) could just take the current from a phone for a test but would prefer an official link.
But I merely tried to signal, that the fn thing most likely would be fixed by that. Of course the lack of backlight-support is not as easy.

You can get the latest apk here:

https://github.com/anssih/finqwerty/releases

  • Thanks 2
Link to post
Share on other sites
On 1/12/2020 at 11:40 PM, Sean McCreary said:

I hope to have a fix for the keyboard backlight behavior soon as well

I have added a new lights HAL to the patched vendor.img that forces the keyboard backlight to follow the display backlight state. Whenever the screen is on, the keyboard backlight is on as well. This isn't ideal, but it works well enough that I felt it was worth an update. I also updated the kcm to include VaZso's patch, so shift/fn + arrow keys will send PGUP/PGDOWN/HOME/END, and fn + backspace sends BACK while fn + Del sends FORWARD.

The download directory now includes a brief changelog file, with notes about what was changed on each date. The changes are cumulative, so the latest date has all the fixes listed on previous days (unless the file says otherwise). I also did some brief testing with system images other than the Android 10 GSI, and the patched boot.img and vendor.img seem to work well with tdm's second test build for LineageOS 16.0. Unfortunately, the slider fix does not work with the stock system.img ☹️ You can install the patched images over the top of tdm's LineageOS build with fastboot, using the same commands as if restoring the device to stock firmware. Just specify the uncompressed boot and vendor images downloaded from Google Drive instead of the stock firmware RAR archive in the fastboot commands.

  • Like 1
  • Thanks 1
Link to post
Share on other sites
2 hours ago, Sean McCreary said:

Unfortunately, the slider fix does not work with the stock system.img ☹️

Any particular reason? Or is that just IdeaLTE's hacky solution getting in the way? Any signs of Fx being interested into bringing these improvements to the stock rom yet?
Not even sure if it still sounds reasonable at this point, but I'd kind of prefer to just run stock on my device once I have it. Seems like I'd be missing out on more and more by doing so, however.

I appreciate the work you're putting into this either way. Thank you!

  • Like 1
Link to post
Share on other sites

I haven't debugged the problem with the slider fix and the stock system image, but it could be the same as the problem with the October 'release' builds of the Android 10 GSI. IIUC it *ought* to work, but perhaps the RRO for framework-base.apk has to be signed with a different key on a user build. In both cases the kernel generates the events correctly, but they aren't processed by Android's higher layers. All of the builds that work with the slider fix are userdebug rather than user, and consequently they have slightly reduced security requirements.

I have let F(x)tec devs know about the Treble fixes, but new OTAs for stock probably won't be available until after the Chinese New Year holiday. I hope they will integrate some of the fixes, but we'll have to see which ones they like.

Link to post
Share on other sites
On 1/13/2020 at 4:42 PM, Sean McCreary said:

In a pinch you can always try to enable the keyboard backlight manually with the command:

Quote

echo 1 > /sys/class/leds/keyboard-backlight/brightness

This is inconvenient and doesn't work on stock, but it is better than nothing.

Wait... does that mean that you can change the brightness setting of your keyboard backlight? Or is it an on/off setting despite the name "brightness"?

  • Like 1
Link to post
Share on other sites
2 hours ago, SchattengestaIt said:

Wait... does that mean that you can change the brightness setting of your keyboard backlight? Or is it an on/off setting despite the name "brightness"?

Even though the kernel accepts an 8-bit value, sending it a '1' seems to result in the same brightness as sending it '255'. I don't think the keyboard backlight hardware supports variable brightness.

  • Thanks 3
Link to post
Share on other sites
12 hours ago, Sean McCreary said:

I have added a new lights HAL to the patched vendor.img that forces the keyboard backlight to follow the display backlight state. Whenever the screen is on, the keyboard backlight is on as well. This isn't ideal, but it works well enough that I felt it was worth an update.

I think a better solution would be to only turn on the backlight in the event of slider opening or any key pressed.
That way if keyboard remains open, one may need to press a key to light up the keyboard (maybe it needs the modification of the low level driver).

The best solution would be if a counter would exists (initial value is ideally set by user) and any keystroke would reset that counter.
That way keyboard light would be turned off after a certain time and is able to be turned on also if slider remained open when the phone went to standby.

Also, it seems the system keeps landscape orientation lock so the most simple solution may be to set last state based on its value on wakeup.

Currently, I use fn+F6 to turn backlight on in case of it remained off after wake up and I feel it is relatively convenient as at least I don't have to close and open the slider to get it work.

  • Like 1
Link to post
Share on other sites
34 minutes ago, VaZso said:

I think a better solution would be to only turn on the backlight in the event of slider opening or any key pressed.

[...]

Currently, I use fn+F6 to turn backlight on in case of it remained off after wake up and I feel it is relatively convenient as at least I don't have to close and open the slider to get it work.

Remember this thread is about Treble-compatible changes, which means no changes to the system image are allowed. We can make changes to the HALs below the core OS, or add apps that run above the OS layer, but mostly my fixes simply improve integration with the core frameworks provided by Google. These limitations make it difficult to add entirely new features.

Google expects the slider to send SW_LID events rather than keystroke events, so the slider fix means you can't turn the keyboard backlight on and off with F5 and F6. There are other ways we might add backlight control using key combinations (perhaps using a privileged app), but the current HAL change makes it more likely you would want to turn it off than turn it on 😉

  • Like 1
Link to post
Share on other sites
  • 3 weeks later...

Just wondering, since I am hesitant to take the plunge and flash my new phone: has anyone been using Android 10 GSI on their Pro1 regularly? How does it compare to stock? Any important functionalities lost or messed up?

Link to post
Share on other sites
10 minutes ago, jjarmasz said:

Just wondering, since I am hesitant to take the plunge and flash my new phone: has anyone been using Android 10 GSI on their Pro1 regularly? How does it compare to stock? Any important functionalities lost or messed up?

Well the initial post has this link that includes a guide and a list of issues. (I have not tried it yet though)

Link to post
Share on other sites

Earlier today I saw mccreary post elsewhere that he updated the GSI test files (same link as in the first post) and if the changes he's been talking about are working, it should be getting pretty good by now. 

  • Like 2
Link to post
Share on other sites
On 1/19/2020 at 5:25 AM, VaZso said:

I think a better solution would be to only turn on the backlight in the event of slider opening or any key pressed.

FYI, there is an easy Treble-compatible tweak to wake the Pro1 with any keypress. When combined with the modified lights HAL, this will turn on the keyboard backlight on when the device wakes.

Edited by Sean McCreary
  • Like 3
Link to post
Share on other sites
  • 1 month later...
On 2/14/2020 at 6:04 PM, Sean McCreary said:

FYI, there is an easy Treble-compatible tweak to wake the Pro1 with any keypress. When combined with the modified lights HAL, this will turn on the keyboard backlight on when the device wakes.

Dear Sean!

Please tell me (or give a link to instructions) - how to install these tweaks?

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms