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

Commit 1b917593 authored by Isaac Katzenelson's avatar Isaac Katzenelson
Browse files

Run callback registration on the worker provided by the client.

Since the worker is provided in the callback proxy object, added a
method to get the worker.

Flag: EXEMPT bugfix

Bug: 351495492
Test: atest SharedConnectivityManagerTest
Change-Id: If5eaa939419503121708ac746354a6159543e6df
parent 2a48266b
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -173,6 +173,10 @@ public class SharedConnectivityManager {
                }
            }
        }

        Executor getExecutor() {
            return mExecutor;
        }
    }

    private ISharedConnectivityService mService;
@@ -188,7 +192,7 @@ public class SharedConnectivityManager {
    private final String mServicePackageName;
    private final String mIntentAction;
    private ServiceConnection mServiceConnection;
    private UserManager mUserManager;
    private final UserManager mUserManager;

    /**
     * Creates a new instance of {@link SharedConnectivityManager}.
@@ -316,6 +320,8 @@ public class SharedConnectivityManager {

    private void registerCallbackInternal(SharedConnectivityClientCallback callback,
            SharedConnectivityCallbackProxy proxy) {
        proxy.getExecutor().execute(
                () -> {
                    try {
                        mService.registerCallback(proxy);
                        synchronized (mProxyDataLock) {
@@ -326,6 +332,8 @@ public class SharedConnectivityManager {
                        callback.onRegisterCallbackFailed(e);
                    }
                }
        );
    }

    /**
     * @hide