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

com.termux foreground service is getting killed after user removes activity from recents list #1219

twaik opened this issue Aug 17, 2019 · 2 comments


Copy link

commented Aug 17, 2019

Problem description
The problem is in the description.

Steps to reproduce

  1. Start an application.
  2. Go to recent activities list.
  3. Remove termux-app task.
  4. All the running processes of com.termux are killed

Expected behavior
Foreground service should stay in memory, notification of foreground service should be kept.

Additional information
I think it is the exact case:
I think the best solution will be splitting main termux-app source into two packages: termux-app and termux-core. com.termux.core should not have any activities that can be killed, it should have only BroadcastReceivers and Services.

$ termux-info
Updatable packages:
bash/stable 5.0.9 arm [upgradable from: 5.0.7-5]
dash/stable arm [upgradable from:]
dbus/x11 1.12.16-4 arm [upgradable from: 1.12.16-3]
libcairo-x/x11 1.16.0-9 arm [upgradable from: 1.16.0-8]
openssh/stable 8.0p1-3 arm [upgradable from: 8.0p1-2]
unzip/stable 6.0-5 arm [upgradable from: 6.0-4]
xfce4-session/x11 4.14.0-2 arm [upgradable from: 4.14.0-1]
Subscribed repositories: x11/main science/stable games/stable stable/main
System information:
Linux localhost 4.9.77+ #1 SMP PREEMPT Mon Jun 10 14:37:32 WIB 2019 armv7l Android
Termux-packages arch:
Android version:
Device manufacturer:
Device model:
Redmi 6A

This comment has been minimized.

Copy link

commented Aug 18, 2019

Some observations:

  • SDK target level < 28 may prevent application from being killed.

  • Installing to /system/app, may prevent app from being killed as well.

Issue happens on Lineage OS 16.0 ROM but not in Android 9 AVD (emulator).
Service is not killed, same behaviour as described in (startForeground()).


This comment has been minimized.

Copy link

commented Aug 20, 2019

Disabled powersaving mode and now Termux isn't killed when swiped from recents.

@xeffyr xeffyr removed the bug report label Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.