Exemplo n.º 1
0
 virtual void Notify(const NetlinkEvent &aEvent)
 {
   // this will run on IO thread
   NetlinkEvent *event = const_cast<NetlinkEvent*>(&aEvent);
   const char *subsystem = event->getSubsystem();
   // e.g. DEVPATH=/devices/platform/sec-battery/power_supply/battery
   const char *devpath = event->findParam("DEVPATH");
   if (strcmp(subsystem, "power_supply") == 0 &&
       strstr(devpath, "battery")) {
     // aEvent will be valid only in this method.
     NS_DispatchToMainThread(mUpdater);
   }
 }