Skip to content
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

feat(android/backend): track network changes #211

Merged
merged 6 commits into from
Nov 20, 2023
Merged

Conversation

abhaysood
Copy link
Contributor

@abhaysood abhaysood commented Nov 16, 2023

  • Introduce SystemServiceProvider to abstract access to system services.
  • Add network_type, network_provider and network_generation in Resource.
  • Introduce new event network_change event - tracks vpn, cellular, wifi and no internet.
  • Track network_type, network_provider and network_generation for ANRs and Exceptions.

Android SDK Version Compatibility

Network Change Event

  • API 21-22: not tracked
  • API 23-32: tracked if READ_PHONE_STATE (runtime permission) is granted.
  • API 33 and above: tracked if READ_BASIC_PHONE_STATE is granted. READ_PHONE_STATE also continues to work.

Resource, Exception and ANRs

  • network_type: tracked for all SDK versions (tested for 21-33)
  • network_generation & network_provider:
    • API 21-32: tracked if READ_PHONE_STATE (runtime permission) is granted.
    • API 33 and above: tracked if READ_BASIC_PHONE_STATE is granted. READ_PHONE_STATE also continues to work.

New Events

Event name: network_change

key value type required comments
network_type Number true One of: wifi, cellular, vpn, unknown, no_network.
previous_network_type Number false One of:wifi, cellular, vpn, unknown, no_network.
network_generation String false One of: 2g, 3g, 4g, 5g. Set only for cellular network_type.
previous_network_generation String false One of: 2g, 3g, 4g, 5g. Set only for cellular network_type.
network_provider String false Example: Airtel, T-Mobile, etc. Set only for cellular network_type.

Updated Events

Event name: exception & anr

🟢 New fields added

key value type required comments
network_type String false One of: wifi, cellular, vpn, unknown, no_network.
network_generation String false One of: 2g, 3g, 4g, 5g. Set only for cellular network_type.
network_provider String false Airtel, T-Mobile, etc.Set only for cellular network_type.

Updated Resource

🟢 New fields added

key value type required comments
network_type String false One of: wifi, cellular, vpn, unknown, no_network.
network_generation String false One of: 2g, 3g, 4g, 5g. Set only for cellular network_type.
network_provider String false Airtel, T-Mobile, etc.Set only for cellular network_type.

Todo

  • Implement changes in golang server and clickhouse

partially implements #200

Copy link

vercel bot commented Nov 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
measure ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2023 1:53pm

@abhaysood abhaysood force-pushed the track-connection-data branch from 853a084 to 9d4f03f Compare November 16, 2023 08:29
@abhaysood abhaysood changed the title feat(android): track connectivity changes feat(android): track network changes Nov 16, 2023
@abhaysood abhaysood self-assigned this Nov 16, 2023
@abhaysood abhaysood changed the title feat(android): track network changes feat(android/backend): track network changes Nov 16, 2023
@abhaysood abhaysood force-pushed the track-connection-data branch from 387bab8 to d170129 Compare November 17, 2023 10:39
* Introduce SystemServiceProvider to abstract access to system services.
* Add network_type, network_provider and network_generation in Resource.
* Introduce new event network_change event - tracks vpn, cellular, wifi and no internet.
* Track network_type, network_provider and network_generation for ANRs and Exceptions.
@abhaysood abhaysood force-pushed the track-connection-data branch from d170129 to 943c927 Compare November 20, 2023 11:30
@abhaysood abhaysood force-pushed the track-connection-data branch from 0228891 to 6b0b96f Compare November 20, 2023 12:01
@abhaysood abhaysood requested a review from detj November 20, 2023 12:30
@abhaysood abhaysood merged commit 9cd2ce0 into main Nov 20, 2023
9 checks passed
@abhaysood abhaysood deleted the track-connection-data branch November 20, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants