1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <string> |
|
19 #include "com_nokia_mj_impl_javacontrolpanel_SecurityConfig.h" |
|
20 #include "javajniutils.h" |
|
21 |
|
22 #ifdef __SYMBIAN32__ |
|
23 #include "security.h" |
|
24 #endif |
|
25 |
|
26 /* |
|
27 * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig |
|
28 * Method: _getSecurityWarningsMode |
|
29 * Signature: ()Ljava/lang/String; |
|
30 */ |
|
31 JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1getSecurityWarningsMode |
|
32 (JNIEnv* aEnv, jobject) |
|
33 { |
|
34 #ifdef __SYMBIAN32__ |
|
35 Security security; |
|
36 std::wstring mode = security.getSecurityWarningsMode(); |
|
37 return java::util::JniUtils::wstringToJstring(aEnv, mode); |
|
38 #else |
|
39 return java::util::JniUtils::wstringToJstring(aEnv, L"2");; |
|
40 #endif |
|
41 } |
|
42 |
|
43 /* |
|
44 * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig |
|
45 * Method: _setSecurityWarningsMode |
|
46 * Signature: (Ljava/lang/String;)V |
|
47 */ |
|
48 JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1setSecurityWarningsMode |
|
49 (JNIEnv* aEnv, jobject, jstring aMode) |
|
50 { |
|
51 #ifdef __SYMBIAN32__ |
|
52 Security security; |
|
53 std::wstring mode = java::util::JniUtils::jstringToWstring(aEnv, aMode); |
|
54 security.setSecurityWarningsMode(mode); |
|
55 #endif |
|
56 } |
|
57 |
|
58 /* |
|
59 * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig |
|
60 * Method: _getSecurityPolicy |
|
61 * Signature: ()I |
|
62 */ |
|
63 JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1getSecurityPolicy |
|
64 (JNIEnv *, jobject) |
|
65 { |
|
66 #ifdef __SYMBIAN32__ |
|
67 Security security; |
|
68 return security.getSecurityPolicy(); |
|
69 #else |
|
70 return 1; |
|
71 #endif |
|
72 } |
|
73 |
|
74 /* |
|
75 * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig |
|
76 * Method: _setSecurityPolicy |
|
77 * Signature: (I)V |
|
78 */ |
|
79 JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1setSecurityPolicy |
|
80 (JNIEnv *, jobject, jint aPolicyId) |
|
81 { |
|
82 #ifdef __SYMBIAN32__ |
|
83 Security security; |
|
84 security.setSecurityPolicy(aPolicyId); |
|
85 #endif |
|
86 } |
|
87 |
|