diff --git a/services/inputflinger/Android.mk b/services/inputflinger/Android.mk index 574c14e36..2edc07da1 100644 --- a/services/inputflinger/Android.mk +++ b/services/inputflinger/Android.mk @@ -27,6 +27,7 @@ LOCAL_SRC_FILES:= \ LOCAL_SHARED_LIBRARIES := \ libbinder \ + libcrypto \ libcutils \ libinput \ liblog \ @@ -38,6 +39,9 @@ LOCAL_SHARED_LIBRARIES := \ # TODO: Move inputflinger to its own process and mark it hidden #LOCAL_CFLAGS += -fvisibility=hidden +LOCAL_C_INCLUDES := \ + external/openssl/include \ + LOCAL_CFLAGS += -Wno-unused-parameter LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) diff --git a/services/inputflinger/EventHub.cpp b/services/inputflinger/EventHub.cpp index f27463134..dfe5d3de6 100644 --- a/services/inputflinger/EventHub.cpp +++ b/services/inputflinger/EventHub.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -41,6 +40,7 @@ #include #include +#include #include #include #include @@ -80,14 +80,14 @@ static inline const char* toString(bool value) { } static String8 sha1(const String8& in) { - SHA1_CTX ctx; - SHA1Init(&ctx); - SHA1Update(&ctx, reinterpret_cast(in.string()), in.size()); - u_char digest[SHA1_DIGEST_LENGTH]; - SHA1Final(digest, &ctx); + SHA_CTX ctx; + SHA1_Init(&ctx); + SHA1_Update(&ctx, reinterpret_cast(in.string()), in.size()); + u_char digest[SHA_DIGEST_LENGTH]; + SHA1_Final(digest, &ctx); String8 out; - for (size_t i = 0; i < SHA1_DIGEST_LENGTH; i++) { + for (size_t i = 0; i < SHA_DIGEST_LENGTH; i++) { out.appendFormat("%02x", digest[i]); } return out;