[ROM][Android 8/9/10][Unofficial] LineageOS for Mi-4c/Mi-4s

Segment1985

New member
Apr 8, 2020
2
0
0
For the second one, I think it should work (theoretically), but I don't have a Mi-4s to test it (the Mi-4c is my only mobile phone). It might be caused by the kernel change which brings oneplus fingerprint stacks. I could send you a kernel with that change removed later.

Edit #1: The new kernel is uploaded as an attachment. Please rename it to "boot.7z" and decompress, then flash the "boot.img" in TWRP.
Not working. Ready to test other.
 

hkdg009

Member
Oct 16, 2018
11
1
0
Build resurrection remix os 17.0 issue

After compiling Lineage successfully, I will try to compile the resurrection remix os using the code you provided. At the end of the compilation, it prompts that the / firmware file or directory cannot be found and the compilation fails. Can the landlord help me see what is the problem?:):):)thanks
log:
 

Attachments

  • Like
Reactions: anamov

mr_rious

Member
Sep 27, 2013
14
2
0
Do you mean the device keeps a black screen even if you pressed the power button for many times? This problem happens only in my test versions (newer than 20200330) and got fixed now (no longer happens on my device).
Besides, in some specific situations, the WLAN driver may carsh and cause (I don't think it's a hardware issue) the whole system working weirdly. But it shouldn't happen in most times with most wireless APs.
That's exactly what I mean. However, I was able to fix a little bit the error by deactivating the "Tap to activate", "Tap for standby" and "Prevent unintentional wake up" options. But this is not a binding solution, I can also be wrong.

The only thing that bothers me is that sometimes it just restarts in the morning without doing anything
 
Last edited:

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
After compiling Lineage successfully, I will try to compile the resurrection remix os using the code you provided. At the end of the compilation, it prompts that the / firmware file or directory cannot be found and the compilation fails. Can the landlord help me see what is the problem?:):):)thanks
log:
Did you try to make that directory in rootfs (/) directly? Note: In my "BoardConfig.mk", I used "BOARD_ROOT_EXTRA_SYMLINKS" to link "/vendor/modem_firmware" ← "/firmware" (also see "Android.mk").
It seems that the selinux file contexts of "/firmware" was missing. Commonly, there should be such policies in "device/qcom/sepolicy-legacy", like this:
Code:
# firmware images
#
/vendor/firmware(/.*)? u:object_r:firmware_file:s0
/system/etc/firmware(/.*)?  u:object_r:firmware_file:s0
/system/vendor/firmware(/.*)? u:object_r:firmware_file:s0
/firmware(/.*)? u:object_r:firmware_file:s0
If there is no qcom sepolicy in RR's source, or you forgot to include "device/qcom/sepolicy-legacy/sepolicy.mk" in device tree, errors may happen.
 
Last edited:

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
That's exactly what I mean. However, I was able to fix a little bit the error by deactivating the "Tap to activate", "Tap for standby" and "Prevent unintentional wake up" options. But this is not a binding solution, I can also be wrong.

The only thing that bothers me is that sometimes it just restarts in the morning without doing anything
Right, I never enable "Double tap to wake" on my device as it uses much power, but the other two never caused problem in my daily usage. In my recent test versions (not published), I didn't found the black screen problem on my device. I always shutdown my phone before I'm asleep, so I'm not sure if it will restart in the morning (I think it shouldn't, may depend on background apps or modification like magisk modules).
The new version will be published tomorrow (maybe?), with 4/5/2020 security patch.
 

hkdg009

Member
Oct 16, 2018
11
1
0
Did you try to make that directory in rootfs (/) directly? Note: In my "BoardConfig.mk", I used "BOARD_ROOT_EXTRA_SYMLINKS" to link "/vendor/modem_firmware" ← "/firmware" (also see "Android.mk").
It seems that the selinux file contexts of "/firmware" was missing. Commonly, there should be such policies in "device/qcom/sepolicy-legacy", like this:

If there is no qcom sepolicy in RR's source, or you forgot to include "device/qcom/sepolicy-legacy/sepolicy.mk" in device tree, errors may happen.
thank you !! I try again.:cowboy:
 

