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

Commit fa4f821b authored by Josh Yang's avatar Josh Yang
Browse files

Check magnification background type before setting corner radius.

Wear OS reuses the same FullscreenMagnificationController class, but it
has a custom layout which doesn't use the same drawable type. This
change adds a type check to prevent runtime crash in Wear OS.

Bug: 362622132
Fix: 362622132
Flag: com.android.systemui.update_corner_radius_on_display_changed
Test: manual test on watch
Change-Id: I3d8898342f4961731cb985b0209e9b0d0c2fa786
parent 8c0d287f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -408,6 +408,10 @@ public class FullscreenMagnificationController implements ComponentCallbacks {
        if (!isActivated()) {
            return;
        }
        if (!(mFullscreenBorder.getBackground() instanceof GradientDrawable)) {
            // Wear doesn't use the same magnification border background. So early return here.
            return;
        }

        float cornerRadius = ScreenDecorationsUtils.getWindowCornerRadius(mContext);
        GradientDrawable backgroundDrawable = (GradientDrawable) mFullscreenBorder.getBackground();