Hi guys,

Thanks for answering. I'll give it a try and report back if anything
goes wrong.

Regards
Andrirad

On 4 nov, 18:27, Durgadoss Ramanathan <[email protected]> wrote:
> Hi Andria,
>
> You can Poll from the User Space using "Handlers" as Preetam mentioned.
> But "Polling" is bad. Instead you can use UEvents.
>
> The ideal (Android) way would be:
>
> 1. Let your kernel module send an UEvent, whenever the alert raises.
>     This can be done by KOBJ_UEVENT(,,.,,)
> 2. Create a Simple Service in UserSpace that has an UEventObserver.
> Register this Observer with your
>     KOBJ device path name.
> You can have a look at android<http://www.google.com/codesearch#cZwlSNS7aEw/>
> /frameworks 
> <http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/>/base<http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/base/&exact_p...>
> /services<http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/base/services...>
> /java<http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/base/services...>
> /com<http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/base/services...>
> /android<http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/base/services...>
> /server<http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/base/services...>/BatteryService.java
> to figure out how to use UEventObservers.
>
> 3. Whenever you send the UEvent, this Observer will be called by the
> Android Framework. Inside the observer
> code, you can broadCast an Intent to notify other Services/Apps, that can
> raise a 'notification' or 'Toasts' or
> 'Alerts'.
>
> Thanks,
> Durga
>
>
>
>
>
>
>
>
>
> On Thu, Nov 3, 2011 at 10:04 PM, preetam m.n <[email protected]> wrote:
> > as said below create a sysfs entries for the aleart.
>
> > 1. for checking for the alert (it could be something like toggling the
> > switch- saying true or 1 when you have a message and false or 0 when no
> > message).
> > 2. for message
>
> > create a handler in the android stack to watch 1st sysfs entry to check
> > for the aleart.
> > create a intent observer which pops alert on the lcd. make sure the system
> > by default registers for this intent.
> > when a alert from kernel is given, you handler should be able to recognize
> > it by realizing that the switch is toggled from false to true using cat the
> > 2nd sysfs entry you can get the message content.
> > immediately broadcast an intent to the registered observers and from there
> > your observer should be able to pop and alert message on lcd.
>
> > if you not keen of knowing the message from the kernel you can go ahead
> > and create only one sysfs entry and use the same logic.
>
> > - Preetam
>
> > On Tue, Nov 1, 2011 at 8:11 PM, Tiago Maluta <[email protected]>wrote:
>
> >> you can create a file [1] as a sysfs entry on your system, create a
> >> android service pooling that information and display to user.
>
> >> [1] example: you can create a "notifications" file and put printk content.
>
> >>     $ cat /sys/kernel/notifications
> >>     YOUR MESSAGE
>
> >> --tm
>
> >> On Fri, Oct 28, 2011 at 11:05 AM, andria <[email protected]> wrote:
> >> > Hi,
>
> >> > I work on a kernel module that sometimes raises an alert thanks to
> >> > printk. I want to improve it by raising the alert in the user space
> >> > like a notification in the status bar. Does anyone know how this can
> >> > be done? One way to do it is to do like the sms notification because
> >> > as far as I know there is something related to sms an call at kernel
> >> > level but I don't know here exactly. So any idea?
>
> >> > Thanks,
>
> >> > Andria
>
> >> --
> >> unsubscribe: [email protected]
> >> website:http://groups.google.com/group/android-kernel
>
> > --
> > "The great pleasure in life is doing what people say you cannot do"
>
> > --
> > unsubscribe: [email protected]
> > website:http://groups.google.com/group/android-kernel
>
> --
> Regards
> Durgadoss

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel

Reply via email to