yashsingh1/xdaforums huggingface dataset:
[LG V20 Guides, News, & Discussion] shadavis08:
Man you still don't get it. You told him you would test. But you can't test with 10p 10s or 10t. Period. It's not possible. Good day. Cheers everyone. Carry on nothing to see here.
[LG V20 Guides, News, & Discussion] Ak7J4:
I can test if there are plans for those versions in the future
[LG V20 Guides, News, & Discussion] TheHamPimp:
Thanks for working on this guys...it's the only thing keeping me from using custom ROMs! Add another $5 to the bounty from me....hell,Zacharee1, just shoot me your paypal via PM and I'll pay you for your efforts thus far.
[LG V20 Guides, News, & Discussion] Zacharee1:
I guess it's time for another update. I haven't really gotten anywhere in a while.

I'm to the point where I know the second screen is functioning. The main content never overflows into it, and the window I've added does respond to taps. Unfortunately, I can't actually get anything to display. I've combed through the framework, and tried everything I can think of, but I just can't figure it out. My only idea is that it's part of a native library somewhere.

I haven't given up, but this is a pretty big roadblock. If anyone is familiar with the native side of the Android framework, I could really use some help.
[LG V20 Guides, News, & Discussion] phr00t:
Can you share the source you have so far? Can we get a project up on github? Can we get instructions on how to build on what progress you've made so far? Perhaps opening the project up to the community will make more progress than individuals working independently trying to get a bounty. Perhaps the bounty can be cut up among contributors to the github project.

You can also point out exactly where you are expecting a draw call to display something in the code. I wouldn't mind taking a look, but I can't guarantee I'll be of help.
[LG V20 Guides, News, & Discussion] TheHamPimp:
As a developer (not Android, unfortch), I'd pop your source code up on github. You'll probably find a lot of folks willing to help if they can look at the source. Trying to help without that can be frustrating.
[LG V20 Guides, News, & Discussion] XsaucerX:
I went to the htc u ultra forums here in XDA to see if maybe they had a solution for the second screen with custom roms that could help us, but seems like they only have sense(stock) based roms and all of those work with the u ultra second screen... We are out of luck...
[LG V20 Guides, News, & Discussion] fofo00o:
https://xdaforums.com/u-ultra/help/screens-notch-t3790925

??
[LG V20 Guides, News, & Discussion] Zacharee1:
Sorry guys. Yes, the plan is to upload what I've changed to a GitHub repo. There's actually an older version up right now. The problem is that I don't really know how to use Git that well, and I've been swamped with work on Navigation Gestures.
[LG V20 Guides, News, & Discussion] Grillac:
If you need any help with git, send me a pm. That's something I have a fair amount of experience using.
[LG V20 Guides, News, & Discussion] Ak7J4:
Ns if you've seen this before but if you go to lge's open source website you should be able to get some frameworks and etc. Idk if it's any help but thought you might want to to know.

opensource.lge.com
[LG V20 Guides, News, & Discussion] phr00t:
Just upload the source you have somewhere, like Google Drive or something. Another developer, hell even myself, will get it up on github.

Where is the old version and how much progress did you make on it?
[LG V20 Guides, News, & Discussion] Zacharee1:
I don't think I have the space or speed to do that, unless you want just a diff output?
[LG V20 Guides, News, & Discussion] phr00t:
What is the original github location you said an old version exists?

Which files did you change? How big are those files?

Can you just upload those files you changed? They should just be source files, like .c or something. Not very big, as compared to media or whole system binaries.

Just zip up whatever you have and upload it to a Google Drive account should work too.
[LG V20 Guides, News, & Discussion] Zacharee1:
Figured it out!

https://github.com/zacharee/android_frameworks_base

The branch cm-14.1-signboard (should be default) is where I've made changes.

I made a change in android_frameworks_native too, but it was just adding a Window Type constant to a class that doesn't seem to be used.

As it stands, everything works. It just doesn't show up. I think my sample app should also be in that source, so compiling it will let you open the AOSPSignBoard app and add a window. If you read your logs, you'll see that tapping the second screen does trigger a touch event on the window, but no content seems to be shown, unless I'm just completely derping out on something.
[LG V20 Guides, News, & Discussion] Zacharee1:
Well I tried to edit the OP with the GH link and an explanation of the current status, but XDA threw a 502 when I tried to save it.

Anyway....

I think I've done as much as I can on the Android modification part; I've reached a brick wall and I can't find anyone who's both willing and able to help. I'm hoping the 1 or 2 people here who pushed me to upload my source have some idea of what to do, otherwise we're stuck. I'm out of options.

Now, I'm not saying I'm abandoning this project. I just don't think I have the know-how to get the basic functionality in place, so I don't think I'll be working on what currently needs to be done (content not showing in the second screen). However, I'm completely willing to make the framework itself to manage the second screen and the widgets. My plan is to make it use the same AppWidget framework LG uses, along with the same widget category, so that my app, BoredSigns, will work, as well as any other developers who want to give it a shot.

Just a quick note, I can't be sure about this, but I'm fairly certain if we get this working for the V20, it will also apply to the V10, Q8, V34 (Isai Beat), X Screen (just found out that exists) and the HTC U Ultra. The U Ultra's implementation on Sense is pretty different, but the hardware configuration of a single, specially cut panel seems to be the same, even down to the resolution and relative position.
[LG V20 Guides, News, & Discussion] Exabyter:
Thanks to Zacharee1 for all his efforts so far.

In reading about similiarities to other devices with a "second screen" type of feature, it occurred to me that perhaps the effort to develop a mechanism to partition a display panel into multiple segments addressed individually could also be useful for OSS implementations of "notch management" on devices that have the increasingly popular "notched" display panel.

Just a thought.
[LG V20 Guides, News, & Discussion] Zacharee1:
I think this is already what certain OEMs like OnePlus are doing. There's a feature of Android called the LogicalDisplay, which tells the system the resolution, size and position of a certain display. I'm pretty sure OnePlus is changing the properties of the main LogicalDisplay in videos and other landscape content so that it doesn't overlap with the notched area.
[LG V20 Guides, News, & Discussion] Zacharee1:
I just found an issue for someone more knowledgeable to solve. I found out that in ROTATION_270 (top of the device to the right) and ROTATION_180 (upside-down), touches are offset by 160 pixels (the second screen height). Content is where it's supposed to be, but something's up with the touch Rect. I'm not sure if I messed up a calculation somewhere.
[LG V20 Guides, News, & Discussion] maxi65:
Thanks for the effort you've done so far :) zacharee :)
[LG V20 Guides, News, & Discussion] x86cpu:
https://github.com/x86cpu/android_frameworks_base/commits/lineage-15.1

Adjusted [MENTION=7055541]Zacharee1[/MENTION] code for 15.1, which seems to be the same result. Anyone that might understand what the problem is, contact Zacharee1 or I.
[LG V20 Guides, News, & Discussion] Sigil_Thane:
Nice!

Thank you [MENTION=2881807]x86cpu[/MENTION] and [MENTION=7055541]Zacharee1[/MENTION] for doing the hard work to make us all look so damn good with our V20s.
[LG V20 Guides, News, & Discussion] phr00t:
Can you provide a summary of the current result, what is wrong with it and suspected places in the code to look? That may save quite a bit of time for anyone trying to dive into this.
[LG V20 Guides, News, & Discussion] Zacharee1:
It's the same as 14.1. The layout is there (confirmed in Android Device Monitor), and it responds to touch, but it doesn't show except briefly when the screen image resizes (OHM or screen off animation).

There's also the touch offset thing in rotation 270 and 180.

Honestly neither of us knows where to look exactly. It might have something to do with DisplayContent or WindowState but I don't know.
[LG V20 Guides, News, & Discussion] Blaises:
I took a look at the code a bit yesterday and tested using x86cpu's repo. It seems like the window layer's position is set too high. I guess that made anything added to the window render behind it.

I moved TYPE_SIGNBOARD_NORMAL down to match the wallpaper layer and can finally get the layout to show. It seems to flicker a bit which is probably just because it's tied to the application's refresh since it doesn't flicker when touching anywhere in the main window.

I didn't have much time to poke around with everything yet, so I'll see what I can do over the next few days when I get some time.

The only other change I made was to right-align the layout this morning in your test program by setting the gravity to 5.
[LG V20 Guides, News, & Discussion] Zacharee1:
!!!!

