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

Open
twaik opened this issue Aug 17, 2019 · 2 comments

Comments

@twaik
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: https://stackoverflow.com/a/53847435/4984168
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 0.5.10.2-2 arm [upgradable from: 0.5.10.2-1]
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:
https://dl.bintray.com/xeffyr/x11-packages-24 x11/main
https://dl.bintray.com/grimler/science-packages-24 science/stable
https://dl.bintray.com/grimler/game-packages-24 games/stable
https://dl.bintray.com/termux/termux-packages-24 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:
arm
Android version:
8.1.0
Device manufacturer:
Xiaomi
Device model:
Redmi 6A
@xeffyr

This comment has been minimized.

Copy link
Member

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 https://medium.com/@er.abhishek.luthra/what-exactly-happens-to-running-services-when-you-swipe-an-android-app-from-recent-app-list-d343ca03a2a (startForeground()).

@xeffyr

This comment has been minimized.

Copy link
Member

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
Projects
None yet
2 participants
You can’t perform that action at this time.