Reena Lee | e557a73 | 2009-05-20 08:04:39 -0700 | [diff] [blame] | 1 | page.title=Lights |
| 2 | pdk.version=1.0 |
| 3 | @jd:body |
David Warren | 5c40a48 | 2009-06-05 15:11:21 -0700 | [diff] [blame] | 4 | |
| 5 | <div id="qv-wrapper"> |
| 6 | <div id="qv"> |
| 7 | <h2>In this document</h2> |
| 8 | <a name="toc"/> |
| 9 | <ul> |
| 10 | <li><a href="#androidLightsBuildingDriver">Building a Lights Library</a></li> |
| 11 | <li><a href="#androidLightsInterface">Interface</a></li> |
| 12 | </ul> |
| 13 | </div> |
| 14 | </div> |
| 15 | |
Reena Lee | e557a73 | 2009-05-20 08:04:39 -0700 | [diff] [blame] | 16 | <p>Android defines a user space C abstraction interface for LED hardware. The interface header is defined in |
| 17 | <code>hardware/libhardware/include/hardware/lights.h</code>. |
| 18 | In order to integrate LEDs with Android you need to build a shared library that implements this interface. |
| 19 | |
| 20 | The types of logical lights currently supported by Android include: |
| 21 | <ul> |
| 22 | <li>Backlight</li> |
| 23 | <li>Keyboard</li> |
| 24 | <li>Buttons</li> |
| 25 | <li>Battery</li> |
| 26 | <li>Notifications</li> |
| 27 | <li>Attention</li> |
| 28 | </ul> |
| 29 | </p> |
| 30 | |
David Warren | 5c40a48 | 2009-06-05 15:11:21 -0700 | [diff] [blame] | 31 | <a name="androidLightsBuildingDriver"></a><h3>Building a Lights Library</h3> |
Reena Lee | e557a73 | 2009-05-20 08:04:39 -0700 | [diff] [blame] | 32 | <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 |
| 33 | <code>liblights.so</code> so that it will get loaded from <code>/system/lib</code> at runtime. |
| 34 | </p |
| 35 | |
| 36 | |
David Warren | 5c40a48 | 2009-06-05 15:11:21 -0700 | [diff] [blame] | 37 | <a name="androidLightsInterface"></a><h3>Interface</h3> |
Reena Lee | e557a73 | 2009-05-20 08:04:39 -0700 | [diff] [blame] | 38 | |
| 39 | |
| 40 | |
David Warren | 5c40a48 | 2009-06-05 15:11:21 -0700 | [diff] [blame] | 41 | <p><span class="lh3"><a name="androidDoxygenNote"></a></span> |
Reena Lee | e557a73 | 2009-05-20 08:04:39 -0700 | [diff] [blame] | 42 | |
| 43 | <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> |
| 44 | |
| 45 | |
| 46 | <iframe onLoad="resizeDoxFrameHeight();" src="lights_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0" |
| 47 | frameborder="0" style="width:100%;"></iframe> |