lousido

Member
Jul 12, 2009
10
1
23
Hello:
Updated the ROM to the new version 17.1-20200415 on Xiaomi 4C, it is working correctly, without losing data. Only after charging all night, on, in the morning, the screen is locked and needs to be restarted. (This was already happening with the previous version). If it is disconnected when it is 100% charged it works fine.
I use it for daily use with gapps "pico", after removing "NotoSansCJK" and "webview" to have space.
I have to comment that a device (1/4 family) cannot be updated from version 17.1-20200225. With this ROM it works perfect. After updating it to the following versions and with charger disconnected, the screen freezes and then restarts constantly. I am intrigued by the reason (I have no technical knowledge). Any suggestion?
I thank you very much
 
Last edited:

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
Hello:
Updated the ROM to the new version 17.1-20200415 on Xiaomi 4C, it is working correctly, without losing data. Only after charging all night, on, in the morning, the screen is locked and needs to be restarted. (This was already happening with the previous version). If it is disconnected when it is 100% charged it works fine.
I use it for daily use with gapps "pico", after removing "NotoSansCJK" and "webview" to have space.
I have to comment that a device (1/4 family) cannot be updated from version 17.1-20200225. With this ROM it works perfect. After updating it to the following versions and with charger disconnected, the screen freezes and then restarts constantly. I am intrigued by the reason (I have no technical knowledge). Any suggestion?
I thank you very much
If you want to install Gapps, I think just removing NotoSansCJK.ttc is enough (if you didn't install another webview package, removing the prebuilt webview may cause problem).
I didn't found any special change in 20200225 that may cause such problems. My device is 3GB/32GB version with Sharp-RSP61322 screen, but the rom is also reported to work on 2GB/16GB devices.
It's strange that my device only got the "black screen" issue in my test versions weeks ago, but not in the latest build. Also, I used to connect my device to USB to charge for half a day, and nothing wrong happened.
However, it's a known issue that the device may charge with abnormal speed when connecting to charger (but not USB). For the screen freeze issue, it should only happen when unlocking the lockscreen in some specific occasions. It's caused by errors about EGL (a new GPU driver may fix that, but Mi-4c has no new driver after all) and I never found it related to the charger.
 
Last edited:
  • Like
Reactions: lousido

lousido

Member
Jul 12, 2009
10
1
23
If you want to install Gapps, I think just removing NotoSansCJK.ttc is enough (if you didn't install another webview package, removing the prebuilt webview may cause problem).
I didn't found any special change in 20200225 that may cause such problems. My device is 3GB/32GB version with Sharp-RSP61322 screen, but the rom is also reported to work on 2GB/16GB devices.
It's strange that my device only got the "black screen" issue in my test versions weeks ago, but not in the latest build. Also, I used to connect my device to USB to charge for half a day, and nothing wrong happened.
However, it's a known issue that the device may charge with abnormal speed when connecting to charger (but not USB). For the screen freeze issue, it should only happen when unlocking the lockscreen in some specific occasions. It's caused by errors about EGL (a new GPU driver may fix that, but Mi-4c has no new driver after all) and I never found it related to the charger.
Thank you very much
Tonight the load worked fine and there was no black reset screen. Everything is ok in version 20200415.
All my devices are 2Gb / 16Gb. I can't find reason why it can't be updated. It is operational with version 20200225.
Courage and very grateful for your work.
 
Apr 1, 2018
18
2
3
Yerevan
Hi. I have a 2/16 MI 4C and using it as a second phone. I'm trying to find a perfect ROM for this phone.
I think LOS 16 is great and can be that perfect one. But there are some problems for me.
So the reasons that I like LOS 16 instead of 17 are :
reason 1. ) I really need FaceUnlock (trusted face in smartlock) to unlock it. Android 10 does not support that, but Pie (9) supports that.
reason 2. ) I want to avoid problems with lockscreen (black and crushed System UI and similar stuff) .

Sadly there are some problems that I face with.
problem 1.) Every time System UI asks for permission to turn On/Off WiFi, BT and etc in the quick settings.
problem 2.) Having 2Gb Ram in 2020 is not the best experience. I found a great solution, but it does not work on Android Pie.
Adding this line in build.prop and making Background Process Limit number smaller saves 300~400 MB of RAM.
ro.sys.fw.bg_apps_limit=7 // 7 is the Max number of Background Processes.

In developer options you can apply max 4 number and it gets reset to standard limit of device (25 I think) after reboot.
That line was working on Nougat, but not on Pie. Now I need to find a new solution to change the standard limit.


ro.vendor.qti.sys.fw.bservice_limit=7 // This is not working on Pie too. But working on OnePlus phones with Pie.
 
Last edited:

Szuter

New member
Mar 29, 2020
3
0
0
If you have time, try to connect the headphones and switch the default codec to "SBC" in "Settings-System-Developer settings". If it keeps disconnect, try to use some other codes.
I think the headphone should use aptX by default. If aptX codec doesn't work, try to replace "libaptX_encoder.so" and "libaptXHD_encoder.so" with the one below (location: /system/vendor/lib64/):
Awesome works no problems, thank you! The ROM is great, will keep it, awesome work!
 

qtotter

Senior Member
Mar 13, 2006
698
66
48
Tokyo
Thanks for the great ROM. Mi4c is still useable!! As a Japanese, removing NotoSansCJK.ttc from /system is not an option to install Gapps pico, so I removed instead;
browser
calculator
clock
contact
music(eleven)
recorder
They can be replaced by Google equivalents or sideloaded in data/app, anyway. I could install Gapps pico and Magisk without any issues after removing those apps.
 

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
Thanks for the great ROM. Mi4c is still useable!! As a Japanese, removing NotoSansCJK.ttc from /system is not an option to install Gapps pico, so I removed instead;
browser
calculator
clock
contact
music(eleven)
recorder
They can be replaced by Google equivalents or sideloaded in data/app, anyway. I could install Gapps pico and Magisk without any issues after removing those apps.
If you still need those prebuilt apps, removing "/system/product/app/webview" is a better solution, which could save about 130MB free space (more than NotoSansCJK.ttc). Remember to install Google Webview first before the removal, or the web pages will be broken.
 

qtotter

Senior Member
Mar 13, 2006
698
66
48
Tokyo
If you still need those prebuilt apps, removing "/system/product/app/webview" is a better solution, which could save about 130MB free space (more than NotoSansCJK.ttc). Remember to install Google Webview first before the removal, or the web pages will be broken.
Thanks, but I prefer to have webview installed when initially booting.

I have a couple of questions. It took me more than 30 mins to backup 34 user apps and data by Titanium Backup. The storage seems slower than before. Installing apps from Play Store is also slow. Are there any ways to speed up the storage?

Also, You have included only the round (circle) shaped icon theme. What should I include to have a choice for other shapes in the theme menu?
Resolved: I extracted IconShape*.apk from another full LOS17.1 ROM and put it /product/overlay to change icons.

Thanks.
 
Last edited:

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
Thanks, but I prefer to have webview installed when initially booting.

I have a question. You have included only the round (circle) shaped icon theme. What should I include to have a choice for other shapes in the theme menu? Thanks.
Right, those icon shape and some other overlays were removed to reduce resource consumption. I will add them back in the next rom update.
If you need them right now, I could send them as attachments this afternoon.

Update #1: Decompress the zip in attachment and put "/overlay" into "/system/product/", then set file permission to right value.
 

Attachments

Last edited:

qtotter

Senior Member
Mar 13, 2006
698
66
48
Tokyo
lineage-17.1-20200415-UNOFFICIAL-libra is a very good build, but it seems unstable freezing once in awhile. I guess it's because there's not cpu_max_freq/scaling_max_freq settings. Isn't it safer to have it in the ROM? I have put a script to limit the max freq to 1440000 myself.

Also, I have notice there's not init.d in /system/etc. I use Magisk, and I can run scripts on it. Supporting init.d also space-consuming?

Sorry, I am NOT complaining. I just wanna help your ROM to be stable for everybody. Thanks.

