CommunalBackup: Drop usages of runBlocking
- This commit refactors the Communal backup and restore mechanism to eliminate runBlocking calls where possible, leveraging asynchronous coroutines instead. - Previously, CommunalBackupHelper and CommunalBackupUtils used runBlocking to retrieve the communal hub state. This approach forces the calling thread to block until the data is fetched from the database. - performBackup now uses bgScope.launch to call the now-suspending getCommunalHubState() method on CommunalBackupUtils. This ensures the backup process runs asynchronously without blocking the BackupHelper thread. Bug: 423462317 Flag: com.android.systemui.do_not_use_run_blocking Test: atest CommunalBackupHelperTest CommunalBackupUtilsTest Change-Id: I63200529aaf0f04a8f9f5b139d548ffb38f8f5a4
Loading
Please register or sign in to comment