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

Commit 42aec907 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Temporarily ignore RuntimeException when displaying the UI."

parents c0aa4339 60785880
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");