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

Commit d5f9669e authored by Winson Chung's avatar Winson Chung
Browse files

Convert overlapping input consumer exception to warning

- Only SysUI uses this mechanism, and re-registering an input consumer
  with the same name should not result in a crash as we can just replace
  the consumer and log accordingly (cross-user input consumer
  registration is not affected)

Bug: 353903219
Test: Manual, force multiple registrations of the input consumer
Flag: EXEMPT bugfix
Change-Id: I747034f36595ba37c22f7a0cb46ad11238d41296
parent ad216bac
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -222,7 +222,8 @@ final class InputMonitor {
            UserHandle clientUser) {
        final InputConsumerImpl existingConsumer = getInputConsumer(name);
        if (existingConsumer != null && existingConsumer.mClientUser.equals(clientUser)) {
            throw new IllegalStateException("Existing input consumer found with name: " + name
            destroyInputConsumer(existingConsumer.mToken);
            Slog.w(TAG_WM, "Replacing existing input consumer found with name: " + name
                    + ", display: " + mDisplayId + ", user: " + clientUser);
        }