Skip to content

System.Net.NetworkInformation needs Android PAL #51303

Closed

Description

@marek-safar

Currently, System.Net.NetworkInformation implementation on Android falls back to Linux PAL. This needs to change because starting from API 24 Android restricts access to many files in the /sys filesystem which makes the API unsupported.

Right now the APIs fail with System.UnauthorizedAccessException. We need to write an Android-specific PAL layer that uses Java APIs via JNI to access the information to not break developers migrating from existing Mono based BCL.

/cc @steveisok

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Apr 15, 2021
  2. added and removed
    untriagedNew issue has not been triaged by the area owner
    on Apr 15, 2021
  3. added this to the 6.0.0 milestone on Apr 15, 2021
  4. filipnavara commented on Apr 15, 2021

    @filipnavara
    Member

    For reference, the Xamarin.Android implementation of the code resides here. Mono used to call it through several indirections.

  5. wfurt commented on Apr 20, 2021

    @wfurt
    Member

    It would be good to get list of failing methods & properties @marek-safar. I made changes in the past to linked GetAllNetworkInterfaces() do depend less on /proc & /sys. It certainly feels better to throw PNSP or have alternative implementation than getting access violation. I would be curious to see how big that difference is.

  6. marek-safar commented on Apr 21, 2021

    @marek-safar
    ContributorAuthor
  7. wfurt commented on Apr 21, 2021

    @wfurt
    Member

    That list does not give the list of files @marek-safar. But it seems to be mostly stats.

  8. marek-safar commented on Apr 22, 2021

    @marek-safar
    ContributorAuthor

    @wfurt perhaps I misunderstood the ask, what are you looking for exactly?

  9. wfurt commented on Apr 22, 2021

    @wfurt
    Member

    That is ok. I was primarily wondering how much code we will need to replace. Number of test is somewhat approximation. If there are only few functions we may simply add alternatives instead of doing whole new pal. there is already some precedent for that.

  10. self-assigned this
    on Jul 21, 2021
  11. modified the milestones: 6.0.0, 7.0.0 on Aug 27, 2021
  12. modified the milestones: 7.0.0, 6.0.MAUI on Dec 14, 2021
  13. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jan 11, 2022
  14. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jan 13, 2022
  15. ghost locked as resolved and limited conversation to collaborators on Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions