forked from LeddaZ/frameworks_base
Revert "Run callback registration on the worker provided by the client."
This reverts commit 1b917593dd
.
Reason for revert: Causes NPE in internalRegisterCallback, probably a race condition.
Bug: b/369292752
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:673f9e5c8550e1205749ab8e8f4189e4778f6d03)
Merged-In: Ic58e7eee51e0f3a15d62ca6e5db85f1b291bd865
Change-Id: Ic58e7eee51e0f3a15d62ca6e5db85f1b291bd865
This commit is contained in:
parent
2929587922
commit
6be7b33543
|
@ -173,10 +173,6 @@ public class SharedConnectivityManager {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Executor getExecutor() {
|
||||
return mExecutor;
|
||||
}
|
||||
}
|
||||
|
||||
private ISharedConnectivityService mService;
|
||||
|
@ -192,7 +188,7 @@ public class SharedConnectivityManager {
|
|||
private final String mServicePackageName;
|
||||
private final String mIntentAction;
|
||||
private ServiceConnection mServiceConnection;
|
||||
private final UserManager mUserManager;
|
||||
private UserManager mUserManager;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link SharedConnectivityManager}.
|
||||
|
@ -320,19 +316,15 @@ public class SharedConnectivityManager {
|
|||
|
||||
private void registerCallbackInternal(SharedConnectivityClientCallback callback,
|
||||
SharedConnectivityCallbackProxy proxy) {
|
||||
proxy.getExecutor().execute(
|
||||
() -> {
|
||||
try {
|
||||
mService.registerCallback(proxy);
|
||||
synchronized (mProxyDataLock) {
|
||||
mProxyMap.put(callback, proxy);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Exception in registerCallback", e);
|
||||
callback.onRegisterCallbackFailed(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
try {
|
||||
mService.registerCallback(proxy);
|
||||
synchronized (mProxyDataLock) {
|
||||
mProxyMap.put(callback, proxy);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Exception in registerCallback", e);
|
||||
callback.onRegisterCallbackFailed(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue