New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Accepted with Revisions] SDL 0243 - Manager Update for DisplayCapability #797
Comments
Happy to see this proposal come through. It seems well-designed and thought-out. 1. I'm not especially familiar with the Android SCM, but I'm not sure that this is quite correct:
I must be missing it, but I don't see where the "visa versa" is described. I assume, however, that it's for if developers pull the deprecated 2. In addition to |
Thank you @joeljfischer. I really tried to assess the affected classes and effort but also provide at least some prototype grade code to quickly implement, all in a short amount of time. Therefore again please apologize if things look sort of incomplete or of a low quality in writing. I hope the overall concept is described well enough still. |1 The Old>New conversion is clear so far I guess. The New>Old conversion is described only as some code in the bottom of the section Convert from DisplayCapabilities to DisplayCapability and vice versa method. I will copy the code from the proposal into this comment for easy reading (with the risk of a large comment...). How to convert New to Old?private DisplayCapabilities createDisplayCapabilities(String displayName, WindowCapability defaultMainWindow) {
DisplayCapabilities convertedCapabilities = new DisplayCapabilities();
convertedCapabilities.setDisplayType(DisplayType.SDL_GENERIC); //deprecated but it is mandatory...
convertedCapabilities.setDisplayName(displayName);
convertedCapabilities.setTextFields(defaultMainWindow.getTextFields());
convertedCapabilities.setImageFields(defaultMainWindow.getImageFields());
convertedCapabilities.setTemplatesAvailable(defaultMainWindow.getTemplatesAvailable());
convertedCapabilities.setNumCustomPresetsAvailable(defaultMainWindow.getNumCustomPresetsAvailable());
convertedCapabilities.setMediaClockFormats(Collections.singletonList(MediaClockFormats.CLOCK3)); // mandatory field...
convertedCapabilities.setGraphicSupported(defaultMainWindow.getImageTypeSupported().contains(ImageType.DYNAMIC));
return convertedCapabilities; This method creates an old When is this method used?Whenever the library receives a system capability RPC with type setCapability(SystemCapabilityType.DISPLAYS, Collections.singletonList(newDefaultDisplayCapabilities));
WindowCapability defaultMainWindowCapabilities = newDefaultDisplayCapabilities.getWindowCapabilities(PredefinedWindows.DEFAULT_WINDOW); // assume the function exist returning window capability of a specified window, PS: manager method getWindowCapability could be used instead
// cover the deprecated capabilities for backward compatibility
setCapability(SystemCapability.DISPLAY, createDisplayCapabilities(newDefaultDisplayCapabilities.getDisplayName(), defaultMainWindowCapabilities));
setCapability(SystemCapability.BUTTON, defaultMainWindowCapabilities.getButtonCapabilities());
setCapability(SystemCapability.SOFTBUTTON, defaultMainWindowCapabilities.getSoftButtonCapabilities());
} This will ensure Why this effort?The deprecated params ( |2 Agree. The predefined window name is |
Overall I think everything looks good with the proposal. I only have a few minor items. 3.
If we can't add values to that enum then it will not be possible get those capabilities outside the So maybe something like The other option would be adding the other values to the enum, extending the 4.
So to avoid any confusion/assumptions being made, this proposal does intend to have the screen manager and supporting managers, (SoftButtonManager for example), updated to use the new And it does NOT include changes to support multiple windows to the manager layer yet, which would have to be a later proposal, right? |
|3 I believe SDL-0079 is causing more trouble than it solves. The generic getter requires to change an enum which is specified somewhere else. The iOS SCM does not have this problem. It simply provides getters per capability type and it has the benefit of types avoiding any cast operation and issues during runtime. We should not continue to manipulate the mobile API types without changing the mobile API. I think this will be a critical issue implementing the proposal SDL-0234 Proxy Library RPC Generation. May be we should re-think how the SCM should work and improve this manager ... |4 This is true. This proposal only includes SCM update and existing ScreenManager update. This is due to the need of this crucial change before releasing Core 6.0. It does not include manager APIs to create widgets. You could use the RPCs (CreateWindow, DeleteWindow, Show) manually but it's very inconvenient for developers. Not saying I haven't planned to propose a manager update for widgets. Here's my idea in hope it's a good kick-off to think about:
As of right now It'll be out of scope of this proposal. We can discuss widget screen managers separately or in this issue/proposal. I want to note that adding this additional feature can cause a much longer delay to the mobile releases. The risk is that nothing of this proposal will be released in the libraries together with Core 6.0. |
3.
I believe this is the first issue we've had.
The iOS SCM should have actually followed the proposal or created an alternate proposal as it created a public API that differed from the proposal that introduced the manager.
I think we both know that we have different opinions on the generic getters and likely are not going to reach a middle ground. I prefer the generic getters as it is a common pattern in Android as Java can be a very verbose language. I'm a proponent of creating features with less lines of code. I would also like to note that creating internal enums and RPCs was not introduced with with SDL-0079, there was already precedence in the Android SDL library for doing so. However, this is not a hill I'm willing to die on. If the author can provide an alternative solution I will be open to it. The issue with not allowing the enum to be expanded internally is that it then hinders the public API for the Android SCM as using that expanded enum is the only way to access the capabilities through the manager. Therefore either the statement should be changed to not limit the existing API (which the author has expressed their dissent), or an alternative solution be provided. I believe the author could use the iOS SCM as a basis to provide the solution so that the managers would have matching public APIs and preventing the imposed limitations from breaking the current public API's future usage. 4. Sounds good. I just wanted to make sure everyone was on the same page. While I would really like for the screen manager to be updated to provide a more intuitive API for the widgets feature, I understand that this proposal does not include those changes, and there will have to be another proposal to discuss them. |
1. Thanks for the rundown of the why. That clears it up for me. 2. It would probably be a property? I'm not sure I like the 3. Another alternate solution would be to create a new With that said, I'm okay with it staying as is, because those are unlikely to expand outside of MOBILE_API changes. The 4. I have a few nitpicks with the plan laid out there (because when do I not) but overall it seems about right. I agree that it would be nice to have this in the next release, but understand that that is not going to be possible due to resources. |
The Steering Committee voted to defer this proposal, keeping it in review until our next meeting on 2019-08-20, to allow the author time to respond to the comments from the Project Maintainer. |
|
Thanks, @kshala-ford glad to see details for how the |
Hello @bilal-alsharifi. It's a very good point. You are right and I would rate this as a bug if the libraries would behave the way you described. I would consider this being a task to implement in smartdevicelink/sdl_ios#1350 and smartdevicelink/sdl_java_suite#1122 so that this issue is resolved from the beginning. The implementation for the ScreenManager should be to add early return in OnHMIStatus listener whenever windowID is not omitted and it's not set to 0 ( |
Thanks, @kshala-ford . That sounds good to me as well. We can include that in the widgets implementation PRs to ensure that |
The Steering Committee voted to accept this proposal with the following revisions:
|
@kshala-ford please advise when a new PR has been entered to update the proposal to reflect the agreed upon revision. I'll then merge the PR so the proposal is up to date, and submit issues in the respective repositories for implementation. Thanks! |
Proposal has been updated to reflect agreed upon revisions, and implementation issues have been entered: |
Hello SDL community,
The review of "SDL 0243 - Manager Update for DisplayCapability" begins now and runs through August 6, 2019. The proposal is available here:
https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0243-manager-update-display-capability.md
Reviews are an important part of the SDL evolution process. All reviews should be sent to the associated Github issue at:
#797
What goes into a review?
The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of SDL. When writing your review, here are some questions you might want to answer in your review:
Please state explicitly whether you believe that the proposal should be accepted into SDL.
More information about the SDL evolution process is available at
https://github.com/smartdevicelink/sdl_evolution/blob/master/process.md
Thank you,
Theresa Lech
Program Manager - Livio
theresa@livio.io
The text was updated successfully, but these errors were encountered: