2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
light_state_t 구조체 참조
#include <
lights.h
>
특정 조명에 설정할 수 있는 매개변수입니다.
일부 조명은 모든 매개변수를 지원하지 않을 수 있습니다. 하위 호환 방식으로 할 수 있다면 그렇게 해야 합니다.
lights.h
파일의
145
라인에 정의가 있습니다.
프레임워크에서 조명의 밝기를 관리하는 데 사용되는 정책입니다. 현재 값은 BRIGHTNESS_MODE_USER 및 BRIGHTNESS_MODE_SENSOR입니다.
lights.h
파일의
173
줄에 있는 정의입니다.
ARGB의 LED 색상입니다.
최선을 다하세요.
-
조명이 빨간색 또는 녹색만 표시할 수 있는 경우 사용자가 파란색을 요청하면 녹색으로 설정해야 합니다.
-
밝기 램프만 실행할 수 있는 경우 다음 수식을 사용하세요. unsigned char brightness = ((77*((color>>16)&0x00ff))
-
(150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8;
-
켜거나 끌 수만 있다면 0은 꺼짐이고 그 외의 값은 켜짐입니다.
상위 바이트는 무시해야 합니다. 호출자는 이 값을 0xff (255 알파에 해당)로 설정합니다.
lights.h
파일의
160
행에 정의가 있습니다.
이 구조체에 관한 문서는 다음 파일에서 생성되었습니다.
-
hardware/libhardware/include/hardware/
lights.h
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Android Hardware Abstraction Layer: light_state_t Struct Reference\n\nlight_state_t Struct Reference\n==============================\n\n[Data Fields](#pub-attribs) \nlight_state_t Struct Reference \n\n`\n#include \u003c\n`[lights.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)`\n\u003e\n`\n\n|--------------|------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| unsigned int | [color](/reference/hal/structlight__state__t#aeedc2afa1e522527db2235d0700a3b0d) |\n| ||\n| int | [flashMode](/reference/hal/structlight__state__t#a1376dc4ef9189c6481681f82162911d5) |\n| ||\n| int | [flashOnMS](/reference/hal/structlight__state__t#a11119999eaf9274b752598740c137eee) |\n| ||\n| int | [flashOffMS](/reference/hal/structlight__state__t#a2a43b5608c96a4ce53d78e11cd718cf3) |\n| ||\n| int | [brightnessMode](/reference/hal/structlight__state__t#a29e93d1b3731de25515a118d9818517f) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nThe parameters that can be set for a given light.\n\n\nNot all lights must support all parameters. If you can do something backward-compatible, you should.\n\n\nDefinition at line\n[145](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\nof file\n[lights.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\n.\n\nField Documentation\n-------------------\n\n\n|--------------------|\n| int brightnessMode |\n\n\nPolicy used by the framework to manage the light's brightness. Currently the values are BRIGHTNESS_MODE_USER and BRIGHTNESS_MODE_SENSOR.\n\n\nDefinition at line\n[173](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\nof file\n[lights.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\n.\n\n|--------------------|\n| unsigned int color |\n\n\nThe color of the LED in ARGB.\n\n\nDo your best here.\n\n- If your light can only do red or green, if they ask for blue, you should do green.\n- If you can only do a brightness ramp, then use this formula: unsigned char brightness = ((77\\*((color\\\u003e\\\u003e16)\\&0x00ff))\n - (150\\*((color\\\u003e\\\u003e8)\\&0x00ff)) + (29\\*(color\\&0x00ff))) \\\u003e\\\u003e 8;\n- If you can only do on or off, 0 is off, anything else is on.\n\n\nThe high byte should be ignored. Callers will set it to 0xff (which would correspond to 255 alpha).\n\n\nDefinition at line\n[160](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\nof file\n[lights.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\n.\n\n|---------------|\n| int flashMode |\n\n\nSee the LIGHT_FLASH_\\* constants\n\n\nDefinition at line\n[165](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\nof file\n[lights.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\n.\n\n|----------------|\n| int flashOffMS |\n\n\nDefinition at line\n[167](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\nof file\n[lights.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\n.\n\n|---------------|\n| int flashOnMS |\n\n\nDefinition at line\n[166](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\nof file\n[lights.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [lights.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h)"]]