Skip to content

Commit 8184777

Browse files
committed
refactor: simplify user agent processing in DeviceInfo
- Remove manual queue processing triggers after unlocking user agent string lock - Update comments to clarify that modern queue processes automatically after unlock - Streamline the code for better readability and maintainability as part of ongoing SDK modernization efforts
1 parent d1cabe3 commit 8184777

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Branch-SDK/src/main/java/io/branch/referral/DeviceInfo.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private void setPostUserAgent(final JSONObject userDataObj) {
250250
userDataObj.put(Defines.Jsonkey.UserAgent.getKey(), Branch._userAgentString);
251251

252252
Branch.getInstance().requestQueue_.unlockProcessWait(ServerRequest.PROCESS_WAIT_LOCK.USER_AGENT_STRING_LOCK);
253-
Branch.getInstance().requestQueue_.processNextQueueItem("setPostUserAgent");
253+
// Modern queue processes automatically after unlock - no manual trigger needed
254254
}
255255
else if (Branch.userAgentSync) {
256256
// If user agent sync is false, then the async coroutine is executed instead but may not have finished yet.
@@ -277,7 +277,7 @@ public void resumeWith(@NonNull Object o) {
277277
}
278278

279279
Branch.getInstance().requestQueue_.unlockProcessWait(ServerRequest.PROCESS_WAIT_LOCK.USER_AGENT_STRING_LOCK);
280-
Branch.getInstance().requestQueue_.processNextQueueItem("onUserAgentStringFetchFinished");
280+
// Modern queue processes automatically after unlock - no manual trigger needed
281281
}
282282
});
283283
}
@@ -305,15 +305,15 @@ public void resumeWith(@NonNull Object o) {
305305
}
306306

307307
Branch.getInstance().requestQueue_.unlockProcessWait(ServerRequest.PROCESS_WAIT_LOCK.USER_AGENT_STRING_LOCK);
308-
Branch.getInstance().requestQueue_.processNextQueueItem("getUserAgentAsync resumeWith");
308+
// Modern queue processes automatically after unlock - no manual trigger needed
309309
}
310310
});
311311
}
312312
}
313313
catch (Exception exception){
314314
BranchLogger.w("Caught exception trying to set userAgent " + exception.getMessage());
315315
Branch.getInstance().requestQueue_.unlockProcessWait(ServerRequest.PROCESS_WAIT_LOCK.USER_AGENT_STRING_LOCK);
316-
Branch.getInstance().requestQueue_.processNextQueueItem("getUserAgentAsync");
316+
// Modern queue processes automatically after unlock - no manual trigger needed
317317
}
318318
}
319319

0 commit comments

Comments
 (0)