Skip to content

Passed location to start configuration call #3201

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

Merged
merged 12 commits into from
Jul 1, 2025

Conversation

pm-dimagi
Copy link
Contributor

@pm-dimagi pm-dimagi commented Jun 17, 2025

Product Description

This is the duplicate PR of this, its due to by mistake i have taken the pull of feature/connect in this because earlier i was working on phase 4 sorry for the mistake , i have taken care of all shubham comment in this attaching the video for reference

Screen_Recording_20250620_021956_Settings.mp4
Screen_Recording_20250620_022347_CommCare.Debug.mp4

Shubham asked behaviour:->

Behavior when we don't have location permission and on showing location dialogue user denies the permission
Behavior when we don't have location permission and on showing location dialogue user accepts the permission
We already have location permission but location is turned off in device settings
We already have location permission but device is not able to get location due to no network and no gps.

One thing to add more the dialog for asking the location is asked two times because it is general behaviour of the permission because
->When the user first denies a permission (taps "Don't Allow"), but does NOT check “Don’t ask again,” the system returns true for shouldShowRequestPermissionRationale().This is Android’s way of saying: “You should show the user an explanation before asking again.”

some of the method is empty because we are checking the permission at on resume

Technical Summary

Feature Flag

Safety Assurance

Safety story

Automated test coverage

QA Plan

Labels and Review

  • Do we need to enhance the manual QA test coverage ? If yes, the "QA Note" label is set correctly
  • Does the PR introduce any major changes worth communicating ? If yes, the "Release Note" label is set and a "Release Note" is specified in PR description.
  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

Copy link

coderabbitai bot commented Jun 17, 2025

📝 Walkthrough

Walkthrough

This change introduces location permission handling and GPS location acquisition to the Personal ID phone fragment. A new string resource for location permission denial is added. The ConnectConstants class receives a new constant for location permission failure. The PersonalIdMessageFragment is updated to handle this new failure case, guiding users to the appropriate location settings. The PersonalIdPhoneFragment is refactored to implement location listener and permission requester interfaces, manage location permission requests, handle location updates, and incorporate the acquired location into the configuration request. The Permissions utility methods are updated to accept the more general Activity type instead of AppCompatActivity.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PersonalIdPhoneFragment
    participant Permissions
    participant CommCareLocationController
    participant System

    User->>PersonalIdPhoneFragment: Opens fragment
    PersonalIdPhoneFragment->>Permissions: Check location permission
    alt Permission not granted
        PersonalIdPhoneFragment->>Permissions: Should show rationale?
        alt Show rationale
            PersonalIdPhoneFragment->>User: Show permission error screen
        else Request permission
            PersonalIdPhoneFragment->>System: Request location permission
            System-->>PersonalIdPhoneFragment: Permission granted/denied
        end
    else Permission granted
        PersonalIdPhoneFragment->>CommCareLocationController: Start location updates
        CommCareLocationController-->>PersonalIdPhoneFragment: onLocationResult (with location)
    end
    PersonalIdPhoneFragment->>User: Enable "Continue" if phone, consent, and location are valid
    User->>PersonalIdPhoneFragment: Tap "Continue"
    PersonalIdPhoneFragment->>System: Send configuration request (includes location)
Loading

Suggested labels

skip-integration-tests

Suggested reviewers

  • shubham1g5
  • OrangeAndGreen
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch pm_location_fix_duplicate

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🔭 Outside diff range comments (1)
app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java (1)

172-183: Button never re-enables after location arrives

updateContinueButtonState() gates on location != null, but the method is never invoked from the location callback.
Result: user enters valid phone + consent, GPS fix arrives, button stays disabled.

@Override
public void onLocationResult(@NonNull Location result) {
    location = result;
    locationController.stop();
+    updateContinueButtonState();     // refresh UI
}
🧹 Nitpick comments (1)
app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java (1)

270-296: Permission result logic – simplify and remove duplicated checks

allPermissionsGranted can be derived directly from the result map; no need to call back into Permissions. This reduces race conditions on slight timing differences in the OS.

-boolean allPermissionsGranted = !Permissions.missingAppPermission(requireActivity(), REQUIRED_PERMISSIONS);
+boolean allPermissionsGranted = result.values().stream().allMatch(Boolean::booleanValue);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f82cb3 and a5d371e.

