Merge "Ensure waitForIdle() waits until pending messages are handled." into rvc-dev am: 40c41402e4

Change-Id: Id70379d0ff5513591a1ce456df3dbfcc0fc9bcee
This commit is contained in:
Sudheer Shanka
2020-03-27 00:43:50 +00:00
committed by Automerger Merge Worker

View File

@@ -1353,8 +1353,15 @@ public class BlobStoreManagerService extends SystemService {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP,
"Caller is not allowed to call this; caller=" + Binder.getCallingUid()); "Caller is not allowed to call this; caller=" + Binder.getCallingUid());
// We post messages back and forth between mHandler thread and mBackgroundHandler
// thread while committing a blob. We need to replicate the same pattern here to
// ensure pending messages have been handled.
mHandler.post(() -> {
mBackgroundHandler.post(() -> {
mHandler.post(PooledLambda.obtainRunnable(remoteCallback::sendResult, null) mHandler.post(PooledLambda.obtainRunnable(remoteCallback::sendResult, null)
.recycleOnUse()); .recycleOnUse());
});
});
} }
@Override @Override