From ab10e44b3f6cebc3a25ce80880d399acc9a844dc Mon Sep 17 00:00:00 2001 From: Nikhar Agrawal Date: Thu, 4 Jun 2020 14:20:52 +0000 Subject: [PATCH] Allow blocking calls to BackupTransport as a temporary measure To protect system stability, any Binder calls leaving the system_server should be one way. The ideal solution would require redesigning the IBackupTransport interface which might be a major undertaking. But meanwhile, we still need to continue making these calls. So, as a temporary measure, this CL allows blocking calls to be made. The long term solution of redesigning the interface so as to make the calls non-blocking can continue to be tracked on the same bug. Bug: 147702043 Test: atest TransportManagerTest Change-Id: I5c7ec5b26d6ad06608576e4d98dd439992ae7dfe --- .../java/com/android/server/backup/TransportManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/backup/backuplib/java/com/android/server/backup/TransportManager.java b/services/backup/backuplib/java/com/android/server/backup/TransportManager.java index 30ce4cf2fd3fd..b1c356a57f507 100644 --- a/services/backup/backuplib/java/com/android/server/backup/TransportManager.java +++ b/services/backup/backuplib/java/com/android/server/backup/TransportManager.java @@ -28,6 +28,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.os.Binder; import android.os.Bundle; import android.os.RemoteException; import android.util.ArrayMap; @@ -650,6 +651,10 @@ public class TransportManager { int result; try { + // This is a temporary fix to allow blocking calls. + // TODO: b/147702043. Redesign IBackupTransport so as to make the calls non-blocking. + Binder.allowBlocking(transport.asBinder()); + String transportName = transport.name(); String transportDirName = transport.transportDirName(); registerTransport(transportComponent, transport);