📒 Files selected for processing (5)
  • app/res/values/strings.xml (1 hunks)
  • app/src/org/commcare/connect/ConnectConstants.java (1 hunks)
  • app/src/org/commcare/fragments/personalId/PersonalIdMessageFragment.java (2 hunks)
  • app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java (11 hunks)
  • app/src/org/commcare/utils/Permissions.java (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Lint Code Base
🔇 Additional comments (3)
app/src/org/commcare/connect/ConnectConstants.java (1)

54-55: Constant looks fine – consider adding brief JavaDoc

The new constant follows the existing naming and offset scheme; no functional issues spotted. A one-liner JavaDoc would make its intent searchable.

app/src/org/commcare/fragments/personalId/PersonalIdMessageFragment.java (1)

148-151: Order of operations may hide system-settings screen

navigateUp() first pops the fragment; immediately afterwards GeoUtils.goToProperLocationSettingsScreen() starts an external Activity.
If the host Activity is finishing or the NavController is in an intermediate state, the settings intent might be dropped.

-NavHostFragment.findNavController(this).navigateUp();
-GeoUtils.goToProperLocationSettingsScreen(activity);
+GeoUtils.goToProperLocationSettingsScreen(activity);
+NavHostFragment.findNavController(this).navigateUp();

Reversing ensures the intent is fired before the nav stack mutates.

app/src/org/commcare/utils/Permissions.java (1)

64-78: Now accepts Activity – ensure callers updated

Method signatures were widened to Activity, but acquireAllAppPermissions still demands AppCompatActivity.
Double-check every caller; mixing types may cause accidental down-casts.

Comment on lines 258 to 268
private void checkPermission() {
if (Permissions.missingAppPermission(requireActivity(), REQUIRED_PERMISSIONS)) {
if (shouldShowPermissionRationale(requireActivity(), REQUIRED_PERMISSIONS)) {
navigateToPermissionErrorMessageDisplay();
} else {
locationPermissionLauncher.launch(REQUIRED_PERMISSIONS);
}
} else {
locationController.start();
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Infinite permission prompt loop risk

Inside checkPermission() a denial without “don’t ask again” shows the error screen instead of re-prompting, but inside registerLocationPermissionLauncher you recursively call launch() after the first denial.
This can loop indefinitely and blocks navigation.

Consider:

-else {
-    locationPermissionLauncher.launch(REQUIRED_PERMISSIONS); // Retry asking
-}
+else if (shouldShowPermissionRationale(requireActivity(), REQUIRED_PERMISSIONS)) {
+    navigateToPermissionErrorMessageDisplay();
+}

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java around
lines 258 to 268, the checkPermission method risks an infinite loop by
recursively calling locationPermissionLauncher.launch() after a denial without
"don't ask again". To fix this, refactor the permission request flow to avoid
recursive launches by handling the denial case gracefully—either by showing the
rationale or error screen without immediately re-launching the permission
prompt. Ensure that after a denial, the app does not automatically re-prompt
permissions but waits for user action.

@pm-dimagi
Copy link
Contributor Author

@coderabbitai 829a449 can you review this

@pm-dimagi
Copy link
Contributor Author

@coderabbitai review

Copy link

coderabbitai bot commented Jun 17, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@dimagi dimagi deleted a comment from coderabbitai bot Jun 17, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (2)
app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java (2)

213-217: Possible NPE when location is null
Same issue flagged earlier—GeoUtils.locationToString(location) will crash if a fix was never obtained. Guard with a null-check or fallback string.


294-299: Infinite permission-prompt loop still present

The launcher recursively calls launch() after a standard denial, recreating the loop noted in the previous review. Apply the earlier fix: only retry when shouldShowPermissionRationale returns true; otherwise show the error screen.

🧹 Nitpick comments (1)
app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java (1)

255-256: Unimplemented interface methods

requestNeededPermissions is empty although the fragment declares RuntimePermissionRequester. Either implement the logic or remove the interface to avoid dead code.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a5d371e and 829a449.

📒 Files selected for processing (2)
  • app/res/values/strings.xml (1 hunks)
  • app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java (11 hunks)
✅ Files skipped from review due to trivial changes (1)
  • app/res/values/strings.xml

Comment on lines 180 to 181
enableContinueButton(isValidPhone && isConsentChecked && location!=null);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

UX blocker – “Continue” button stays disabled until a fix is acquired

enableContinueButton(isValidPhone && isConsentChecked && location != null);
If the device takes a long time (or never) to obtain a location, users are effectively stuck even though phone + consent are valid. Consider making location optional or add a timeout / “Skip” fallback so that the flow is not blocked.

🤖 Prompt for AI Agents
In app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java around
lines 180 to 181, the "Continue" button is disabled until a location fix is
acquired, blocking users if location is delayed or unavailable. Modify the logic
in enableContinueButton to make location optional or implement a timeout
mechanism that enables the button after a set period even if location is null.
Alternatively, add a "Skip" option to allow users to proceed without location,
ensuring the flow is not blocked when phone and consent are valid.

Comment on lines 228 to 233
@Override
public void onLocationResult(@NonNull Location result) {
location = result;
locationController.stop();
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing UI refresh after location arrives

onLocationResult stores the location and stops updates but never re-evaluates the button state. The button therefore remains disabled even though location is now non-null (see check in updateContinueButtonState). Add a call:

 public void onLocationResult(@NonNull Location result) {
     location = result;
+    updateContinueButtonState();   // re-enable “Continue” when possible
     locationController.stop();
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Override
public void onLocationResult(@NonNull Location result) {
location = result;
locationController.stop();
}
@Override
public void onLocationResult(@NonNull Location result) {
location = result;
updateContinueButtonState(); // re-enable “Continue” when possible
locationController.stop();
}
🤖 Prompt for AI Agents
In app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java around
lines 228 to 233, the onLocationResult method updates the location and stops
location updates but does not refresh the UI state. To fix this, add a call to
updateContinueButtonState() at the end of onLocationResult to re-evaluate and
update the button state based on the new location value.

Comment on lines 70 to 72
private static final String[] REQUIRED_PERMISSIONS = new String[]{
Manifest.permission.ACCESS_COARSE_LOCATION
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Requesting only ACCESS_COARSE_LOCATION may be insufficient for GPS coordinates

The fragment later calls GeoUtils.locationToString(location) and expects a GPS fix. Relying solely on ACCESS_COARSE_LOCATION can return cell / Wi-Fi based positions with low accuracy or even null when coarse providers are disabled.
Consider requesting ACCESS_FINE_LOCATION (or both) so that the location controller can fall back to GPS when needed.

-private static final String[] REQUIRED_PERMISSIONS = new String[]{
-        Manifest.permission.ACCESS_COARSE_LOCATION
-};
+private static final String[] REQUIRED_PERMISSIONS = new String[]{
+        Manifest.permission.ACCESS_COARSE_LOCATION,
+        Manifest.permission.ACCESS_FINE_LOCATION
+};
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private static final String[] REQUIRED_PERMISSIONS = new String[]{
Manifest.permission.ACCESS_COARSE_LOCATION
};
private static final String[] REQUIRED_PERMISSIONS = new String[]{
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION
};
🤖 Prompt for AI Agents
In app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java around
lines 70 to 72, the code only requests ACCESS_COARSE_LOCATION permission, which
may not provide accurate GPS coordinates needed by
GeoUtils.locationToString(location). Update the REQUIRED_PERMISSIONS array to
include ACCESS_FINE_LOCATION as well, ensuring the app can access fine location
data for better accuracy and fallback to GPS when necessary.

public void onLocationRequestFailure(@NonNull Failure failure) {
if (failure instanceof CommCareLocationListener.Failure.ApiException) {
Exception exception = ((CommCareLocationListener.Failure.ApiException)failure).getException();
if (exception instanceof ResolvableApiException) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shubham-> abstract as handleResolvableLocationException and resue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

375ea98 removed this due to negative button handling

Copy link
Contributor

@shubham1g5 shubham1g5 Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we should directly be calling exception.startResolutionForResult(this, LOCATION_SETTING_REQ) for ResolvableApiException . Also there is lot of common code for this method onLocationRequestFailure in different places in code and we should be abstracting it better and resusing it in all other places as well.

@shubham1g5
Copy link
Contributor

shubham1g5 commented Jun 19, 2025

->When the user first denies a permission (taps "Don't Allow"), but does NOT check “Don’t ask again,” the system returns true for shouldShowRequestPermissionRationale().This is Android’s way of saying: “You should show the user an explanation before asking again.”

@pm-dimagi This is true but it does not mean that we should show the permission dialog twice in a row on user clicking "Don't allow", this is not expected but result of how we are coding it (permission check getting called after user denies the request). If you look at other parts of code asking location permission, this is not the behaviour you would see there on UI.

@pm-dimagi
Copy link
Contributor Author

@shubham1g5 i have updated the videos with new flow

@shubham1g5
Copy link
Contributor

i have updated the videos with new flow

Thanks, we should remove the old videos from there as they are no longer relevant.

@shubham1g5
Copy link
Contributor

Other comments based on videos -

Video1: User should not get "Process Failed" message on clicking Change Settings on the dialog but only when user denied to go to settings.

Video2:

-Change "Ok" button to say Grant location Permission in the message fragment. When user click on it, we should also finish the current PersonalIDActivity and exit the user to last screen after launching the app settings screen for user to grant permission.

  • Can we also add a video showing "Permission Rationale" when user has denies the location first time but enters to phone screen the second time
  • Can we add a video showing what happens when user has denied location permission twice already and enters to the phone screen a third time.

public void onLocationResult(@NonNull Location result) {
location = result;
updateContinueButtonState();
locationController.stop();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does calling stop twice on locationController doesn't cause a problem ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope it dosent create issue but then also i handled it
1a5d890

@pm-dimagi
Copy link
Contributor Author

Other comments based on videos -

Video1: User should not get "Process Failed" message on clicking Change Settings on the dialog but only when user denied to go to settings.

Video2:

-Change "Ok" button to say Grant location Permission in the message fragment. When user click on it, we should also finish the current PersonalIDActivity and exit the user to last screen after launching the app settings screen for user to grant permission.

  • Can we also add a video showing "Permission Rationale" when user has denies the location first time but enters to phone screen the second time
  • Can we add a video showing what happens when user has denied location permission twice already and enters to the phone screen a third time.
    in video 1 i am clicking the cancel button not the change settings

@pm-dimagi pm-dimagi requested a review from shubham1g5 June 20, 2025 19:41
@Override
public void onDestroyView() {
super.onDestroyView();
if (locationController != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will never be null here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Override
public void onPause() {
super.onPause();
if (locationController != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null check is not required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public void requestNeededPermissions(int requestCode) {
}

private void checkLocationPermission() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like locationController itself checks for the locations permission and if not given calls missingPermissions() callback method. As such the logic to request permisssion should be handled instead in missingPermissions() method to align with our location framework better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Override
public void onResume() {
super.onResume();
checkLocationPermission();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should instead call locationController.start(); directly here as the location controller itself check for permissions. Take a look at code in CommCareFusedLocationController

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public void onLocationRequestFailure(@NonNull Failure failure) {
if (failure instanceof CommCareLocationListener.Failure.ApiException) {
Exception exception = ((CommCareLocationListener.Failure.ApiException)failure).getException();
if (exception instanceof ResolvableApiException) {
Copy link
Contributor

@shubham1g5 shubham1g5 Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we should directly be calling exception.startResolutionForResult(this, LOCATION_SETTING_REQ) for ResolvableApiException . Also there is lot of common code for this method onLocationRequestFailure in different places in code and we should be abstracting it better and resusing it in all other places as well.

}

@Override
public void requestNeededPermissions(int requestCode) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no reason to implement RuntimePermissionRequester for this class if we are not using requestNeededPermissions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pm-dimagi pm-dimagi requested a review from shubham1g5 June 27, 2025 15:37
@@ -403,5 +385,10 @@ private void navigateToPermissionErrorMessageDisplay(int errorMeesage, int butto

@Override
public void missingPermissions() {
if (Permissions.missingAppPermission(requireActivity(), REQUIRED_PERMISSIONS)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is always true here and we should not need to check again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new LocationRequestFailureHandler.LocationResolutionCallback() {
@Override
public void onResolvableException(ResolvableApiException exception) {
handleNoLocationServiceProviders();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at other implementation of this method in GeoPointActivity , it seems like we should not be calling handleNoLocationServiceProviders from onResolvableException but onNonResolvableFailure instead!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pm-dimagi pm-dimagi requested a review from shubham1g5 June 30, 2025 08:03
…nto pm_location_fix_duplicate

# Conflicts:
#	app/res/values/strings.xml
#	app/src/org/commcare/connect/ConnectConstants.java
#	app/src/org/commcare/fragments/personalId/PersonalIdMessageFragment.java
#	app/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.java
shubham1g5
shubham1g5 previously approved these changes Jun 30, 2025
exception.getResolution()).build();
resolutionLauncher.launch(request);
} catch (Exception e) {
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove e.printStackTrace()

@pm-dimagi pm-dimagi merged commit fc49add into master Jul 1, 2025
5 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-integration-tests Skip android tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants