Skip to content

[camera_android_camerax] Fixes crash with unsupported operation exception - #10342

Merged
auto-submit[bot] merged 11 commits into
flutter:mainfrom
Mairramer:fix/fixes-crash-with-UnsupportedOperationException
Nov 10, 2025
Merged

[camera_android_camerax] Fixes crash with unsupported operation exception#10342
auto-submit[bot] merged 11 commits into
flutter:mainfrom
Mairramer:fix/fixes-crash-with-UnsupportedOperationException

Conversation

@Mairramer

@MairramerMairramer commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

Fixes crash in DeviceOrientationManager caused by UnsupportedOperationException when getDisplay() is called on a null or destroyed Activity during rotation.

Fixesflutter/flutter#176613

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 23

Fixes a crash in `DeviceOrientationManager` that occurred when `getDisplay()` was called on a null or destroyed Activity during device rotation. This was caused by an `UnsupportedOperationException`.
@Mairramer
Mairramer marked this pull request as ready for review November 3, 2025 13:13

@camsim99camsim99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me overall. Thanks for the quick fix! But I do want to discuss the check added to getDisplay.

Mairramerand others added 3 commits November 3, 2025 12:21
Fixed a crash in DeviceOrientationManager related to Activity state during rotation.

@camsim99camsim99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :) thanks!

@bparrishMinesbparrishMines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bparrishMinesbparrishMines added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 10, 2025
@auto-submitauto-submitBot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 10, 2025
@auto-submit

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/packages/10342, because - The status or check suite Linux_android android_device_tests_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label.

