这是indexloc提供的服务,不要输入任何密码
Skip to content

Change Dialog 's getWindow() to NonNull #736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: androidx-main
Choose a base branch
from

Conversation

liu-wanshun
Copy link

Proposed Changes

  • getWindow() is NonNull ,mWindowis initialized during construction and has not been modified since then.

Testing

Test: override getWindow() in subclass of dialog,no problem.

@JakeWharton
Copy link
Contributor

The place to fix this, if it indeed is worth changing, would be in the framework, not some arbitrary subclass. But keep in mind that the nullability of these methods models the entire history of behavior–not just the current behavior.

@liu-wanshun
Copy link
Author

The place to fix this, if it indeed is worth changing, would be in the framework, not some arbitrary subclass. But keep in mind that the nullability of these methods models the entire history of behavior–not just the current behavior.

@JakeWharton yes,this problem originates from framework, but it is impossible to be null.
image

@liu-wanshun
Copy link
Author

I also submitted a patch for framework.
https://android-review.googlesource.com/c/platform/frameworks/base/+/3428320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants