|
1 /* |
|
2 * Copyright (c) 2008 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 package com.nokia.mj.impl.security.utils; |
|
19 |
|
20 import com.nokia.mj.impl.utils.LocalizedTextProvider; |
|
21 import com.nokia.mj.impl.utils.ResourceLoader; |
|
22 |
|
23 public class SecurityPromptMessage extends LocalizedTextProvider |
|
24 { |
|
25 /** Singleton instance of SecurityPromptMessage. */ |
|
26 private static SecurityPromptMessage self = null; |
|
27 /** ResourceLoader for fetching localised texts. */ |
|
28 private static ResourceLoader iRes = null; |
|
29 |
|
30 // identifiers for the security prompt questions |
|
31 public static final String QUESTION_ID_NETWORK_USAGE = "network_usage"; |
|
32 public static final String QUESTION_ID_SMS_OPENING_CONN = "sms_opening_conn"; |
|
33 public static final String QUESTION_ID_MMS_OPENING_CONN = "mms_opening_conn"; |
|
34 public static final String QUESTION_ID_CBS_OPENING_CONN = "cbs_opening_conn"; |
|
35 public static final String QUESTION_ID_SMS_RECEIVING = "sms_receiving"; |
|
36 public static final String QUESTION_ID_MMS_RECEIVING = "mms_receiving"; |
|
37 public static final String QUESTION_ID_CBS_RECEIVING = "cbs_receiving"; |
|
38 public static final String QUESTION_ID_SMS_SENDING = "sms_sending"; |
|
39 public static final String QUESTION_ID_SMS_SINGLE_SENDING = "sms_single_sending"; |
|
40 public static final String QUESTION_ID_MMS_SENDING = "mms_sending"; |
|
41 public static final String QUESTION_ID_MMS_SINGLE_SENDING = "mms_single_sending"; |
|
42 public static final String QUESTION_ID_MMS_SINGLE_SENDING_MULTIPLE_DESTINATIONS = "mms_single_sending_multiple_destinations"; |
|
43 public static final String QUESTION_ID_SEND_RECEIVE_MESSAGES = "receive_send_messages"; |
|
44 public static final String QUESTION_ID_LOCAL_CONNECTIVITY = "local_connectivity"; |
|
45 public static final String QUESTION_ID_AUDIO_VIDEO_RECORDING = "audio_video_recording"; |
|
46 public static final String QUESTION_ID_READING_USER_DATA = "reading_user_data"; |
|
47 public static final String QUESTION_ID_WRITING_USER_DATA = "writing_user_data"; |
|
48 public static final String QUESTION_ID_READING_FILE = "reading_file"; |
|
49 public static final String QUESTION_ID_MANAGE_USER_DATA = "manage_user_data"; |
|
50 public static final String QUESTION_ID_MODIFYING_FILE = "modifying_file"; |
|
51 public static final String QUESTION_ID_READING_LOCATION_DATA = "reading_location_data"; |
|
52 public static final String QUESTION_ID_READING_LANDMARK_DATA = "reading_landmark_data"; |
|
53 public static final String QUESTION_ID_READING_SMARTCARD = "reading_smartcard"; |
|
54 public static final String QUESTION_ID_AUTH_SERVICES_USAGE = "auth_services_usage"; |
|
55 public static final String QUESTION_ID_BLUETOOTH_USAGE = "bluetooth_usage"; |
|
56 public static final String QUESTION_ID_READING_CONTACTS = "reading_contacts"; |
|
57 public static final String QUESTION_ID_MODIFYING_CONTACTS = "modifying_contacts"; |
|
58 public static final String QUESTION_ID_READING_EVENTS = "reading_events"; |
|
59 public static final String QUESTION_ID_MODIFYING_EVENTS = "modifying_events"; |
|
60 public static final String QUESTION_ID_READING_TODOS = "reading_todos"; |
|
61 public static final String QUESTION_ID_MODIFYING_TODOS = "modifying_todos"; |
|
62 public static final String QUESTION_ID_DELETING_ITEM = "deleting_item"; |
|
63 public static final String QUESTION_ID_UPDATING_ITEM = "updating_item"; |
|
64 public static final String QUESTION_ID_DELETING_CATEGORY = "deleting_category"; |
|
65 public static final String QUESTION_ID_UPDATING_CATEGORY = "updating_category"; |
|
66 public static final String QUESTION_ID_DELETING_UNNAMED_ITEM = "deleting_unnamed_item"; |
|
67 public static final String QUESTION_ID_UPDATING_UNNAMED_ITEM = "updating_unnamed_item"; |
|
68 public static final String QUESTION_ID_ADDING_CALENDAR = "adding_calendar"; |
|
69 public static final String QUESTION_ID_DELETING_CALENDAR = "deleting_calendar"; |
|
70 public static final String QUESTION_ID_LISTING_CALENDARS = "listing_calendars"; |
|
71 public static final String QUESTION_ID_ORIENTATION_DATA_USAGE = "orientation_data_usage"; |
|
72 public static final String QUESTION_ID_POSITIONING_DATA_USAGE = "positioning_data_usage"; |
|
73 public static final String QUESTION_ID_LANDMARK_DATA_USAGE = "landmark_data_usage"; |
|
74 public static final String QUESTION_ID_PROXIMITY_LISTENER_REGISTRATION = "proximity_listener_registration"; |
|
75 public static final String QUESTION_ID_MOBITV_DATA_USAGE = "tv_broadcast_user_data_access"; |
|
76 public static final String QUESTION_ID_NETWORK_USAGE_VIA_PLAT_REQ = "network_usage_via_plat_req"; |
|
77 public static final String QUESTION_ID_APP_LAUNCH_VIA_PLAT_REQ = "app_launch_via_plat_req"; |
|
78 public static final String QUESTION_ID_PUSH_STATIC_REGISTRATION = "push_registration_static"; |
|
79 public static final String QUESTION_ID_PUSH_DYNAMIC_REGISTRATION = "push_registration_dynamic"; |
|
80 public static final String QUESTION_ID_AUTO_INVOCATION = "auto_invocation"; |
|
81 public static final String QUESTION_ID_NDEF_TAG_WRITE = "nfc_ndef_tag_write"; |
|
82 |
|
83 // identifiers for the security prompt answer options |
|
84 public static final String ANSWER_ID_ALLOW = "prompt_allow"; |
|
85 public static final String ANSWER_ID_DENY = "prompt_deny"; |
|
86 public static final String ANSWER_ID_YES = "prompt_yes"; |
|
87 public static final String ANSWER_ID_NO = "prompt_no"; |
|
88 |
|
89 // general purpose identifiers |
|
90 public static final String SECURITY_WARNING_ID = "general_warning"; |
|
91 public static final String OCSP_WARNING_ID = "ocsp_warning"; |
|
92 |
|
93 /** |
|
94 * Creates an instance of the SecurityPromptMessage |
|
95 * |
|
96 * @return An instance of SecurityPromptMessage |
|
97 */ |
|
98 public static SecurityPromptMessage getInstance() |
|
99 { |
|
100 if (self == null) |
|
101 { |
|
102 self = new SecurityPromptMessage(); |
|
103 } |
|
104 return self; |
|
105 } |
|
106 |
|
107 /** |
|
108 * Constructor |
|
109 */ |
|
110 private SecurityPromptMessage() |
|
111 { |
|
112 } |
|
113 |
|
114 /** |
|
115 * Returns the localized texts associated with different security prompts |
|
116 * |
|
117 * @param aTextId id for the localized text (one of the pre-defined |
|
118 * constants) |
|
119 * @param aTextParams parameters for the localized text |
|
120 * @return the localized text associated with the provided |
|
121 * identifier and parameters |
|
122 */ |
|
123 public String getText(String aTextId, Object[] aTextParams) |
|
124 { |
|
125 if (iRes == null) |
|
126 { |
|
127 iRes = ResourceLoader.getInstance("javausermessages", "qtn_java_secur_"); |
|
128 } |
|
129 return iRes.format(aTextId, aTextParams); |
|
130 } |
|
131 } |