Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generate metadata for protected interfaces #236

Closed
atanasovg opened this issue Oct 1, 2015 · 4 comments
Closed

Generate metadata for protected interfaces #236

atanasovg opened this issue Oct 1, 2015 · 4 comments

Comments

@atanasovg
Copy link
Contributor

The following constant:

android.provider.ContactsContract.SyncColumns.ACCOUNT_TYPE

has no metadata generated for it because the declaring interface is protected. We should enable this scenario and process protected interface in our metadata-generator tool.

Additionally, the better approach would be to attach all such constants to the implementing type directly, much like this is done in Android. Otherwise code that is available in the internet will not work with our Runtime and we will have to explain this explicitly.

@slavchev
Copy link

Only the first part of issue is resolved. Currently you can access static members on protected interfaces as follows

android.provider.ContactsContract.SyncColumns.ACCOUNT_TYPE

but the functionality to access interface members on the types that implement the interface is not ready yet.

@Plamen5kov Plamen5kov modified the milestones: 1.6.0 (Under review), 1.5.0 Jan 5, 2016
@NathanaelA

This comment was marked as abuse.

@slavchev
Copy link

@NathanaelA

The fix for this issue is in the master branch and will be shipped with 1.6 release. Initially I marked the issue as Ready For Test and later I added In Progress tag because there is more work to do, because Java has this kind of cool feature to access static interface members through a class definition if the class implements the interface. Here is an example

protected interface Interface1 {
    static int FLAG = 123;
}
public class Class1 implements Interface1 {
}
int flag = Class1.FLAG;

This is yet to be implemented.

@Plamen5kov
Copy link
Contributor

functionality to access interface members on the types that implement the interface is enabled with:
NativeScript/android-metadata-generator#19

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants