mirror of
https://github.com/ioacademy-jikim/android_framwork.git
synced 2026-08-11 16:32:55 +00:00
12
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_SHARED_LIBRARIES = liblog libutils libhidlbase android.hardware.light@2.0
|
||||
LOCAL_SRC_FILES := light_client.cpp
|
||||
LOCAL_MODULE := light_client
|
||||
include $(BUILD_EXECUTABLE)
|
||||
@@ -0,0 +1,38 @@
|
||||
#include <android-base/logging.h>
|
||||
#include <android/hardware/light/2.0/ILight.h>
|
||||
#include <android/hardware/light/2.0/types.h>
|
||||
#include <set>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
using ::android::hardware::light::V2_0::Brightness;
|
||||
using ::android::hardware::light::V2_0::Flash;
|
||||
using ::android::hardware::light::V2_0::ILight;
|
||||
using ::android::hardware::light::V2_0::LightState;
|
||||
using ::android::hardware::light::V2_0::Status;
|
||||
using ::android::hardware::light::V2_0::Type;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::sp;
|
||||
|
||||
|
||||
const static LightState kWhite = {
|
||||
.color = 0xFFFFFFFF,
|
||||
.flashMode = Flash::TIMED,
|
||||
.flashOnMs = 100,
|
||||
.flashOffMs = 50,
|
||||
.brightnessMode = Brightness::USER,
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
sp<ILight> light;
|
||||
light = ILight::getService();
|
||||
Return<Status> ret = light->setLight( Type::BACKLIGHT, kWhite);
|
||||
//if( ret.isOk() == false )
|
||||
// return -1;
|
||||
//if( Status::SUCCESS == static_cast<Status>(ret) )
|
||||
// return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user