Skip to content

[BUG] Potential ANR / main-thread blocking risk #280

@venkyqz

Description

@venkyqz

Environment

  • App: FadCam (com.fadcam)
  • Branch checked: master
  • File: app/src/main/java/com/fadcam/ui/VideoInfoBottomSheet.java:512
  • Verified commit: 4d1ba9852a442a9a840089ec47b7a73b98c69d57

The Issue

While reviewing vs1.f() → Geocoder-getFromLocation, I noticed a potential main-thread blocking risk around android.location.Geocoder#getFromLocation(double,double,int).

The latest source still performs the operation synchronously:

509:         try {
510:             if (getContext() != null) {
511:                 Geocoder geocoder = new Geocoder(getContext(), Locale.getDefault());
512:                 List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
513: 
514:                 if (addresses != null && !addresses.isEmpty()) {
515:                     Address address = addresses.get(0);
516:                     String locality = address.getLocality();
517:                     String country = address.getCountryName();

android.location.Geocoder#getFromLocation(double,double,int) can block the calling thread while Android resolves a provider, opens a stream, performs database work, contacts account services, touches storage, or waits on remote I/O, depending on the API and URI/backend involved.

The Risk & Impact

If this method is reached from a UI-thread path, the operation can cause visible jank, StrictMode violations in debug builds, or an ANR when the provider/backend is slow, blocked, or unreachable. I am phrasing this as a source-level risk because I verified the current source pattern but did not run an on-device reproduction.

Current source path

<vs1: java.lang.String f(double,double)>
  -> android.location.Geocoder#getFromLocation(double,double,int)

Verification

I checked the latest upstream source at 4d1ba9852a442a9a840089ec47b7a73b98c69d57 and found the sensitive operation still present in app/src/main/java/com/fadcam/ui/VideoInfoBottomSheet.java. This report is based on source-level inspection, not runtime reproduction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in reviewTrying to reproduce the bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions