Skip to content

[Google3 Bug]: NullPointerException on AccessibilityBridge #180381

@1e0ng

Description

@1e0ng

Help us understand the severity of this issue

  • causing severe production issues e.g. malfunctions or data loss
  • blocking next binary release
  • blocking a client feature launch within a quarter
  • nice-to-have but does not block a launch within the next quarter

Steps to reproduce

We haven't found a way to reproduce it yet.

Expected results

No crash.

Actual results

There are crashes: b/464096258

Code sample

On file AccessibilityBridge.java, in line 992, there is a recent change:

          assert embeddedView != null;
          // The embedded view is initially marked as not important at creation in the platform
          // view controller, so we must explicitly mark it as important here.
          embeddedView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);

Note, the assert is usually ignored in production build. Here we should do an if condition check, just like other places, for example, line 1643 and line 2031.

I suggest the code to be:

          if (embeddedView != null) {
              // The embedded view is initially marked as not important at creation in the platform
              // view controller, so we must explicitly mark it as important here.
              embeddedView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
              result.addChild(embeddedView);
          }

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

NA.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: productionIssues experienced in live production appsc: crashStack traces logged to the consolec: datalossCan result in the user losing their statecustomer: googleVarious Google teamsengineflutter/engine related. See also e: labels.needs repro infoAutomated crash report whose cause isn't yet knownplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions