termux / termux/termux-api

calling termux-location when there is no gps

Open
#365 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug report
Dominant language
Java
Stars
4.3k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with termux-location on a device without GPS reception, then kill it and run termux-info or another API command. Observe the termux-location, termux-api, and app_process processes and their timing. Done means the location command can exit after a timeout without leaving other API calls hanging.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
api, cli, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.