1/* 2** 3** Copyright 2017, The Android Open Source Project 4** 5** This file is dual licensed. It may be redistributed and/or modified 6** under the terms of the Apache 2.0 License OR version 2 of the GNU 7** General Public License. 8*/ 9 10#ifndef _LIBS_LOG_SAFETYNET_H 11#define _LIBS_LOG_SAFETYNET_H 12 13#ifdef __cplusplus 14extern "C" { 15#endif 16 17#ifndef _ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 18#ifndef __ANDROID_API__ 19#define __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 1 20#elif __ANDROID_API__ > 22 /* > Lollipop */ 21#define __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 1 22#else 23#define __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 0 24#endif 25#endif 26 27#if __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 28 29#define android_errorWriteLog(tag, subTag) \ 30 __android_log_error_write(tag, subTag, -1, NULL, 0) 31 32#define android_errorWriteWithInfoLog(tag, subTag, uid, data, dataLen) \ 33 __android_log_error_write(tag, subTag, uid, data, dataLen) 34 35int __android_log_error_write(int tag, const char* subTag, int32_t uid, 36 const char* data, uint32_t dataLen); 37 38#endif /* __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE */ 39 40#ifdef __cplusplus 41} 42#endif 43 44#endif /* _LIBS_LOG_SAFETYNET_H */ 45