Process.killProcess does not work

88 views
Skip to first unread message

Yong

unread,
Apr 24, 2014, 7:50:05 AM4/24/14
to android-...@googlegroups.com

The Activity Manager provide a API : killBackgroundProcesses. And the AMS will call Process.killProcessQuiet to kill the process with uid system. I write a app with system uid, and call Process.kilProcess, but it doesn't work. The process is not killed.

 So how can I kill a process with system uid ?

zhao...@gmail.com

unread,
Apr 24, 2014, 10:30:16 AM4/24/14
to android-...@googlegroups.com
The app don't have no cap_kill permission. only root and system_process have it 

发自我的 iPad

在 2014年4月24日,19:50,Yong <ito...@gmail.com> 写道:


The Activity Manager provide a API : killBackgroundProcesses. And the AMS will call Process.killProcessQuiet to kill the process with uid system. I write a app with system uid, and call Process.kilProcess, but it doesn't work. The process is not killed.

 So how can I kill a process with system uid ?

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/d/optout.

Yong

unread,
Apr 27, 2014, 10:00:42 PM4/27/14
to android-...@googlegroups.com
So why the system_process has the kill permission? 

I know the root has the permission. But the system_process is running with uid system, and the app process is spawn by zygote. 

在 2014年4月24日星期四UTC+8下午10时30分16秒,uglystone写道:

zhao...@gmail.com

unread,
Apr 28, 2014, 8:12:56 AM4/28/14
to android-...@googlegroups.com
zygote fork the system-server with the caplitity arguments but for other process,no the flag. you can see the file zygoteinit.java

发自我的 iPad

zhao...@gmail.com

unread,
Apr 28, 2014, 8:15:34 AM4/28/14
to android-...@googlegroups.com

534    /***
535     * Prepare the arguments and fork for the system server process.
536     */
537    private static boolean startSystemServer()
538            throws MethodAndArgsCaller, RuntimeException {
539        /** Hardcoded command line to start the system server */
540        String args[] = {
541            "--setuid=1000",
542            "--setgid=1000",
543            "--setgroups=1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,3001,3002,3003",
544            "--capabilities=130104352,130104352",
545            "--runtime-init",
546            "--nice-name=system_server",
547            "com.android.server.SystemServer",
548        };

发自我的 iPad

在 2014年4月28日,10:00,Yong <ito...@gmail.com> 写道:

Yong

unread,
Apr 28, 2014, 10:21:07 PM4/28/14
to android-...@googlegroups.com
Thanks. I get the key point.

在 2014年4月28日星期一UTC+8下午8时15分34秒,uglystone写道:

534    /***
535     * Prepare the arguments and fork for the system server process.
536     */
537    private static boolean startSystemServer()
538            throws MethodAndArgsCaller, RuntimeException {
539        /** Hardcoded command line to start the system server */
540        String args[] = {
541            "--setuid=1000",
<code style="padding: 0px 0.3em 0px 0px !important; margin: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important
...
Reply all
Reply to author
Forward
0 new messages