top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Android: Can i send a SIGUSR1/2 signal from the "system server" to one of my hardware daemon?

+1 vote
677 views

I working on a project which needs adding a service with JNI to the system server and also a new daemon in init.rc script. I have successfully done this.
I might need the system service to periodically send SIGUSR1/2 signals to the daemon. Linux requires a sender of signals to be root. Do I have this privilege inside system server in Android?

posted Oct 18, 2013 by Bob Wise

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

See frameworks/base/core/java/com/android/internal/os/ZygoteInit.java method startSystemServer()for a list of the capabilities of system server. Per man 2 kill, you'll need CAP_KILL:
"For a process to have permission to send a signal it must either be privileged (under Linux: have the CAP_KILL capability), or the real or effective user ID of the sending process must equal the real or saved set-user-ID of the target process."

answer Oct 18, 2013 by Jai Prakash
Similar Questions
+3 votes

I want to send a file (video) from android to server and vice versa. And I want the setup to work for N number of devices (more than 1). I assume we can use socket, yet I am not sure if using Socket for this requirement is the best way. Thanks in advance.

+2 votes

How to send the 3 edittext values and 2 spinner values as a single message to particular number while clicking send button?

0 votes

I want to show the network signal strength in my app. I am using LTE network for transmitting data and want to show any real time variations in network strength. I was able to get the GSM signal strength but how can I get the same for LTE?

0 votes

I need to show a dialog (more like a horizontal bar) on press of a custom Key (on my custom device powered by Android). This dialog should appear on top of any other application(say "A") that might be running when the Key is pressed.
The app "A" should keep on running and its UI should be visible (i.e the app "A: should not go to "_onPause_()"). It should work something similar to_ SystemUI_'s volume change dialog when Volume Hard Keys are pressed. I want to make minimum changes in framework.
My understanding is that I need to make changes in _PhoneWindowManager.java_ to handle the press of custom Key, which will then call my app residing in application layer, which will just inflate the dialog.
Would this work? If so, is there a better way to implement it? If not, how can I implement this?

...