[OnePlus 3T ROMs, Kernels, Recoveries, & Other Deve] :
[MENTION=7030109]mcdachpappe[/MENTION]: please try to find the time to get known to git (not the ****ty github interface). The slider commits are in a shape, I'll never merge. I was about to add the nightmode commit, but realized you claim authorship fpr this commit, but the original author is Justin Klaassen. Kanging authorship is considered as bad manner in the open source community. When you are known for doing so, peer preasure will take at least 5 points from your karma account.

As long as you have no merging conflicts, it's quite easy to avoid kanging authorship: you can just fetch the URI of the git frommwhichnyou will take the commit, and then just cherry-pick on the commit hash (that's why I like the lg1 alias that much). Even easier: go in the github webif to the commit you want, copy'n'paste the URL and append ".patch" to the tail, and feed it to "git am" (i.e. "wget https://github.com/mcdachpappe/andr...6f60615be21ba3678ec6616779a5dc00a6776b6.patch -O - | git am"). Or you can pipe the patch through "sed -e 's/oneplus3/oneplus3t/g'".

EDIT1: in this case it's much easier: find the abandoned commit in gerrit, Klick in the upper right on download, and select the cherry-pick row. If you click on the little document icon on the end of the cherry-pick line, the command sequence isncop8ed to clipboard. Open a shell, cd to the local directory (in this case [buildroot]/frameworks/base) and paste the clipboard content. History, ID and authorship are left untouched. In local_manifest is a file called my_pick.sh: it has a cherry-pick on a gerrit commit, which is not meeged, yet. And also four wgets to github gits.

If all fails and I run into serve merge conflicts, you can save the wget output (the patch) to a tmp file, apply all changes by hand, leave only the header (everything before the first diff statement in the tmp file) and when you have finished your editing just as append (">>") the output of "git diff" to the tmp file. Next hard reset your git and apply the patch: "git am tmp-file".

Hopefully this helps you with your first steps with git. I can't emphasize enough: learn git. Development is much more fun (and much easier), if you know yoir tools.

EDIT2: Sadly, I have more bad news: did you had a looke at the implementations of LiveDisplay's auto-mode and NightDisplay's implementation of auto-mode and custom-mode? Done that (that's devs homework); and I'm pretty sure, there is no communication between the two subsystems,mand therfore can't be iswd at the same time: if both (NightDisplay and LiveDisplay) try to write settings to the sysfs display interface, there is not only no communication, but also no locking or mutex...

When you told me, that patch only adds a an additional tile to the rom, you was completely wrong: it enables the complete NightDisplay implementation for the device (see: https://source.android.com/devices/tech/display/night-light#top_of_page). And this implementation can't be used with LiveDisplay (not only auto-mode, but the complete LiveDisplay part) at the same time.

I think, it's not a good idea, to drop LiveDisplay all together.

To enable NightDisplay with only droping the night mode deom LiveDisplay, you have to build a dynamic cross-module switch: if NightDisplay (no matter if custom or auto or tile) is used, LiveDisplay's night mode needs to get disabled and vice versa: if LiveDisplay's night mode (again: no matter if auto mode or manual switch) is used, N8ghtDisplay must be automatically disabled.

Additionally we haven't a complete implementation of HWC2:

ingo@adler /usr/local/src/cm14/device/oneplus/oneplus3t $ grep -r HWC2 BoardConfig.mk
#TARGET_USES_HWC2 := true
ingo@adler /usr/local/src/cm14/device/oneplus/oneplus3t $

Anyway: thanx for the heads up. If the overlay would only add a tile, which switches LiveDisplays night mode, we would be fine. I belive the easiest way to accomblish this, is building a tile that does not require NightDisplay. Setting up cross-module dynamic switches, protected by locking sounds like a pain in the arse to me.

BTW: I don't like the way the addotional switches for the slider are build. "Overloading" three states with two additional ones, by shifting and stacking on a base value and in return stop using the defines from the rom itself is more of a hack, then a clean, portable and verifyable way of adding functions... If the defines are changed upstream: you are in trouble.

Use the source, Luke!

EDIT3: have a look at the ambient display tile laos added some weeks ago. That's the way to get a night mode tile, that triggers the manual mode of LiveDisplay's night mode.