Home | History | Annotate | Download | only in porting
      1 page.title=Lights
      2 pdk.version=1.0
      3 doc.type=porting
      4 @jd:body
      5 
      6 <div id="qv-wrapper">
      7 <div id="qv">
      8 <h2>In this document</h2>
      9 <a name="toc"/>
     10 <ul>
     11 <li><a href="#androidLightsBuildingDriver">Building a Lights Library</a></li>
     12 <li><a href="#androidLightsInterface">Interface</a></li>
     13 </ul>
     14 </div>
     15 </div>
     16 
     17 <p>Android defines a user space C abstraction interface for LED hardware. The interface header is defined in 
     18 <code>hardware/libhardware/include/hardware/lights.h</code>.
     19 In order to integrate LEDs with Android you need to build a shared library that implements this interface. 
     20 
     21 The types of logical lights currently supported by Android include:
     22 <ul>
     23 <li>Backlight</li>
     24 <li>Keyboard</li>
     25 <li>Buttons</li>
     26 <li>Battery</li>
     27 <li>Notifications</li>
     28 <li>Attention</li>
     29 </ul>
     30 </p> 
     31  
     32 <a name="androidLightsBuildingDriver"></a><h3>Building a Lights Library</h3>
     33 <p> To implement a Lights driver, create a shared library that implements the interface defined in <code>lights.h</code>. You must name your shared library 
     34 <code>liblights.so</code> so that it will get loaded from <code>/system/lib</code> at runtime. 
     35 </p
     36 
     37  
     38 <a name="androidLightsInterface"></a><h3>Interface</h3> 
     39  
     40  
     41  
     42 <p><span class="lh3"><a name="androidDoxygenNote"></a></span> 
     43  
     44 <p class="note"><strong>Note</strong>: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, <a href="lights.html">click here</a>.</p> 
     45  
     46  
     47 <iframe onLoad="resizeDoxFrameHeight();" src="lights_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0" 
     48 frameborder="0" style="width:100%;"></iframe> 
     49