fix: connectivity service#16232
Conversation
deba220 to
c424058
Compare
0261ff4 to
f2a1b3a
Compare
5b5560b to
291868d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
4f091ab to
7b9830e
Compare
7d56e29 to
4d47cb8
Compare
|
@TheCrowned Hello. Thank you for the feedback. I updated the PR. Could you please check via latest APK file once its generated? |
2181611 to
1fb36f6
Compare
…vice.java Co-authored-by: Tom <70907959+ZetaTom@users.noreply.github.com> Signed-off-by: Alper Öztürk <67455295+alperozturk96@users.noreply.github.com>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alper Öztürk <67455295+alperozturk96@users.noreply.github.com>
7fa9c9e to
78d6555
Compare
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
|
APK file: https://github.com/nextcloud/android/actions/runs/27671569257/artifacts/7688293038 |
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
|
APK file: https://github.com/nextcloud/android/actions/runs/27672039480/artifacts/7688457471 |
|
blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed. |
| val baseServerAddress = accountManager.user.server.uri.toString() | ||
| if (baseServerAddress.isEmpty()) { | ||
| Log_OC.e(TAG, "no base server address, internet is walled") | ||
| return true |
There was a problem hiding this comment.
Shall we cache if base server address empty and rely on result of current connectivity connected or just assume as walled?
Old behaviour: relies on current connectivity connected and caches
There was a problem hiding this comment.
if base address is empty -> return c.isConnected()
no caching
| val resolvedCapabilities = resolveNetworkCapabilities() | ||
| if (resolvedCapabilities == null || !isSupportedTransport(resolvedCapabilities)) { | ||
| Log_OC.e(TAG, "no usable network transport at check time, treating as walled") | ||
| return true |
There was a problem hiding this comment.
Old: if connectivity is null set as walled cache false basically treat as connected.
New: not caches since less than 10 mins device's connectivity can change and we should not cache it.
Fixes: #14681
Deduplicates
isNetworkAndServerAvailablelogicImplements
ConnectivityManager.NetworkCallbackfor better network state listeningRemoves deprecated logics
Adds better documentation
Adds exception handling for http call to prevent temporary issues thus we don't inform user with incorrect availability state
Uses for metered detection
NET_CAPABILITY_NOT_METEREDinstead ofNET_CAPABILITY_NOT_RESTRICTEDRemoves network change receiver uses listener for much better reaction to network change
Converts to Kotlin
Stores current connectivity per account since current connectivity change via account thus we should not treat new account as disconnected. Current connectivity is used for detect wifi enabled or not, server available, metered etc.
Adds smart current connectivity checker, compares previous and new one and only updates if necessary.