[core] Fix critical section on send bridge (#842)
This commit is contained in:
parent
39c6802435
commit
45310fc85d
|
|
@ -121,7 +121,7 @@ public class BridgeService {
|
||||||
private static Listener listener;
|
private static Listener listener;
|
||||||
|
|
||||||
// For service
|
// For service
|
||||||
private static void sendToBridge(IBinder binder, boolean isRestart) {
|
private static synchronized void sendToBridge(IBinder binder, boolean isRestart) {
|
||||||
do {
|
do {
|
||||||
bridgeService = ServiceManager.getService(SERVICE_NAME);
|
bridgeService = ServiceManager.getService(SERVICE_NAME);
|
||||||
if (bridgeService != null && bridgeService.pingBinder()) {
|
if (bridgeService != null && bridgeService.pingBinder()) {
|
||||||
|
|
@ -160,6 +160,7 @@ public class BridgeService {
|
||||||
data.writeInt(ACTION.ACTION_SEND_BINDER.ordinal());
|
data.writeInt(ACTION.ACTION_SEND_BINDER.ordinal());
|
||||||
Log.v(TAG, "binder " + binder.toString());
|
Log.v(TAG, "binder " + binder.toString());
|
||||||
data.writeStrongBinder(binder);
|
data.writeStrongBinder(binder);
|
||||||
|
if (bridgeService == null) break;
|
||||||
res = bridgeService.transact(TRANSACTION_CODE, data, reply, 0);
|
res = bridgeService.transact(TRANSACTION_CODE, data, reply, 0);
|
||||||
reply.readException();
|
reply.readException();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue