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

Commit c68ecc55 authored by Andrii Kulian's avatar Andrii Kulian
Browse files

Switch exceptions to logs for client controlled bubble requests

If there is an issue with a client request, because the verification
of the params and the state happens on the main executor, an
exception would crash WM Shell instead of being propagated back to
the caller. This is not helpful if the issue is with the client's
request.

Instead switch to logging the error and plan to add a dedicated
callback to inform the clients when the bubbles they requested are
removed by the user.

Bug: 407149510
Test: Use DroidNavigator app and manually remove the bubble
Flag: EXEMPT bugfix
Change-Id: Ib3d5571470251bbe09351e1aa02092b18fc93979
parent 8896a019
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -78,8 +78,8 @@ public class BubbleMultitaskingDelegate extends IMultitaskingDelegate.Stub {
        mMainExecutor.execute(
                () -> {
                    if (getBubbleWithToken(token) != null) {
                        throw new IllegalArgumentException(
                                "Bubble the provided token already exists");
                        Slog.e(TAG, "Skip creating bubble - found one with the same token.");
                        return;
                    }

                    Bubble b = Bubble.createClientControlledAppBubble(bubbleIntent,
@@ -110,8 +110,8 @@ public class BubbleMultitaskingDelegate extends IMultitaskingDelegate.Stub {
        mMainExecutor.execute(
                () -> {
                    if (getBubbleWithToken(token) == null) {
                        throw new IllegalArgumentException(
                                "No existing bubble found with the provided token.");
                        Slog.e(TAG, "Skip updating bubble state - none found for the token.");
                        return;
                    }
                    if (collapse) {
                        mController.collapseStack();
@@ -140,8 +140,8 @@ public class BubbleMultitaskingDelegate extends IMultitaskingDelegate.Stub {
                () -> {
                    final Bubble bubble = getBubbleWithToken(token);
                    if (bubble == null) {
                        throw new IllegalArgumentException(
                                "No existing bubble found with the provided token.");
                        Slog.e(TAG, "Skip updating bubble message - none found for the token.");
                        return;
                    }

                    // Update the flyout message directly.
@@ -177,8 +177,8 @@ public class BubbleMultitaskingDelegate extends IMultitaskingDelegate.Stub {
                () -> {
                    final Bubble bubble = getBubbleWithToken(token);
                    if (bubble == null) {
                        throw new IllegalArgumentException(
                                "No existing bubble found with the provided token.");
                        Slog.e(TAG, "Skip removing bubble - none found for the token.");
                        return;
                    }

                    mController.removeBubble(bubble.getKey(), DISMISS_NO_LONGER_BUBBLE);