---------- Post added at 03:20 PM ---------- Previous post was at 03:14 PM ----------

Right, those icon shape and some other overlays were removed to reduce resource consumption. I will add them back in the next rom update.
If you need them right now, I could send them as attachments this afternoon.

Update #1: Decompress the zip in attachment and put "/overlay" into "/system/product/", then set file permission to right value.
Great! Although I am not sure many people want to have this option sacrifying the limited space of /system... I just wanted to use IconShapeRoundedRect myself. Thanks for your prompt responses!
 

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
lineage-17.1-20200415-UNOFFICIAL-libra is a very good build, but it seems unstable freezing once in awhile. I guess it's because there's not cpu_max_freq/scaling_max_freq settings. Isn't it safer to have it in the ROM? I have put a script to limit the max freq to 1440000 myself.

Also, I have notice there's not init.d in /system/etc. I use Magisk, and I can run scripts on it. Supporting init.d also space-consuming?

Sorry, I am NOT complaining. I just wanna help your ROM to be stable for everybody. Thanks.

---------- Post added at 03:20 PM ---------- Previous post was at 03:14 PM ----------


Great! Although I am not sure many people want to have this option sacrifying the limited space of /system... I just wanted to use IconShapeRoundedRect myself. Thanks for your prompt responses!
For the first problem: do you mean the device got freeze at lockscreen (eg. when you try to unlock the device)? Or the device stop responding for about 10 seconds in any app (eg. press back button but nothing happened, home button still works)?
There is a "scaling_max_freq" in "/sys/devices/system/cpu/cpuX/cpufreq/", and it's set to correct value by "init.qcom.post_boot.sh" during boot process.
I didn't found "cpu_max_freq" (only a "cpuinfo_max_freq" there), and it should not cause problem (it's set to the max frequency by default).

For the second problem: init.d has been removed by LineageOS team, so it's not officially supported anymore (I didn't remove it, as init.d is less than 1MB).
Most things I removed are some prebuilt packages (eg. the AOSP Calendar that still uses holo UI from Android 4.x), then some binaries (eg. bash, nano, vim...). The system partition on Mi-4c is not so small, but the Gapps have become larger and larger (that's why Pixel Experience rom on Mi-4c requires a manual re-partition to make "/system" larger). Another reasons are the full-weight NotoCJK fonts, and dex2oat with "speed" profile.
 
Last edited:

qtotter

Senior Member
Mar 13, 2006
698
66
48
Tokyo
"do you mean the device got freeze at lockscreen (eg. when you try to unlock the device)?"

It's my old phone, and I didn't use it as a phone now, so I can't really tell the timing of freeze. But I found it was frozen after sleep mode multiple times as you said.

As for frequency, it seems like the cores go up as high as they are allowed. I remember the stock ROMs cap the max freq for safety.

Since I limited the max CPU speed to 144k, it has been very stable without any unpredictable freezes. Also, the phone is not as hot as before.

---------- Post added at 04:24 PM ---------- Previous post was at 04:01 PM ----------

"init.d has been removed by LineageOS team, so it's not officially supported anymore"

Sorry, I didn't know that. It's not critical because Magisk can handle scripts.
 
Last edited:

Michal38

New member
Dec 10, 2017
2
0
0
I'm running LineageOS 16.0 20200321 on my mi4c and everything works perfectly expect one thing. Whenever I turn on/off WiFi there is a pop up "UI wants to turn on/off WiFi" and I always have to accept it. Is there any easy way to fix it?
 

WJXXBSH

Senior Member
Dec 22, 2018
86
56
18
I'm running LineageOS 16.0 20200321 on my mi4c and everything works perfectly expect one thing. Whenever I turn on/off WiFi there is a pop up "UI wants to turn on/off WiFi" and I always have to accept it. Is there any easy way to fix it?
That's not a bug but a feature called "Permission review", which could help you to manage app permission like Android 10 (partly) in old Android versions. The popup problem is a drawback of it, but Google only resolved it in Android 10 (it's in beta/test stat in old Android versions).
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone