@@ -15,79 +15,17 @@ class OSTaskController {
15
15
16
16
static final String OS_PENDING_EXECUTOR = "OS_PENDING_EXECUTOR_" ;
17
17
18
- // Available task for delay
19
- static final String GET_TAGS = "getTags()" ;
20
- static final String SET_SMS_NUMBER = "setSMSNumber()" ;
21
- static final String SET_EMAIL = "setEmail()" ;
22
- static final String LOGOUT_SMS_NUMBER = "logoutSMSNumber()" ;
23
- static final String LOGOUT_EMAIL = "logoutEmail()" ;
24
- static final String SYNC_HASHED_EMAIL = "syncHashedEmail()" ;
25
- static final String SET_EXTERNAL_USER_ID = "setExternalUserId()" ;
26
- static final String SET_SUBSCRIPTION = "setSubscription()" ;
27
- static final String PROMPT_LOCATION = "promptLocation()" ;
28
- static final String IDS_AVAILABLE = "idsAvailable()" ;
29
- static final String SEND_TAG = "sendTag()" ;
30
- static final String SEND_TAGS = "sendTags()" ;
31
- static final String SET_LOCATION_SHARED = "setLocationShared()" ;
32
- static final String SET_REQUIRES_USER_PRIVACY_CONSENT = "setRequiresUserPrivacyConsent()" ;
33
- static final String UNSUBSCRIBE_WHEN_NOTIFICATION_ARE_DISABLED = "unsubscribeWhenNotificationsAreDisabled()" ;
34
- static final String HANDLE_NOTIFICATION_OPEN = "handleNotificationOpen()" ;
35
- static final String CLEAR_NOTIFICATIONS = "clearOneSignalNotifications()" ;
36
- static final String REMOVE_GROUPED_NOTIFICATIONS = "removeGroupedNotifications()" ;
37
- static final String REMOVE_NOTIFICATION = "removeNotification()" ;
38
- static final String PAUSE_IN_APP_MESSAGES = "pauseInAppMessages()" ;
39
- static final String APP_LOST_FOCUS = "onAppLostFocus()" ;
40
- static final String SEND_OUTCOME = "sendOutcome()" ;
41
- static final String SEND_UNIQUE_OUTCOME = "sendUniqueOutcome()" ;
42
- static final String SEND_OUTCOME_WITH_VALUE = "sendOutcomeWithValue()" ;
43
- static final HashSet <String > METHODS_AVAILABLE_FOR_DELAY = new HashSet <>(Arrays .asList (
44
- GET_TAGS ,
45
- SET_SMS_NUMBER ,
46
- SET_EMAIL ,
47
- LOGOUT_SMS_NUMBER ,
48
- LOGOUT_EMAIL ,
49
- SYNC_HASHED_EMAIL ,
50
- SET_EXTERNAL_USER_ID ,
51
- SET_SUBSCRIPTION ,
52
- PROMPT_LOCATION ,
53
- IDS_AVAILABLE ,
54
- SEND_TAG ,
55
- SEND_TAGS ,
56
- SET_LOCATION_SHARED ,
57
- SET_REQUIRES_USER_PRIVACY_CONSENT ,
58
- UNSUBSCRIBE_WHEN_NOTIFICATION_ARE_DISABLED ,
59
- HANDLE_NOTIFICATION_OPEN ,
60
- APP_LOST_FOCUS ,
61
- SEND_OUTCOME ,
62
- SEND_UNIQUE_OUTCOME ,
63
- SEND_OUTCOME_WITH_VALUE ,
64
- REMOVE_GROUPED_NOTIFICATIONS ,
65
- REMOVE_NOTIFICATION ,
66
- CLEAR_NOTIFICATIONS
67
- ));
68
-
69
18
// The concurrent queue in which we pin pending tasks upon finishing initialization
70
19
private final ConcurrentLinkedQueue <Runnable > taskQueueWaitingForInit = new ConcurrentLinkedQueue <>();
71
20
private final AtomicLong lastTaskId = new AtomicLong ();
72
21
private ExecutorService pendingTaskExecutor ;
73
22
74
- private final OSLogger logger ;
75
- private final OSRemoteParamController paramController ;
23
+ protected final OSLogger logger ;
76
24
77
- OSTaskController (OSRemoteParamController paramController , OSLogger logger ) {
78
- this .paramController = paramController ;
25
+ OSTaskController (OSLogger logger ) {
79
26
this .logger = logger ;
80
27
}
81
28
82
- /**
83
- * Check if task should be queue
84
- *
85
- * @return true if remote params aren't available and current method needs them otherwise false
86
- * */
87
- boolean shouldQueueTaskForInit (String task ) {
88
- return !paramController .isRemoteParamsCallDone () && METHODS_AVAILABLE_FOR_DELAY .contains (task );
89
- }
90
-
91
29
boolean shouldRunTaskThroughQueue () {
92
30
// Don't schedule again a running pending task
93
31
if (Thread .currentThread ().getName ().contains (OS_PENDING_EXECUTOR ))
0 commit comments