Please submit a PR to my repo! I can continue with this!
[LG V20 Guides, News, & Discussion] Zacharee1:
Actually, PR x86's repo, since it'll be easier for you, and we can work on getting it working for Oreo instead of Nougat. I'll clone that repo once everything is merged.
[LG V20 Guides, News, & Discussion] Redline:
Holy crap! Something actually displaying on the second screen with LOS 15.1!! :D
[LG V20 Guides, News, & Discussion] x86cpu:
Anything promising I can gladly pull in. Once we have something more concrete I can figure out how to adjust to merge into Lineage for just the v20. I'm hoping the api will not need to be adjusted in the long term.
[LG V20 Guides, News, & Discussion] Zacharee1:
The current changes break touch alignment in rot_180 and rot_270, so I need to fix that before anything else is done.
[LG V20 Guides, News, & Discussion] Blaises:
Sorry for the delay, I made that post right before heading out to work. I have my changes here:

android_frameworks_base

android_packages_apps_AOSPSignBoard

I forgot to mention that there was one other change I made to the test app. There was a duplicate res/ directory I had to delete in order for it to compile.
[LG V20 Guides, News, & Discussion] TheLoonyRebel:
This is huge news. I can't wait to see second screen working on Lineage.
[LG V20 Guides, News, & Discussion] vijaysh80:
Wow wow wow wow wow.. This is huge.. Can't wait for this to be in LOS 15.1..
[LG V20 Guides, News, & Discussion] fatmaster:
I have been paying for T-mobile jump for the last year so I could move away from the V20 due to lack of support. If you guys make the 2nd screen work on Lineage, I will gladly accept the fact that I wasted my money. I keep going back to my S5 because it is the last flagship with a removable battery... maybe the V20 will take that crown.
[LG V20 Guides, News, & Discussion] phr00t:
The V20 community really appreciates the work being done here. This is our best chance at getting Oreo on our phones without sacrificing the screen real estate. I posted on reddit to share the good news: https://www.reddit.com/r/lgv20/comments/8ud5qj/major_progress_on_open_source_second_screen_api/
[LG V20 Guides, News, & Discussion] Vicky5790:
Me to
[LG V20 Guides, News, & Discussion] Lebatman:
Awesome! Please make this happen... :)

on my H990ds. :(
[LG V20 Guides, News, & Discussion] :
It'll happen for all of our V20s when the time comes. For now, all we can do is be patient.
[LG V20 Guides, News, & Discussion] Zacharee1:
Alright. Here's the current state on things. I'm now working with LOS 15.1, so check the lineage-15.1-signboa (I hit enter too soon) branch on my repo for the new code.

The trick to get the second screen window to show doesn't really work very well. It does make the window visible, but only until the screen content updates. I think it's the same problem as it not showing at all; I just need to figure out what's going on.

I did manage to fix the touch alignment issue, however. That involved modifying some native code, which meant I couldn't decompile some LG APK and follow the source. In other words, I got lucky finding where I needed to change stuff. Unfortunately, I think the showing issue is also in some native class somewhere, but I have no idea where to look.
[LG V20 Guides, News, & Discussion] phr00t:
Thank you for the update. I assume when you say "until the screen content updates", you are referring to the main screen -- not the second screen? As in, the main screen updates & erases the second screen contents? Is the main screen overlapping with the second screen, so main screen updates overwrites the second screen? Is it possible to invoke a second screen content update immediately after a main screen content update, so users don't see the erase? I'm just brainstorming, hoping to spark an idea in someone who knows better!

---------- Post added at 04:43 PM ---------- Previous post was at 04:38 PM ----------

Here is a link to the github repository for all: https://github.com/zacharee/android_frameworks_base/tree/lineage-15.1-signboa
[LG V20 Guides, News, & Discussion] Zacharee1:
I don't really know what's going on, and I'd rather find a proper fix instead of relying on a hack. The problems I can think of with updating are first, I don't know how to detect that properly, and second, it would flicker like crazy.

You're right about the updating part though. That's what happens.

Strangely, it shows fine on Ambient Display, which means there's something specific to the screen being on that blocks it from displaying.

Side note, I fixed the rotation weirdness, so that won't be a problem once this is working.
[LG V20 Guides, News, & Discussion] Grillac:
You may want to check out the code that disabled the second screen in the first place. iirc the content used to display all the way up to the top of the second screen. It could be the way that it was implemented is somehow interfering with enabling the second screen. That code may hold some answers or insights to how it's working.

Also, thanks so much for taking this up. I'm super excited to see the second screen is working at least somewhat. Keep up the good work!
[LG V20 Guides, News, & Discussion] Zacharee1:
No, that's just a kernel flag. Whoever originally made the AOSP kernel for the V20 merged LG's source.
[LG V20 Guides, News, & Discussion] Grillac:
Ah okay. If there's any way to attach the second screen's class to the main screen's class, that could potentially do it. If it's part of the same whole, it should render whenever the parent renders, right? I'm just spitballing ideas here. Also, are you sure that when the screen is one and the content updates, the second screen isn't getting it's content put outside of the boundaries of the physical screen?
[LG V20 Guides, News, & Discussion] Blaises:
I think the solution is more simple than we're making it out to be. We adjusted the displayRect properties in the LogicalDisplay class, but we never changed the LayerStackRect.

This change completely solves the display issue.

Although it now causes the touch offset issue in all rotations. That can be solved by setting a touch offset, but I think there may be more we don't understand about how those two rects are used and the answer might be in adjusting those more.

There's no documentation on any of this except for a comment in the setProjectionInTransactionLocked method that doesn't explain how those rects are used thoughout the framework.

I'll have a little more time tonight to poke around with that. I have a hunch that it's going to be something simple we're overlooking.
[LG V20 Guides, News, & Discussion] Zacharee1:
I can work with this I think. That's a huge weakness of AOSP: its almost complete lack of docs.
[LG V20 Guides, News, & Discussion] Zacharee1:
Alright, I'm implementing this right now into my updated code. We'll see how it works out, and if it's misaligned, I can always change the offsets in DisplayViewport.java and DisplayViewport.cpp.
[LG V20 Guides, News, & Discussion] Blaises:
I just made another commit, I had forgotten to do the same adjustment for the 180 and 270 rotations.

I've also updated the signboard app just to test dynamically updating the layout.
[LG V20 Guides, News, & Discussion] Zacharee1:
I noticed that lol. I changed them myself.

I did notice something strange in rot90: the second screen view seems partially off the physical right on the display. I guess the mSecondScreenFrame Rect[] in PhoneWindowManager needs adjustment?

Also, could you PR the changes you made to AOSPSignBoard to my repo? https://github.com/zacharee/android_packages_apps_AOSPSignBoard

I could give you write access if you want, so you can push directly to it.

Once the display stuff is definitively working, I'll get to work on actually building in some functionality to the app.
[LG V20 Guides, News, & Discussion] Zacharee1:
I'm not sure if you made some change that you didn't commit, but I can't see the window in rot270 or rot180.
[LG V20 Guides, News, & Discussion] phr00t:
Put me down for $20 into the bounty. Excited on the progress & looking forward to paying you guys for your hard work.

---------- Post added at 10:43 PM ---------- Previous post was at 09:44 PM ----------

@Zacharee1 & [MENTION=1852121]Blaises[/MENTION] -- I highly recommend you guys work on the same repo, so you don't run into code synchronization problems (like perhaps what Zacharee1 is seeing, or better yet, not seeing with rot270 & rot180). Blaises, let Zacharee1 give you write access? Do you have a github account?
[LG V20 Guides, News, & Discussion] Blaises:
I didn't have a github account, but I also didn't think I'd get this deep into v20 development.

I just created an account and uploaded my repos:

https://github.com/Ahrotahn/android_frameworks_base

https://github.com/Ahrotahn/android_packages_apps_AOSPSignBoard

I don't have the issues you described, so I guess it's good I set this up so we can keep things in sync.

I'll send a PR soon.

I just added the touch offset in DisplayViewport like you suggested and it works great!

Edit:

Let me know if that works for you. Everything seems to work fine on my end now.

The animations are still a little weird and we'll need to figure out the best way to handle the backlight, but we're in position to start doing more tests with the signboard app now.
[LG V20 Guides, News, & Discussion] Zacharee1:
So you didn't touch any of the native code, like in PointerController.cpp? Maybe I should remove that from mine....
[LG V20 Guides, News, & Discussion] Zacharee1:
Well I removed the changes in PointerController and copied what you did in DisplayViewport and touches seem to be aligned!

The SignBoard also does show fine in rot0, but it's still wonky in rot90 and just gone in the other two. I'm rebuilding AOSPSignBoard just by itself instead of a full brunch, in case brunch missed it for some reason.
[LG V20 Guides, News, & Discussion] vijaysh80:
I'm no developer and most of what you guys are talking is way beyond my bandwidth. :p :p But in layman's terms, is this an issue with screen coordinates? I mean, does the second screen disappear when the phone is rotated because the screen coordinates change with each rotated angle?
[LG V20 Guides, News, & Discussion] Zacharee1:
Every window (ie apps, System UI, SignBoard) in Android needs a frame, which is represented by a Rect object. A Rect has four integer variables in it: left, top, right, bottom. In this case, left and right represent the left and right boundaries of the window in X coordinates of the screen. top and bottom represent the top and bottom boundaries as Y coords.

For the SignBoard, this frame needs to be adjusted so that one of the coordinates is negative, since the SignBoard is technically "offscreen." So yeah, it's to do with the rotation. I also messed something up with the frames for the SignBoard before this was all working, so I need to revert that.
[LG V20 Guides, News, & Discussion] Zacharee1:
[MENTION=1852121]Blaises[/MENTION] do you have a Telegram account? I feel it might be easier to coordinate if we had some quicker way to talk, and we (well, I) wouldn't confuse people here with random ramblings.
[LG V20 Guides, News, & Discussion] vijaysh80:
Awesome.. Thanx for the explanation..
[LG V20 Guides, News, & Discussion] Zacharee1:
So now that stuff is mostly working, I'm actually properly importing all the AOSP stuff into Android Studio so I have proper indexing and code completion and such.

I'm doing this over sshfs, so it's gonna take a while, which means this is a good time to sleep.
[LG V20 Guides, News, & Discussion] cooldan613:
Cool beans, keep up the great work and can't wait to see the end result.
[LG V20 Guides, News, & Discussion] Blaises:
Did reverting the changes to mSecondScreenFrame and the other native stuff fix that for you? I didn't make any of those changes.

I use matrix, they have different clients you can use depending on how you want to use it. I recommend riot.im if you want it in browser or nheko if you want a desktop client.
[LG V20 Guides, News, & Discussion] Zacharee1:
Reverting worked, but I still need to play around with the frame.
[LG V20 Guides, News, & Discussion] fofo00o:
https://xdaforums.com/u-ultra/how-to/htc-ultra-screen-t3811043

htc u ultra full screen

its ok for watching movies
[LG V20 Guides, News, & Discussion] Zacharee1:
This is what happens by default unless you disable the SignBoard area.
[LG V20 Guides, News, & Discussion] Zacharee1:
So I have a bit of a weird situation. The build server is currently down, and won't be back up until mid-Monday EDT. I also won't have my V20 for a while, but a borrowed one.

I'll probably still be able to develop, but I'll have to get situated. Once I get everything together, and the server is back up and running, I'll be able to start development again.

I think really the only bugs right now are the mal-adjusted SignBoard frame and the boot animation being off center. Both of these should be pretty easy to fix with a bit of fiddling.

Once that's done, I'll be able to get to work on actual functionality for the app. I don't really plan on integrating this with the Settings app at all (although it could happen). Instead, I think I want to keep it mostly self-contained, so it's as modular as possible. The AOD and screen-on states won't be separate like they are with LG, either.
[LG V20 Guides, News, & Discussion] phr00t:
I'm fine with it not integrating with the Settings app. Anything frivolous that may delay a functioning second screen I'd recommend against, at least for the first release.

Now that you have a (hopefully short) moment of development downtime... how do you foresee this working for us end-users? Will we need a specific "second screen enabled" Lineage 15.1 build, or will we just need your SignBoard APK/app with a normal Lineage 15.1 build? Both a special Lineage 15.1 build & app?
[LG V20 Guides, News, & Discussion] Zacharee1:
This involves framework changes and the use of signature-level permissions, so it's both. The ROM will need to include my changes AND the app prebuilt with the ROM. But that's not really an issue. The plan here is to get this integrated into LOS 15.1 once that's official, and since I have my stuff open source, if someone builds RR or some other AOSP-based ROM for the V20 (or V10, V34, Q8, U Ultra), they can simply cherry-pick my commits from GitHub and build like that.

I'm not that familiar with how overlays and vendor-specific stuff works with LineageOS, but this might be straight-up integrated into LineageOS' source in a sense, so any LOS fork that keeps its code up to date will have it by default. Again, though, I don't know if this is actually how things work. I'm an app dev and Stock modder, so all of this AOSP stuff is pretty new to me.