Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2900 +/- ##
=========================================
Coverage 62.52% 62.52%
Complexity 1203 1203
=========================================
Files 267 267
Lines 6357 6357
Branches 881 881
=========================================
Hits 3975 3975
Misses 1831 1831
Partials 551 551 |
gino-m
left a comment
There was a problem hiding this comment.
Did a first pass, @shobhitagarwal1612 PTAL as well?
ground/src/main/java/com/google/android/ground/system/GoogleApiManager.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/system/GoogleApiManager.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/ui/startup/StartupFragment.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/system/GoogleApiManager.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/system/GoogleApiManager.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/ui/startup/StartupFragment.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/ui/startup/StartupFragment.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/ui/startup/StartupFragment.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/ui/startup/StartupFragment.kt
Outdated
Show resolved
Hide resolved
…lay-service' into anandwana001/2783/handle-googleplay-service
ground/src/main/java/com/google/android/ground/system/GoogleApiManager.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/system/GoogleApiManager.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/ui/startup/StartupViewModel.kt
Outdated
Show resolved
Hide resolved
| } catch (e: Exception) { | ||
| Timber.e( | ||
| e, | ||
| "Failed to handle activity result for requestCode: $requestCode. Exception details: ${e.message}", |
There was a problem hiding this comment.
The message and stack trace are already logged by Timber.e, no need to add it to the message as well.
| * possible or cancelled. | ||
| */ | ||
| suspend fun installGooglePlayServices() { | ||
| suspend fun installGooglePlayServices(): Boolean { |
There was a problem hiding this comment.
Adding a Boolean return value means the caller needs to address both return value and thrown exceptions as failure states. Since we need to catch exceptions anyway, why not rely on those for error states?
|
|
||
| private fun startResolution(status: Int, requestCode: Int, throwable: Throwable) { | ||
| if (!googleApiAvailability.isUserResolvableError(status)) throw throwable | ||
| private suspend fun startResolution(status: Int, requestCode: Int): Boolean { |
| suspend fun initializeLogin() { | ||
| googleApiManager.installGooglePlayServices() | ||
| val isGooglePlayServicesAvailable = googleApiManager.installGooglePlayServices() | ||
| if (!isGooglePlayServicesAvailable) { |
There was a problem hiding this comment.
Same comment here. This entire condition goes away if installGooglePlayServices throws an exception.
# Conflicts: # ground/src/main/java/com/google/android/ground/system/GoogleApiManager.kt # ground/src/main/java/com/google/android/ground/ui/startup/StartupFragment.kt
|
Closing as it is fixed at #2924 |
Fixes #2783
@shobhitagarwal1612 @gino-m PTAL?