-
- All Implemented Interfaces:
-
java.util.concurrent.Callable,kotlin.Comparable
public final class FetchAdvertisingIdTask extends Task<AdvertisingIdData>
Queue task that fetches Advertising Ids. The priority of this task is 1 (highest) and should run as soon as the SDK is initialized. This task fetches the GAID using GMS and Samsung Cloud SDK. (depends on the env and manifest flag). The timeout of this class is 1 sec and can be overridden by a manifest flag. The retry mechanism of this task is part of the task execution, so no retry for this task in case of failure.
Next stage: implement OAID and Amazon ID fetching as part of this task. (Skeleton already available)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classFetchAdvertisingIdTask.Companion
-
Field Summary
Fields Modifier and Type Field Description private final AdvertisingIdDataresultprivate final Set<TaskType>dependenciesprivate final Set<TaskType>softDependenciesprivate final Integerorderprivate LongexecutionTimeprivate ThrowableexecutionErrorprivate volatile IntegerretryCountprivate final TaskTypetype
-
Constructor Summary
Constructors Constructor Description FetchAdvertisingIdTask(ServiceLocator serviceLocator)
-
Method Summary
Modifier and Type Method Description AdvertisingIdDatagetResult()final Set<TaskType>getDependencies()final Set<TaskType>getSoftDependencies()final IntegergetOrder()Chronological order in which the task object was created. final LonggetExecutionTime()final UnitsetExecutionTime(Long executionTime)final ThrowablegetExecutionError()Error which happened during task execution, or nullif the task was successful.final UnitsetExecutionError(Throwable executionError)final IntegergetRetryCount()Number of times the task was executed, INCLUDING the initial try. final UnitsetRetryCount(Integer retryCount)final TaskTypegetType()LonggetExecutionTimeout()Total timeout for the current task, including all immediate retries. QueueResultinternalExecute()Execute the actual job; called synchronously on the background thread. -
Methods inherited from class com.appsflyer.internal.components.queue.tasks.FetchAdvertisingIdTask
addDependency, addSoftDependency, call, compareTo, equals, executionResult, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
FetchAdvertisingIdTask
FetchAdvertisingIdTask(ServiceLocator serviceLocator)
-
-
Method Detail
-
getResult
AdvertisingIdData getResult()
-
getDependencies
final Set<TaskType> getDependencies()
-
getSoftDependencies
final Set<TaskType> getSoftDependencies()
-
getOrder
final Integer getOrder()
Chronological order in which the task object was created. Required to support natural ordering in the Queue SkipListSet: two tasks of the same type and priority — the first one has the smaller order.
-
getExecutionTime
final Long getExecutionTime()
-
setExecutionTime
final Unit setExecutionTime(Long executionTime)
-
getExecutionError
final Throwable getExecutionError()
Error which happened during task execution, or
nullif the task was successful.
-
setExecutionError
final Unit setExecutionError(Throwable executionError)
-
getRetryCount
final Integer getRetryCount()
Number of times the task was executed, INCLUDING the initial try. E.g. if the task succeeded on the first try this returns 1.
-
setRetryCount
final Unit setRetryCount(Integer retryCount)
-
getExecutionTimeout
Long getExecutionTimeout()
Total timeout for the current task, including all immediate retries. Once execution starts the task should expect a thread interrupt when this timeout elapses.
-
internalExecute
QueueResult internalExecute()
Execute the actual job; called synchronously on the background thread.
Important: implementations must check for thread interruption to support task timeout — see getExecutionTimeout. That is, you should check Thread.isInterrupted and must not catch InterruptedException; when interruption is observed the task is expected to return QueueResult.TIMEOUT.
-
-
-
-