1 //******************************************************************
\r
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
\r
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
7 // Licensed under the Apache License, Version 2.0 (the "License");
\r
8 // you may not use this file except in compliance with the License.
\r
9 // You may obtain a copy of the License at
\r
11 // http://www.apache.org/licenses/LICENSE-2.0
\r
13 // Unless required by applicable law or agreed to in writing, software
\r
14 // distributed under the License is distributed on an "AS IS" BASIS,
\r
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 // See the License for the specific language governing permissions and
\r
17 // limitations under the License.
\r
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
21 #ifndef _JNI_NOTIFICATION_COMMON_H_
\r
22 #define _JNI_NOTIFICATION_COMMON_H_
\r
25 #include <android/log.h>
\r
28 #define LOG_TAG "Notification_Common"
\r
30 #define JNI_CURRENT_VERSION JNI_VERSION_1_6
\r
36 #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
\r
37 #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
\r
38 #define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
\r
39 #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
\r
41 #define JNI_EXCEPTION 1000
\r
42 #define JNI_NO_NATIVE_POINTER 1001
\r
43 #define JNI_INVALID_VALUE 1002
\r
45 #define JNI_NS_OK 100
\r
46 #define JNI_NS_ERROR 200
\r
47 #define JNI_NS_SUCCESS 300
\r
48 #define JNI_NS_FAIL 400
\r
49 #define JNI_NS_ALLOW 500
\r
50 #define JNI_NS_DENY 600
\r
52 jobject getNSException(JNIEnv *env, const char *file, const char *functionName, const int line,
\r
53 const int code, const char *message);
\r
54 void throwNSException(JNIEnv *env, jobject ex);
\r
56 #define GetNSException(code, message) getNSException(env, __FILE__, __func__, __LINE__, code, message)
\r
57 #define ThrowNSException(code, message) throwNSException(env, GetNSException(code, message))
\r
59 static const char *NSResultToChar(const int nsresult);
\r
60 int NSExceptionInit(JNIEnv *env);
\r
66 #endif // _JNI_NOTIFICATION_COMMON_H_