|
|
@@ -387,18 +387,15 @@ class TaskRunner(
|
|
|
if (rcsNumber.expiryTime.isBefore(LocalDateTime.now())) {
|
|
|
throw RequestNumberException(ErrorCode.CODE_NUMBER_EXPIRED)
|
|
|
}
|
|
|
- var tosAgreeJob: Job? = null
|
|
|
- if (rcsNumber.country.lowercase() == "af") {
|
|
|
- tosAgreeJob = CoroutineScope(coroutineContext).launch {
|
|
|
- run tos@{
|
|
|
- repeat(60 * 1000 / 200) {
|
|
|
- delay(200)
|
|
|
- val traverseResult = TraverseResult()
|
|
|
- screenInspector.traverseNode(traverseResult)
|
|
|
- if (traverseResult.tosAgreeBtn != null) {
|
|
|
- traverseResult.tosAgreeBtn!!.performAction(AccessibilityNodeInfo.ACTION_CLICK)
|
|
|
- return@tos
|
|
|
- }
|
|
|
+ val tosAgreeJob = CoroutineScope(coroutineContext).launch {
|
|
|
+ run tos@{
|
|
|
+ repeat(60 * 1000 / 200) {
|
|
|
+ delay(500)
|
|
|
+ val traverseResult = TraverseResult()
|
|
|
+ screenInspector.traverseNode(traverseResult)
|
|
|
+ if (traverseResult.tosAgreeBtn != null) {
|
|
|
+ traverseResult.tosAgreeBtn!!.performAction(AccessibilityNodeInfo.ACTION_CLICK)
|
|
|
+ return@tos
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -416,7 +413,7 @@ class TaskRunner(
|
|
|
sendOtpTimeout
|
|
|
) != RcsConfigureState.WAITING_FOR_OTP
|
|
|
) {
|
|
|
- tosAgreeJob?.cancel()
|
|
|
+ tosAgreeJob.cancel()
|
|
|
if (!screenController.toggleRcsSwitch(true)) {
|
|
|
throw RequestNumberException(ErrorCode.CODE_RCS_TOGGLED_OFF)
|
|
|
}
|
|
|
@@ -425,7 +422,7 @@ class TaskRunner(
|
|
|
}
|
|
|
throw RequestNumberException(ErrorCode.CODE_OTP_NOT_SENT)
|
|
|
}
|
|
|
- tosAgreeJob?.cancel()
|
|
|
+ tosAgreeJob.cancel()
|
|
|
RcsNumberApi.notifyOtpState(rcsNumber.id)
|
|
|
|
|
|
if (rcsNumber.expiryTime.isBefore(LocalDateTime.now())) {
|