@@ -1431,7 +1431,7 @@ private void initializeSession(ServerRequestInitSession initRequest, int delay)
14311431 if (forceBranchSession && intent != null ) {
14321432 intent .removeExtra (Defines .IntentKeys .ForceNewBranchSession .getKey ()); // SDK-881, avoid double initialization
14331433 }
1434- registerAppInit (initRequest , false , forceBranchSession );
1434+ registerAppInit (initRequest , forceBranchSession );
14351435 } else if (initRequest .callback_ != null ) {
14361436 // Else, let the user know session initialization failed because it's already initialized.
14371437 initRequest .callback_ .onInitFinished (null , new BranchError ("Warning." , BranchError .ERR_BRANCH_ALREADY_INITIALIZED ));
@@ -1442,7 +1442,7 @@ private void initializeSession(ServerRequestInitSession initRequest, int delay)
14421442 * Registers app init with params filtered from the intent. Unless ignoreIntent = true, this
14431443 * will wait on the wait locks to complete any pending operations
14441444 */
1445- void registerAppInit (@ NonNull ServerRequestInitSession request , boolean ignoreWaitLocks , boolean forceBranchSession ) {
1445+ void registerAppInit (@ NonNull ServerRequestInitSession request , boolean forceBranchSession ) {
14461446 BranchLogger .v ("registerAppInit " + request );
14471447 setInitState (SESSION_STATE .INITIALISING );
14481448
@@ -1464,38 +1464,37 @@ void registerAppInit(@NonNull ServerRequestInitSession request, boolean ignoreWa
14641464 }
14651465 BranchLogger .v ("Finished ordering init calls" );
14661466 requestQueue_ .printQueue ();
1467- initTasks (request , ignoreWaitLocks );
1467+ initTasks (request );
14681468
14691469 requestQueue_ .processNextQueueItem ("registerAppInit" );
14701470 }
14711471
1472- private void initTasks (ServerRequest request , boolean ignoreWaitLocks ) {
1473- BranchLogger .v ("initTasks " + request + " ignoreWaitLocks " + ignoreWaitLocks );
1474- if (!ignoreWaitLocks ) {
1475- // Single top activities can be launched from stack and there may be a new intent provided with onNewIntent() call.
1476- // In this case need to wait till onResume to get the latest intent. Bypass this if bypassWaitingForIntent_ is true.
1477- if (intentState_ != INTENT_STATE .READY && isWaitingForIntent ()) {
1478- BranchLogger .v ("Adding INTENT_PENDING_WAIT_LOCK" );
1479- request .addProcessWaitLock (ServerRequest .PROCESS_WAIT_LOCK .INTENT_PENDING_WAIT_LOCK );
1480- }
1481-
1482- request .addProcessWaitLock (ServerRequest .PROCESS_WAIT_LOCK .GAID_FETCH_WAIT_LOCK );
1483-
1484- if (request instanceof ServerRequestRegisterInstall ) {
1485- request .addProcessWaitLock (ServerRequest .PROCESS_WAIT_LOCK .INSTALL_REFERRER_FETCH_WAIT_LOCK );
1486- BranchLogger .v ("Adding INSTALL_REFERRER_FETCH_WAIT_LOCK" );
1487-
1488- deviceInfo_ .getSystemObserver ().fetchInstallReferrer (context_ , new SystemObserver .InstallReferrerFetchEvents (){
1489- @ Override
1490- public void onInstallReferrersFinished () {
1491- request .removeProcessWaitLock (ServerRequest .PROCESS_WAIT_LOCK .INSTALL_REFERRER_FETCH_WAIT_LOCK );
1492- BranchLogger .v ("INSTALL_REFERRER_FETCH_WAIT_LOCK removed" );
1493- requestQueue_ .processNextQueueItem ("onInstallReferrersFinished" );
1494- }
1495- });
1496- }
1472+ private void initTasks (ServerRequest request ) {
1473+ BranchLogger .v ("initTasks " + request );
1474+ // Single top activities can be launched from stack and there may be a new intent provided with onNewIntent() call.
1475+ // In this case need to wait till onResume to get the latest intent. Bypass this if bypassWaitingForIntent_ is true.
1476+ if (intentState_ != INTENT_STATE .READY && isWaitingForIntent ()) {
1477+ request .addProcessWaitLock (ServerRequest .PROCESS_WAIT_LOCK .INTENT_PENDING_WAIT_LOCK );
1478+ BranchLogger .v ("Added INTENT_PENDING_WAIT_LOCK" );
1479+ }
1480+
1481+ if (request instanceof ServerRequestRegisterInstall ) {
1482+ request .addProcessWaitLock (ServerRequest .PROCESS_WAIT_LOCK .INSTALL_REFERRER_FETCH_WAIT_LOCK );
1483+ BranchLogger .v ("Added INSTALL_REFERRER_FETCH_WAIT_LOCK" );
1484+
1485+ deviceInfo_ .getSystemObserver ().fetchInstallReferrer (context_ , new SystemObserver .InstallReferrerFetchEvents () {
1486+ @ Override
1487+ public void onInstallReferrersFinished () {
1488+ request .removeProcessWaitLock (ServerRequest .PROCESS_WAIT_LOCK .INSTALL_REFERRER_FETCH_WAIT_LOCK );
1489+ BranchLogger .v ("INSTALL_REFERRER_FETCH_WAIT_LOCK removed" );
1490+ requestQueue_ .processNextQueueItem ("onInstallReferrersFinished" );
1491+ }
1492+ });
14971493 }
14981494
1495+ request .addProcessWaitLock (ServerRequest .PROCESS_WAIT_LOCK .GAID_FETCH_WAIT_LOCK );
1496+ BranchLogger .v ("Added GAID_FETCH_WAIT_LOCK" );
1497+
14991498 deviceInfo_ .getSystemObserver ().fetchAdId (context_ , new SystemObserver .AdsParamsFetchEvents () {
15001499 @ Override
15011500 public void onAdsParamsFetchFinished () {
0 commit comments