Skip to content

calling termux-location when there is no gps #365

@schwartazi

Description

@schwartazi

Problem description

Hello
I'm writing a script to run both termux-telephony-cellinfo and termux-location and writing it in a log.
In case there is no GPS location, I'm killing the the termux-location and writing only telephony information in a log.
There is no easy way to know if there is GPS reception so I'm waiting for a few seconds and if there is no response i'm killing the termux-location process.
The problem with this approach is that after I kill the process any other call to the API is just hanging for very long time.I further noticed that when I run termux-location it runs two additional process termux-api and app_process
when killing termux-location pid the termux-api is exiting after some time and the app_process is just hanging there forever.
To get other api running I need to kill also the app_process, but when doing so I see that it take very long time to get other api calls.

So the question here is how to stop termux-location or to get an idea that there is not GPS reception before running the command to avoid this hang.

Steps to reproduce

run termux-location in case there is no GPS, kill the process in another shell and run another command such as termux-info
Expected behavior

I would exepect that all other calls will not be affected and that there will be a nice way to exit termux-location after some timeout.
Additional information

  • Termux application version: 0.92
  • Android OS version: 8.1.0
  • Device model: ruggear rg725

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions