0

I used advanced task killer (many other task killer) to kill processes in my android phone, most of the cases do work, but sometimes I find you kill the process in task killer doesn't mean the process get really killed, it still works in background, Is there any tool that have more privilege and can see all background processes ?(I think advanced task killer can only see the "user" level processes)

If you don't mind, can you explain me how these task killer applets actually work ?

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
MemoryLeak
  • 7,322
  • 23
  • 90
  • 133

2 Answers2

1

Here is a wild guess from a novice:

Android sits on top of the linux operating system as shown here. If you connect to your android virtual device (avd) and open the terminal emulator or connect through the ADB, you will find that you have access to various linux commands.

C:\Users\james>adb -e shell
# cd /system/bin
# ls -a -l
...
lrwxr-xr-x root     shell             2010-06-30 15:32 insmod -> toolbox
-rwxr-xr-x root     shell       18172 2010-06-30 15:32 installd
lrwxr-xr-x root     shell             2010-06-30 15:32 ioctl -> toolbox
lrwxr-xr-x root     shell             2010-06-30 15:32 ionice -> toolbox
-rwxr-xr-x root     shell       10036 2010-06-30 15:33 keystore
-rwxr-xr-x root     shell        6520 2010-06-30 15:33 keystore_cli
lrwxr-xr-x root     shell             2010-06-30 15:32 kill -> toolbox

Notice that most of the commands are just links to one small program (toolbox). I can list the running programs with the ps command but if I try to kill them with the kill command... it says i do not have permission. You might be able to create a task manager that uses the underlying ps and kill commands in order to do the dirty work for you. You may have to overcome some permission issues though.

I expect you could run the system commands with something like this:

Runtime.getRuntime().exec("ls");

Edit:

I skimmed through this open source task manager but I didn't see how it goes about killing tasks. Maybe someone more experienced can explain it.

James T
  • 1,079
  • 3
  • 13
  • 17
  • 2
    That particular project is using ActivityManager.restartPackage: http://developer.android.com/reference/android/app/ActivityManager.html Line 41 of http://www.google.com/codesearch/p?hl=en#ShcVu2smP2I/trunk/src/org/freecoder/taskmanager/MiscUtil.java&q=kill%20package:http://freetaskmanager%5C.googlecode%5C.com&sa=N&cd=1&ct=rc – mbafford Dec 05 '10 at 03:26
  • @ydant Ah thanks! That explains it. That looks like the correct way to kill a process. – James T Dec 05 '10 at 03:35
0

You can change the settings under Menu button -> Setting -> Auto Kill Level and Security Level. Auto Kill Level should be set to crazy and Security Level to Low. I'm pretty sure it gets everything. Maybe too much, might want to add some apps to the ignore list. Like the clock app, or else your alarm won't work.

As for how it works internally, I have no idea.

vichle
  • 2,499
  • 1
  • 15
  • 17