1
1
package com .instabug .instabugflutter ;
2
2
3
- import android .support .annotation .Nullable ;
4
- import android .support .annotation .VisibleForTesting ;
5
-
6
3
import com .instabug .bug .BugReporting ;
7
4
import com .instabug .bug .invocation .Option ;
8
5
import com .instabug .library .ActionType ;
48
45
@ SuppressWarnings ({"SameParameterValue" , "unchecked" })
49
46
final class ArgsRegistry {
50
47
51
- @ VisibleForTesting
52
48
static final Map <String , Object > ARGS = new HashMap <>();
53
49
54
50
static {
@@ -77,7 +73,6 @@ final class ArgsRegistry {
77
73
* @param clazz the type in which the value should be deserialized to
78
74
* @return the value deserialized if all the assertions were successful, null otherwise
79
75
*/
80
- @ Nullable
81
76
static <T > T getDeserializedValue (String key , Class <T > clazz ) {
82
77
if (key != null && ARGS .containsKey (key )) {
83
78
Object constant = ARGS .get (key );
@@ -98,15 +93,13 @@ static <T> T getDeserializedValue(String key, Class<T> clazz) {
98
93
* @param key the key whose associated value is to be returned
99
94
* @return the value if all the assertions were successful, null otherwise
100
95
*/
101
- @ Nullable
102
96
static Object getRawValue (String key ) {
103
97
if (key != null ) {
104
98
return ARGS .get (key );
105
99
}
106
100
return null ;
107
101
}
108
102
109
- @ VisibleForTesting
110
103
static void registerInstabugInvocationEventsArgs (Map <String , Object > args ) {
111
104
args .put ("InvocationEvent.twoFingersSwipeLeft" , TWO_FINGER_SWIPE_LEFT );
112
105
args .put ("InvocationEvent.floatingButton" , FLOATING_BUTTON );
@@ -115,34 +108,29 @@ static void registerInstabugInvocationEventsArgs(Map<String, Object> args) {
115
108
args .put ("InvocationEvent.none" , NONE );
116
109
}
117
110
118
- @ VisibleForTesting
119
111
static void registerWelcomeMessageArgs (Map <String , Object > args ) {
120
112
args .put ("WelcomeMessageMode.disabled" , DISABLED );
121
113
args .put ("WelcomeMessageMode.live" , LIVE );
122
114
args .put ("WelcomeMessageMode.beta" , BETA );
123
115
}
124
116
125
- @ VisibleForTesting
126
117
static void registerColorThemeArgs (Map <String , Object > args ) {
127
118
args .put ("ColorTheme.light" , InstabugColorTheme .InstabugColorThemeLight );
128
119
args .put ("ColorTheme.dark" , InstabugColorTheme .InstabugColorThemeDark );
129
120
}
130
121
131
- @ VisibleForTesting
132
122
static void registerInvocationModeArgs (Map <String , Object > args ) {
133
123
args .put ("InvocationMode.bug" , BugReporting .ReportType .BUG );
134
124
args .put ("InvocationMode.feedback" , BugReporting .ReportType .FEEDBACK );
135
125
}
136
126
137
- @ VisibleForTesting
138
127
static void registerInvocationOptionsArgs (Map <String , Object > args ) {
139
128
args .put ("InvocationOption.commentFieldRequired" , Option .COMMENT_FIELD_REQUIRED );
140
129
args .put ("InvocationOption.disablePostSendingDialog" , Option .DISABLE_POST_SENDING_DIALOG );
141
130
args .put ("InvocationOption.emailFieldHidden" , Option .EMAIL_FIELD_HIDDEN );
142
131
args .put ("InvocationOption.emailFieldOptional" , Option .EMAIL_FIELD_OPTIONAL );
143
132
}
144
133
145
- @ VisibleForTesting
146
134
static void registerLocaleArgs (Map <String , Object > args ) {
147
135
args .put ("Locale.chineseTraditional" , new Locale (TRADITIONAL_CHINESE .getCode (), TRADITIONAL_CHINESE .getCountry ()));
148
136
args .put ("Locale.portuguesePortugal" , new Locale (PORTUGUESE_PORTUGAL .getCode (), PORTUGUESE_PORTUGAL .getCountry ()));
@@ -168,7 +156,6 @@ static void registerLocaleArgs(Map<String, Object> args) {
168
156
args .put ("Locale.czech" , new Locale (CZECH .getCode (), CZECH .getCountry ()));
169
157
}
170
158
171
- @ VisibleForTesting
172
159
static void registerCustomTextPlaceHolderKeysArgs (Map <String , Object > args ) {
173
160
args .put ("IBGCustomTextPlaceHolderKey.shakeHint" , InstabugCustomTextPlaceHolder .Key .SHAKE_HINT );
174
161
args .put ("IBGCustomTextPlaceHolderKey.swipeHint" , InstabugCustomTextPlaceHolder .Key .SWIPE_HINT );
@@ -204,20 +191,17 @@ static void registerCustomTextPlaceHolderKeysArgs(Map<String, Object> args) {
204
191
args .put ("IBGCustomTextPlaceHolderKey.liveWelcomeMessageContent" , InstabugCustomTextPlaceHolder .Key .LIVE_WELCOME_MESSAGE_CONTENT );
205
192
}
206
193
207
- @ VisibleForTesting
208
194
static void registerInstabugReportTypesArgs (Map <String , Object > args ) {
209
195
args .put ("ReportType.bug" , BugReporting .ReportType .BUG );
210
196
args .put ("ReportType.feedback" , BugReporting .ReportType .FEEDBACK );
211
197
}
212
198
213
- @ VisibleForTesting
214
199
static void registerInstabugExtendedBugReportModeArgs (Map <String , Object > args ) {
215
200
args .put ("ExtendedBugReportMode.enabledWithRequiredFields" , ExtendedBugReport .State .ENABLED_WITH_REQUIRED_FIELDS );
216
201
args .put ("ExtendedBugReportMode.enabledWithOptionalFields" , ExtendedBugReport .State .ENABLED_WITH_OPTIONAL_FIELDS );
217
202
args .put ("ExtendedBugReportMode.disabled" ,ExtendedBugReport .State .DISABLED );
218
203
}
219
204
220
- @ VisibleForTesting
221
205
static void registerInstabugActionTypesArgs (Map <String , Object > args ) {
222
206
args .put ("ActionType.allActions" , ActionType .ALL_ACTIONS );
223
207
args .put ("ActionType.reportBug" , ActionType .REPORT_BUG );
0 commit comments