@bparrishMinesbparrishMines added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 10, 2025
@auto-submit
auto-submitBot merged commit e22c523 into flutter:mainNov 10, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 11, 2025
github-merge-queueBot pushed a commit to flutter/flutter that referenced this pull request Nov 11, 2025
flutter/packages@4cec230...7063d75
2025-11-11 31859944+LongCatIsLooong@users.noreply.github.com
[video_player_avfoundation] removes unnecessary duration and size check
before sending the initialized event (flutter/packages#9534)
2025-11-11 magder@google.com Update Android package CODEOWNERS
(flutter/packages#10386)
2025-11-11 stuartmorgan@google.com [url_launcher] Remove unused
dartHostTestHandler (flutter/packages#10324)
2025-11-11 stuartmorgan@google.com [path_provider] Remove use of
Pigeon's Dart test generator (flutter/packages#10323)
2025-11-11 stuartmorgan@google.com [image_picker] Remove use of Pigeon's
Dart test generator (flutter/packages#10320)
2025-11-11 stuartmorgan@google.com [shared_preferences] Remove use of
Pigeon's Dart test generator (flutter/packages#10325)
2025-11-10 50643541+Mairramer@users.noreply.github.com
[camera_android_camerax] Fixes crash with unsupported operation
exception (flutter/packages#10342)
2025-11-10 stuartmorgan@google.com [file_selector] Remove unused web
code (flutter/packages#10376)
2025-11-10 engine-flutter-autoroll@skia.org Manual roll Flutter from
c5e809a to 31a8481 (9 revisions) (flutter/packages#10392)
2025-11-10 danferreiradev@gmail.com [file_selector] Add
canCreateDirectories to FileDialogOptions (flutter/packages#10317)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.
To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
IvoneDjaja pushed a commit to IvoneDjaja/flutter that referenced this pull request Nov 22, 2025
flutter/packages@4cec230...7063d75
2025-11-11 31859944+LongCatIsLooong@users.noreply.github.com
[video_player_avfoundation] removes unnecessary duration and size check
before sending the initialized event (flutter/packages#9534)
2025-11-11 magder@google.com Update Android package CODEOWNERS
(flutter/packages#10386)
2025-11-11 stuartmorgan@google.com [url_launcher] Remove unused
dartHostTestHandler (flutter/packages#10324)
2025-11-11 stuartmorgan@google.com [path_provider] Remove use of
Pigeon's Dart test generator (flutter/packages#10323)
2025-11-11 stuartmorgan@google.com [image_picker] Remove use of Pigeon's
Dart test generator (flutter/packages#10320)
2025-11-11 stuartmorgan@google.com [shared_preferences] Remove use of
Pigeon's Dart test generator (flutter/packages#10325)
2025-11-10 50643541+Mairramer@users.noreply.github.com
[camera_android_camerax] Fixes crash with unsupported operation
exception (flutter/packages#10342)
2025-11-10 stuartmorgan@google.com [file_selector] Remove unused web
code (flutter/packages#10376)
2025-11-10 engine-flutter-autoroll@skia.org Manual roll Flutter from
c5e809a to 31a8481 (9 revisions) (flutter/packages#10392)
2025-11-10 danferreiradev@gmail.com [file_selector] Add
canCreateDirectories to FileDialogOptions (flutter/packages#10317)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.
To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Dec 2, 2025
flutter/packages@4cec230...7063d75
2025-11-11 31859944+LongCatIsLooong@users.noreply.github.com
[video_player_avfoundation] removes unnecessary duration and size check
before sending the initialized event (flutter/packages#9534)
2025-11-11 magder@google.com Update Android package CODEOWNERS
(flutter/packages#10386)
2025-11-11 stuartmorgan@google.com [url_launcher] Remove unused
dartHostTestHandler (flutter/packages#10324)
2025-11-11 stuartmorgan@google.com [path_provider] Remove use of
Pigeon's Dart test generator (flutter/packages#10323)
2025-11-11 stuartmorgan@google.com [image_picker] Remove use of Pigeon's
Dart test generator (flutter/packages#10320)
2025-11-11 stuartmorgan@google.com [shared_preferences] Remove use of
Pigeon's Dart test generator (flutter/packages#10325)
2025-11-10 50643541+Mairramer@users.noreply.github.com
[camera_android_camerax] Fixes crash with unsupported operation
exception (flutter/packages#10342)
2025-11-10 stuartmorgan@google.com [file_selector] Remove unused web
code (flutter/packages#10376)
2025-11-10 engine-flutter-autoroll@skia.org Manual roll Flutter from
c5e809a to 31a8481 (9 revisions) (flutter/packages#10392)
2025-11-10 danferreiradev@gmail.com [file_selector] Add
canCreateDirectories to FileDialogOptions (flutter/packages#10317)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.
To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
flutter/packages@4cec230...7063d75
2025-11-11 31859944+LongCatIsLooong@users.noreply.github.com
[video_player_avfoundation] removes unnecessary duration and size check
before sending the initialized event (flutter/packages#9534)
2025-11-11 magder@google.com Update Android package CODEOWNERS
(flutter/packages#10386)
2025-11-11 stuartmorgan@google.com [url_launcher] Remove unused
dartHostTestHandler (flutter/packages#10324)
2025-11-11 stuartmorgan@google.com [path_provider] Remove use of
Pigeon's Dart test generator (flutter/packages#10323)
2025-11-11 stuartmorgan@google.com [image_picker] Remove use of Pigeon's
Dart test generator (flutter/packages#10320)
2025-11-11 stuartmorgan@google.com [shared_preferences] Remove use of
Pigeon's Dart test generator (flutter/packages#10325)
2025-11-10 50643541+Mairramer@users.noreply.github.com
[camera_android_camerax] Fixes crash with unsupported operation
exception (flutter/packages#10342)
2025-11-10 stuartmorgan@google.com [file_selector] Remove unused web
code (flutter/packages#10376)
2025-11-10 engine-flutter-autoroll@skia.org Manual roll Flutter from
c5e809a to 31a8481 (9 revisions) (flutter/packages#10392)
2025-11-10 danferreiradev@gmail.com [file_selector] Add
canCreateDirectories to FileDialogOptions (flutter/packages#10317)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.
To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…tion (flutter#10342)
Fixes crash in `DeviceOrientationManager` caused by `UnsupportedOperationException` when `getDisplay()` is called on a null or destroyed Activity during rotation.
Fixesflutter/flutter#176613
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit Appp: cameraplatform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Camera] UnsupportedOperationException: ProxyApiRegistrar.getDisplay crash on Android 14 with camera 0.11.2

3 participants

@Mairramer@bparrishMines@camsim99