-
-
Notifications
You must be signed in to change notification settings - Fork 45
Fix location capture in Airplane mode #2974
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
Conversation
📝 WalkthroughWalkthroughThis update introduces three primary changes. First, it adds a new localization string ( Sequence Diagram(s)sequenceDiagram
participant Activity as FormEntryActivity
participant System as Android System
participant UI as User Interface
System->>Activity: onActivityResult(requestCode, resultCode)
Activity->>Activity: Check if requestCode == LOCATION_CAPTURE
Activity->>Activity: Check if resultCode == RESULT_CANCELED
Activity->>UI: Display toast "Location capture cancelled"
sequenceDiagram
participant Caller as Application
participant Factory as CommCareLocationControllerFactory
participant Settings as Device Settings
participant Service as Google Play Services
Caller->>Factory: getLocationController(context)
Factory->>Settings: isAirplaneModeOn(context)
Settings-->>Factory: Return airplane mode status
alt Airplane mode is ON
Factory->>Caller: Return CommCareProviderLocationController
else Airplane mode is OFF
Factory->>Service: Check for Google Play Services availability
Service-->>Factory: Return availability status
Factory->>Caller: Return appropriate LocationController based on status
end
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Product Description
This PR addresses an issue with the GPS widget when the device is in Airplane Mode. Upon pressing the
Record Locationbutton, the screen flashes and the user returns to the previous screen.location_capture_issue.mp4
There is an exception being thrown and here's the stack trace:
According to the documentation, this error occurs when
Location settings can't be changed to meet the requirements.Ticket: https://dimagi.atlassian.net/browse/SAAS-15924
Technical Summary
The approach here was to change the
CommCareLocationControllerFactoryto useLocationManagerwhen the device is in Airplane mode instead ofFuseLocationProvider.Safety Assurance
Safety story
This was tested locally and it was successful.
Labels and Review