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

Commit 60785880 authored by Felipe Leme's avatar Felipe Leme Committed by Svetoslav Ganov
Browse files

Temporarily ignore RuntimeException when displaying the UI.

Change-Id: Ia01f9204736418a8f1e5027aef755d0855feab04
Fixes: 36392498
Test: manual verification by forcing an exception
parent 2204abdc
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.server.autofill.ui;
import static android.view.autofill.AutofillManager.AutofillCallback.EVENT_INPUT_HIDDEN;
import static android.view.autofill.AutofillManager.AutofillCallback.EVENT_INPUT_SHOWN;

import static com.android.server.autofill.ui.Helper.DEBUG;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
@@ -160,7 +162,11 @@ public final class AutoFillUI {
     */
    public void showFillUi(@NonNull AutofillId focusedId, @NonNull FillResponse response,
            @NonNull Rect anchorBounds, @Nullable String filterText, @NonNull String packageName) {
        LogMaker log = (new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_FILL_UI))
        if (DEBUG) {
            Slog.d(TAG, "showFillUi(): id=" + focusedId + ", bounds=" + anchorBounds + " filter="
                    + filterText);
        }
        final LogMaker log = (new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_FILL_UI))
                .setPackageName(packageName)
                .addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_FILTERTEXT_LEN,
                        filterText == null ? 0 : filterText.length())
+10 −0
Original line number Diff line number Diff line
@@ -326,6 +326,16 @@ final class FillUi {
        }

        public void show(int desiredWidth, int desiredHeight, Rect anchorBounds) {
            try {
                // TODO: temporary workaround to avoud system_server crashes.
                unsafelyShow(desiredWidth, desiredHeight, anchorBounds);
            } catch (RuntimeException e) {
                Slog.w(TAG, "Error showing Anchored window: w=" + desiredWidth + ", h="
                        + desiredHeight + ", b=" + anchorBounds, e);
            }
        }

        private void unsafelyShow(int desiredWidth, int desiredHeight, Rect anchorBounds) {
            final WindowManager.LayoutParams params = new WindowManager.LayoutParams();

            params.setTitle("FillUi");