yashsingh1/xdaforums huggingface dataset:
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
Well that's a bit of an annoying process to get ForceDoze to work. Does ForceDoze actually provide any advantage over Greenify (apart from not requiring Xposed, for those who don't use it)?

I've been using Force Doze this whole time, but never actually bothered to check if it was working. I guess it's not really a big deal for me since I never noticed a problem to begin with.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] asusm930:
I need force doze to work when im carrying the phone/driving. It drains like 2x more without force doze when im moving/driving.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] adrxano:
I tried this and it's working very well so far for me. Before I tried this only bbs use to show doze stats but gsam used to show nothing under doze stats. Now with this method you've shown me gsam is finally showing that my device is going into doze mode instantly. I was wondering now if it's necessary to still have amplify and greenify and other batter saving mods if doze seems to be working perfectly?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] asusm930:
Exactly. And the best thing is it relies on the stock battery optimization app list ??
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] javertian:
Thanks, it's working great on EU room.. i was stuck with EPIC rom for sometime as there were no updates.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
Is it maybe related to this? Specifically, post #4 (Location history off causes battery drain...? Weird)

I just checked and saw that Location History on my device was OFF for 'Current Device', yet under 'Other Devices' it had another (older) Note 4 device that was set to on. I've since set the current device history to On (since I'm not one of those paranoid tinfoil-cap people and appreciate the various conveniences this has) though I never actually noticed a battery drain problem before so I can't test.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] balyahaidar:
Hi dan i tried this in miui official 8.2 stable and this is amazing,but when i play game (love live! School idol festival) its laggy just like when i using aosp rom,have you any idea what cause that? I tried unchek the whetstone it's not laggy as before but still not as smooth as stock. Thanks
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] adekboreanaz:
Thank you!, I never tested the stock eu ROM tho, but i came from.Epic ROM which is moded eu ROM, Epic was battery drainer i'm a heavy gamer and heavy multi tasker, i got battery life more efficient than the Epic, but sacrificed some smooth and responsiveness​ for a little bit abttery, i think it's worthy, because epic was such a good multi tasking and gaming rom

xiaomi.eu.rom 8.3 weekly 7.5.4
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
I just want to ask if the doze editor trick you mentioned on your post here https://xdaforums.com/redmi-note-4/how-to/doze-enable-android-doze-miui-roms-t3559960 do the same thing as the force doze app?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] asusm930:
No. Doze editor changes how fast doze happens

Force doze forces doze to happen even when the device is moving (doze is disabled when device is moving - like in car, or walking or riding bike)

If you use force doze, doze editor is not needed as force doze edits the doze settings.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
OK, I have tried this forcedoze trick and doze is working great, but, deep sleep stopped working. Any idea how I can bring it back to work?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] asusm930:
its not supposed to do that at all. How do you check deep sleep? I use gsam battery monitor and look at the miui battery graph. I suspect your phone never went to deep sleep in the first place.

Install FX file manager and the root add on playstore

go to system and look for build.prop

open edit build.prop

and look for the lines

ro.mtk_volte_support=1

ro.mtk_vilte_support=1

and change to

ro.mtk_volte_support=0

ro.mtk_vilte_support=0

that is if you have never applied the deep sleep fix before
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
Forget my previous reply, I am using 2 sim cards, one of them is not 4G capable, I just switched the default internet sim to the 4G one and deep sleep worked again, many thanks to [MENTION=2078083]asusm930[/MENTION] and [MENTION=1844875]CosmicDan[/MENTION], my device reached 4hrs. SOT with 43% remaining, and I'm so happy right now, lol
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] asusm930:
I highly suggest you apply the fix anyway if you dont use volte and you will most likely not get any deep sleep problem regardless of which sim you use for internet :good:

glad you're getting good battery now
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
Actually, I just forgot to flash the deepsleepfix zip file after I installed the latest weekly EU rom and applied the cosmictweaks yesterday. I only noticed it today when I switched the default internet sim. By the way, is the deepsleepfix.zip same as the deep sleep trick you mentioned? Which one is better?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] asusm930:
if im not mistaken its the same

the older version of the deep sleep fix straight up disabled LTE/4G lol

thats why I prefer doing it manually because I dont trust the deep sleep fix xD

you can check for yourself by looking for these lines in the build.prop file and see wether theyve been changed or not

telephony.lteOnCdmaDevice=1

ro.mtk_lte_support=1

those should be the original values

changed values that disabled 4g are

telephony.lteOnCdmaDevice=0

ro.mtk_lte_support=0
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
Yep, it's the same, this is what's inside the tweak.prop. Again, thanks for your help.

BACKUP=n

$telephony.lteOnCdmaDevice|1

$ro.mtk_lte_support|1

$ro.mtk_volte_support|0

$ro.mtk_vilte_support|0
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
Probably just an incompatibility that you can't do anything about. The Mali GPU's are odd, they're fast OK for most things, but they're really bad at some specific features or something like that. I've noticed that some games just aren't optimized for them, whereas some other games that seem more intensive can run better for some strange reason.

Say, is Doze the reason why the block on my lockscreen "lags"? By that I mean, when I press power to check my time/whatever, it's initially set to around whatever it was when the device was last awake - but then flips to the current time. Not a problem, just a peculiarity I've noticed.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] Supermatt01:
So, if I install the newest build for this tweak, should I disable whetstone or leave it alone?

---------- Post added at 09:19 AM ---------- Previous post was at 08:43 AM ----------

Lspeed has a force doze mode also. Greenify works with just root as well, the options are just more detailed in the xposed version.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] asusm930:
Nah that was xiaomi stealing what HTC used to do haha. They did that even back in miui 5
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] Supermatt01:
I'm going to give it another day or two before finalizing my opinion, but so far it looks like your mod may have fixed my power drain. Screen on time projected at above 5 hours... Thank you.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
I noticed the lags too. I've been using video call in messenger while browsing in Facebook, it is laggy to the point that I no longer do it at the same time. Before in my previous xiaomi.eu 7.3.23 without the cosmic tweaks, I can browse facebook while video calling with little to no lag at all. I mean the battery is excellent and all, but the lag makes me consider going back to my previous ROM without the cosmic tweaks. It's just a shame to go back, I love the battery performance in your tweak. Does this have to do with the perfservice thing?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] spr33:
The lags are from disabling perfservice, I noted this back when the tweak was first found.

I disabled it again last week and found the same lag I first saw. Dirty flashed and tweaked without disabling and the lag was gone.

YMMV.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
Right, I remember your reply in asusm930's thread regarding the perfservice, so I got a hint it was the culprit.

I just dirty flashed the tweak without disabling perfservice, and it feels much smoother now. I hope it doesn't affect the battery performance that much.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] spr33:
I found battery life to last around the same as with it disabled.

Again, YMMV :)
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] Supermatt01:
Thank you, ComsicDan. This is the first time since buying this device that I have gotten 5 hours SoT. Fantastic. I have had some issues with the touch screen on picking up touch input, mostly with Swype keyboard, but it's livable. Thank you.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] asusm930:
An alternative battery tweak

1. Download this file and put in system/etc. Save the original file somewhere else of you want to restore https://drive.google.com/file/d/0B_Q4QjvbODxoY3dwX1JLZVUzS3c/view?usp=drivesdk

This basically restores perfservice method if controlling CPU frequency. I just deleted the lines that affected how cpu is managed while doing other things EXCEPT multitasking . Also enable back perfservice via build.prop (ro.mtk_perfservice_support=1). With perfservice disabled, cpu js managed by hotplug and interactive governer. With it enabled it is managed mostly by perfservice in priority.

2. Place this file in su/su.d and give 0755 permission. You will only have su/su.d directory if you root using superSU btw

https://drive.google.com/file/d/0B_Q4QjvbODxoZFF0TTRSZk8xc0E/view?usp=drivesdk

https://drive.google.com/file/d/0B_Q4QjvbODxoQTVlQ1BfWkQ2TjA/view?usp=drivesdk

These files on the other hand change some GPU and CPU parameters. To reverse just delete.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
I got a problem with permissions on apps. When I use a new app and it asks for permission, you have an option to "Deny" and "Allow" it that will pop-up. Tapping any option won't work and freezes the screen. I have to press the home button to get out of that screen.

My only choice is go to Security>Permission> and find the app permission category to manually permit it.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] Wilderone:
Try going into TWRP & fix Contexts.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
[OT] Just want to ask you guys, I don't want to open a new thread, and this might be the fastest way to have an answer.

I will have a new phone (MI 5S Plus), which I also plan to unlock its bootloader. Here are my questions:

1. Can I use my current mi account to unlock this new phone? Since my mi account already have the permission to unlock.

2. I will be giving my Redmi Note 4 to my son, and will remove my mi account on that device then make him a new account. Is that possible? Would that phone's bootloader still unlocked?

Sorry for the stupid question, I don't know how mi account works.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] Wilderone:
1. Yes, as long as it has been 30 days between unlocks on the same account.

2. Yes it will stay unlocked when removing account.

Should really have created a new thread

..
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] Laievskaia:
Will not be updated any more?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] gsmyth:
Is there any need to spam every thread with the same post? Most of us are well aware of cofface's aosp rom.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
Thanks for chiming in. I'll add a red warning disclaimer to this and uncheck from default, since people were reporting good battery improvements before this was included anyway. I wonder if it's also the cause of my random hard-freezes lately...

MIUI bug, it's not related to my tweaks. See the Bug Report thread with my details and work-around here. Thanks for the reminder, I'll add this link to the tips section in OP.

Update what? If there is something I need to fix or something useful to add, then I will update. But there is nothing to update right now, not that I can see. Correct me if I am wrong.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
Thanks again for your tinkering :)

I will add this stuff to the Aroma installer so we can all test and compare easier away from a PC, the Aroma installer will have options to restore default.

EDIT: It's gonna be a while, though. I'm actually neck-deep in a complete refactor to make CosmicTweaks a more modular and generic tweak manager, I don't really have an ETA since mid-year exams are approaching fast.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] gsmyth:
Thanks for your work and [MENTION=2078083]asusm930[/MENTION] and [MENTION=396391]spr33[/MENTION] also.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] xyl574117954:
i want to know what /cust partition is. How does it work? hope ur reply!
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] adrxano:
[MENTION=2078083]asusm930[/MENTION]

[MENTION=1844875]CosmicDan[/MENTION] any chance of you guys developing a kernel for our device or even some sort of way we could change our cpu govenors to get better battery life?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] deathkid13:
Will this work for aosp?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] asusm930:
its impossible. End of story. Until someone gets a stable AOSP ROM working, there is no way to change governers etc. If you are rooted on stock ROM, you can select a few stock governers via Kernel Audiotor. That's it.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] adrxano:
Will using kernel audiotor increase battery life?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
It's "customized" partition. It's just a place for extra files to go for branding or carrier. It is like a vendor partition, only MTK's own idea about it.

We don't have the original kernel source.

No.

Try it and let us know? I doubt it.

I've had random freezing on my Note 4 lately, no idea why but it's very annoying.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] xyl574117954:
so if i delete all files in cust partition via TWRP, will my phone not boot into system any more? or broken? THANKS for your reply.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] adrxano:
I tried kernel audiotor and it made no difference to battery life. Powersave governor made my device very laggy.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
I figured out why I can't press "Allow" on permission prompt. It's because of Velis Auto Brightness. Now, it won't occur when you install Velis normally.

I did [MENTION=2078083]asusm930[/MENTION]'s trick to not let the app be killed by MIUI on idle. It so happens that Velis sometimes don't work if you won't do this trick. I enable Velis to autostart then converted it to system app using link2sd, after reboot, I locked it in recent apps window. Now, Velis works perfectly anytime, but I cannot press "Allow" on any permission prompts. Though it's alright, cause I can manually allow it on Security>Permission.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
It will boot fine, it's just preinstall data. Old versions of CosmicTweaks used to wipe /cust, but it doesnt anymore (it only matters on China ROM).

No it's not Velis to blame. It happens with any apps installed that has "Draw over other apps" permission, like Facebook Mesenger. It's an MIUI bug with the missing tapjack warning UI. Exactly as I reported, and the Xposed module to disable the warning prompt solves it. If you disable the ongoing notification in Velis or disable it's option to draw over other apps then it's a work around.

It's an MIUI bug that is not unique to Velis.

Everything else you're talking about is completely unrelated. I use Velis myself, I keep it as a user app and it works perfectly. I just enabled Autorun for it and locked it in memory in recents, and it's fine. It doesn't get killed by System, I have no need to convert it to system app. I just use the Xposed module and it fixes the MIUI bug permanently - Allow button actually works now.

So my device is stuck on a black screen now, once again I got another freeze. ADB works, logcat works and shows nothing unusual (except for regular "hangdebug: horizon: hangdebug wakeup" which might mean something), but I have no idea what the problem is. I don't even know how to diagnose this. Top shows nothing unusual, free shows ~100MB free on RAM and ~200MB free on SWAP, so I have no idea what the problem is. Just about had enough of this.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] JohnMelson:
Same problem

My device is stuck on a black screen, too. Thinking that it because of the dev rom, so I made a local backup (using MIUI), copied that to the laptop then made a full wipe (included internal storage), flashed EU stable ROM 8.5.2.0, superSU and then CosmisTweaks (with everything was set by default, except check Whetstone, uncheck Disable PerfService, uncheck asusm930's Tweaks) and then restored from the local backup again, but the problem is still there.

I'm planning switch to offical stable ROM and flash your Tweak again to see if the black screen prolem is still there or not, but before that I want to help diagnose the problem. How can I do that?

Except of that, your tweak if awesome! You guys is the best!
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
I'm using Xiaomi.eu 7.3.23 (I've tried the later builds but the idle battery drain isn't good, I don't know what's on 7.3.23, but it's the best I've tried). I've never had any problem, it's smooth and battery is excellent. I've also applied the Cosmic tweaks on it, without disabling perfservice.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] JohnMelson:
Can you give me the download link? I couldn't find it in xiaomi.eu anymore.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
https://www.androidfilehost.com/?fid=745425885120718815
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] JohnMelson:
Thanks :o
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] eugene.sunie:
anyone tried flashing the Universal Performance Mod (UPM) after flashing this cosmictweak? I have done it and my device got better battery standby time.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
How is everybody's Note 4 going?

We haven't had an update in a while, but if all goes to plan at Xiaomi then we will get MIUI 9 this month :) extremely unlikely to be Android 7, but meh.

I am wondering if anybody has any instability issues with CosmicTweaks. I've had issues where, after a few days, the device slows down and then freezes completely, requiring a hard reset. Sometimes it reboots on it's own after the slow down. Not sure if it's my LMK values or some other tweak, or if it's a bug in 8.5.2.0, or a problem with Xposed + xMIUI (I hope not, because xMIUI adds some must-have things for me).

In the meantime I guess I will clean flash to 8.5.5.0, though I was hoping I could hold off until MIUI 9, I really need this stability.

[MENTION=4717273]eugene.sunie[/MENTION] I'll take a look at that, thanks for the share.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
Small update/news for watchers:

I may have mentioned that I was working on a CosmicTweaks that will work for other devices. I have since decided to work on a rewrite for this purpose - a modular framework to install mods and patches from Recovery, and people can create and add their own mods easily just by putting some ZIP files in a special folder or something (the AROMA menu will detect and load them and add new menus).

I am inspired by this again because I recently discovered how to make ROM patches at the dex level through Recovery, e.g. apktool decompiling and recompiling on the device itself inside the AROMA installer.

The goal is to provide a modding system that is somewhere in-between custom ROM's and Xposed. Xposed has performance/stability problems, and custom ROM's are too much work to maintain and update - so this project will try and get the best of both worlds ;)
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] bassbounce:
Does the mod add a working Google smart lock with trusted places?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] adrxano:
Hopefully the mod will get us battery levels close to the snapdragon variant of our device.

---------- Post added at 11:10 PM ---------- Previous post was at 11:05 PM ----------

My battery life on my note 4 has become very bad. Nothing can fix it. It can barely last half a day before I need to recharge. I've tried installing different roms, removing xposed and modules such as amplify and greenify, resetting, tried CosmicDan's mod and removed it also, tried L speed and hebf optimizer and many other things and the battery life still can't last longer than half a day. I'm starting to wonder if it's not the battery itself that's deteriorating even tho my device is about 4 or 5 months old. I ended giving up in the end and ordered the snapdragon redmi note 4 from AliExpress on the 5th of August. Still waiting for it.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] CosmicDan:
I don't even know what that is. No, it doesn't.

Nope, there's nothing I can really do to improve battery life. That's up to Xiaomi/MTK or another clever hacker to discover.

Have you tried adding LESS (i.e. nothing)? I don't use any tweaks or tuning at all apart from CosmicTweaks. No Amplify/Greenify, nothing else. Well, xMIUI and Xposed. I can last a day with heavy usage.

Sounds like a particular app is to blame. Amplify and Greenify are not effective programs IMO - they can help control badly-written "rogue" apps, but I prefer to identify these apps and remove/replace then entirely instead.

Something in the background is using CPU or something. BetterBatteryStats or similar app can point this out. It's also possible that you've used Greenify/Amplify too aggressively - it is very possible to cause a DRAIN with those apps (e.g. if you limit a dependency of a power saving service or something like that).

Or maybe it is a hardware problem.

Anyway, I've only been on 8.5.5.0 for a couple days now but it's great so far.
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] alesyt0h:
can I use this tweaks for resurrection remix build or EPic ROM??
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] spr33:
You definitely have a point about greenify and the like. Unless a particular app is causing issues with wakelocks etc, there's no real need to use them.

If you want to improve your battery life by a substantial amount, disable Google Location History and GPS altogether until you need it (lots of automation apps can help you with this so you don't have to do it manually each time).

With regards to 8.5.5.0, I've not seen a build of it anywhere? Is it official or xiaomi.eu?
[Xiaomi Redmi Note 4 [Mediatek] ROMs, Kernels, Reco] adrxano:
So far Ive removed greenify and L Speed as well as powernap and I've noticed a huge improvement in battery performance. Still early but very promising so far. I did keep amplify though and will remove it tomorrow to see of there's further improvement or not. Thanks for the good advice.