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

Modernize deprecated getConnectionInfo() in WifiInfo #802

Closed
HollowMan6 opened this issue Jul 4, 2023 · 1 comment · Fixed by #883
Closed

Modernize deprecated getConnectionInfo() in WifiInfo #802

HollowMan6 opened this issue Jul 4, 2023 · 1 comment · Fixed by #883
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers

Comments

@HollowMan6
Copy link
Collaborator

HollowMan6 commented Jul 4, 2023

WifiInfo.getConnectionInfo() was deprecated in API level 31. Starting with Build.VERSION_CODES#S, WifiInfo retrieval is moved to ConnectivityManager API surface. WifiInfo is attached in NetworkCapabilities#getTransportInfo() which is available via callback in NetworkCallback#onCapabilitiesChanged(Network, NetworkCapabilities) or on-demand from ConnectivityManager#getNetworkCapabilities(Network).

Location

https://github.com/Igalia/wolvic/pull/787/files#r1251794757

Possible Solution

As suggested in:

@svillar svillar added good first issue Good for newcomers dependencies Pull requests that update a dependency file labels Jul 4, 2023
@HollowMan6
Copy link
Collaborator Author

WifiInfo.calculateSignalLevel(int, int) was replaced in 2a63e28

It may not be a good time to replace WifiInfo.getConnectionInfo() since we need to use callback for that. If we use the synced getNetworkCapabilities (Network network), it will remove any location sensitive data in the returned NetworkCapabilities (the SSID). Some TransportInfo instances like WifiInfo contain location sensitive information. To retrieve this location sensitive information (subject to the caller's location permissions), use a NetworkCallback with the NetworkCallback#FLAG_INCLUDE_LOCATION_INFO flag instead. This method returns null if the network is unknown or if the |network| argument is null.

@HollowMan6 HollowMan6 changed the title Modernize deprecated getConnectionInfo() and calculateSignalLevel(int, int) in WifiInfo Modernize deprecated getConnectionInfo() in WifiInfo Jul 15, 2023
HollowMan6 added a commit that referenced this issue Jul 20, 2023
Partially fixes #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
HollowMan6 added a commit that referenced this issue Jul 20, 2023
Partially fixes #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
HollowMan6 added a commit that referenced this issue Jul 21, 2023
Partially fixes #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
@HollowMan6 HollowMan6 reopened this Jul 21, 2023
svillar pushed a commit that referenced this issue Jul 25, 2023
Partially fixes #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
@HollowMan6 HollowMan6 added priority-low and removed good first issue Good for newcomers labels Jul 25, 2023
HollowMan6 added a commit that referenced this issue Aug 3, 2023
WifiInfo.getConnectionInfo() was deprecated in API level 31.
Starting with Build.VERSION_CODES#S, WifiInfo retrieval is moved
to ConnectivityManager API surface. WifiInfo is attached in
NetworkCapabilities#getTransportInfo() which is available via callback in
NetworkCallback#onCapabilitiesChanged(Network, NetworkCapabilities)
or on-demand from ConnectivityManager#getNetworkCapabilities(Network).

Refer to https://stackoverflow.com/a/73504558

Resolves #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
@HollowMan6 HollowMan6 added good first issue Good for newcomers and removed priority-low labels Aug 3, 2023
felipeerias pushed a commit that referenced this issue Aug 4, 2023
Partially fixes #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
felipeerias pushed a commit that referenced this issue Aug 4, 2023
Partially fixes #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
felipeerias pushed a commit that referenced this issue Aug 4, 2023
Partially fixes #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
HollowMan6 added a commit that referenced this issue Aug 4, 2023
WifiInfo.getConnectionInfo() was deprecated in API level 31.
Starting with Build.VERSION_CODES#S, WifiInfo retrieval is moved
to ConnectivityManager API surface. WifiInfo is attached in
NetworkCapabilities#getTransportInfo() which is available via callback in
NetworkCallback#onCapabilitiesChanged(Network, NetworkCapabilities)
or on-demand from ConnectivityManager#getNetworkCapabilities(Network).

Refer to https://stackoverflow.com/a/73504558

Resolves #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
HollowMan6 added a commit that referenced this issue Aug 7, 2023
WifiInfo.getConnectionInfo() was deprecated in API level 31.
Starting with Build.VERSION_CODES#S, WifiInfo retrieval is moved
to ConnectivityManager API surface. WifiInfo is attached in
NetworkCapabilities#getTransportInfo() which is available via callback in
NetworkCallback#onCapabilitiesChanged(Network, NetworkCapabilities)
or on-demand from ConnectivityManager#getNetworkCapabilities(Network).

Refer to https://stackoverflow.com/a/73504558

Resolves #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
HollowMan6 added a commit that referenced this issue Aug 14, 2023
WifiInfo.getConnectionInfo() was deprecated in API level 31.
Starting with Build.VERSION_CODES#S, WifiInfo retrieval is moved
to ConnectivityManager API surface. WifiInfo is attached in
NetworkCapabilities#getTransportInfo() which is available via callback in
NetworkCallback#onCapabilitiesChanged(Network, NetworkCapabilities)
or on-demand from ConnectivityManager#getNetworkCapabilities(Network).

Refer to https://stackoverflow.com/a/73504558

Resolves #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
svillar pushed a commit that referenced this issue Aug 14, 2023
WifiInfo.getConnectionInfo() was deprecated in API level 31.
Starting with Build.VERSION_CODES#S, WifiInfo retrieval is moved
to ConnectivityManager API surface. WifiInfo is attached in
NetworkCapabilities#getTransportInfo() which is available via callback in
NetworkCallback#onCapabilitiesChanged(Network, NetworkCapabilities)
or on-demand from ConnectivityManager#getNetworkCapabilities(Network).

Refer to https://stackoverflow.com/a/73504558

Resolves #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
felipeerias pushed a commit that referenced this issue Aug 25, 2023
Partially fixes #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
felipeerias pushed a commit that referenced this issue Aug 25, 2023
WifiInfo.getConnectionInfo() was deprecated in API level 31.
Starting with Build.VERSION_CODES#S, WifiInfo retrieval is moved
to ConnectivityManager API surface. WifiInfo is attached in
NetworkCapabilities#getTransportInfo() which is available via callback in
NetworkCallback#onCapabilitiesChanged(Network, NetworkCapabilities)
or on-demand from ConnectivityManager#getNetworkCapabilities(Network).

Refer to https://stackoverflow.com/a/73504558

Resolves #802

Signed-off-by: Songlin Jiang <sjiang@igalia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants