Add clarifying comments based on code review feedback

Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-15 11:12:02 +00:00
parent 79bdc73444
commit be7351d683
@@ -133,8 +133,9 @@ public class ApplicationContext extends MultiDexApplication {
}
/**
* Set DcContext instance. This should only be called by AccountManager.
* This method is thread-safe.
* Set DcContext instance. This should only be called by AccountManager when switching accounts,
* which only happens after initial initialization is complete.
* This method is thread-safe but does NOT trigger initialization or notify waiting threads.
*/
public void setDcContext(DcContext context) {
synchronized (initLock) {
@@ -268,6 +269,8 @@ public class ApplicationContext extends MultiDexApplication {
@Override
public void onAvailable(@NonNull android.net.Network network) {
Log.i("DeltaChat", "++++++++++++++++++ NetworkCallback.onAvailable() #" + debugOnAvailableCount++);
// getDcAccounts() will wait for initialization to complete before calling maybeNetwork()
// This is intentional - early network events should wait for proper initialization
getDcAccounts().maybeNetwork();
}