Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab10e44b authored by Nikhar Agrawal's avatar Nikhar Agrawal
Browse files

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
parent 4bf5126d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);