Skip to content
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

Missing version check for API getNeighboringCellInfo #55

Open
DSOTM-pf opened this issue Aug 1, 2021 · 0 comments
Open

Missing version check for API getNeighboringCellInfo #55

DSOTM-pf opened this issue Aug 1, 2021 · 0 comments

Comments

@DSOTM-pf
Copy link

DSOTM-pf commented Aug 1, 2021

Hi, there, I've found a version check is missing in version 0.2.9, the app is downloaded from F-Droid.

It is related to the following call chain:

org.openbmap.unifiedNlp.services.RadiocellsLocationService$2.run()void
 org.openbmap.unifiedNlp.services.RadiocellsLocationService.access$300(org.openbmap.unifiedNlp.services.RadiocellsLocationService,java.util.List)void
  org.openbmap.unifiedNlp.services.RadiocellsLocationService.getLocationFromWifisAndCells(java.util.List)void
   org.openbmap.unifiedNlp.services.RadiocellsLocationService.getCells()java.util.List
    android.telephony.TelephonyManager.getNeighboringCellInfo()java.util.List

The API getNeighboringCellInfo is added in Android API-level 25, if it is called in under 25 device, the app will crash. It may be better if we can check for the runtime version before calling it, such as:

if (Build.VERSION.SDK_INT >= 25)
    List list = getNeighboringCellInfo()
else
   // something else

@wish7code Can you help me review this? Very thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant