Merge "Remove the input consumer surfaces when the consumer is disposed" into rvc-dev

This commit is contained in:
Winson Chung
2020-04-03 21:32:17 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 4 deletions

View File

@@ -153,10 +153,11 @@ class InputConsumerImpl implements IBinder.DeathRecipient {
t.reparent(mInputSurface, wc.getSurfaceControl());
}
void disposeChannelsLw() {
void disposeChannelsLw(SurfaceControl.Transaction t) {
mService.mInputManager.unregisterInputChannel(mServerChannel);
mClientChannel.dispose();
mServerChannel.dispose();
t.remove(mInputSurface);
unlinkFromDeathRecipient();
}

View File

@@ -112,8 +112,9 @@ final class InputMonitor {
@Override
public void dispose() {
synchronized (mService.mGlobalLock) {
disposeChannelsLw();
disposeChannelsLw(mInputMonitor.mInputTransaction);
mInputEventReceiver.dispose();
mInputMonitor.updateInputWindowsLw(true /* force */);
}
}
}
@@ -195,8 +196,7 @@ final class InputMonitor {
private boolean disposeInputConsumer(InputConsumerImpl consumer) {
if (consumer != null) {
consumer.disposeChannelsLw();
consumer.hide(mInputTransaction);
consumer.disposeChannelsLw(mInputTransaction);
return true;
}
return false;