Home | History | Annotate | Download | only in log
      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 #include <stdint.h>
     14 
     15 #ifdef __cplusplus
     16 extern "C" {
     17 #endif
     18 
     19 #ifndef _ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE
     20 #ifndef __ANDROID_API__
     21 #define __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 1
     22 #elif __ANDROID_API__ > 22 /* > Lollipop */
     23 #define __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 1
     24 #else
     25 #define __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 0
     26 #endif
     27 #endif
     28 
     29 #if __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE
     30 
     31 #define android_errorWriteLog(tag, subTag) \
     32   __android_log_error_write(tag, subTag, -1, NULL, 0)
     33 
     34 #define android_errorWriteWithInfoLog(tag, subTag, uid, data, dataLen) \
     35   __android_log_error_write(tag, subTag, uid, data, dataLen)
     36 
     37 int __android_log_error_write(int tag, const char* subTag, int32_t uid,
     38                               const char* data, uint32_t dataLen);
     39 
     40 #endif /* __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE */
     41 
     42 #ifdef __cplusplus
     43 }
     44 #endif
     45 
     46 #endif /* _LIBS_LOG_SAFETYNET_H */
     47