Skip to content

Commit

Permalink
[Color] Update DynamicColors to use peekDecorView() instead of getDec…
Browse files Browse the repository at this point in the history
…orView() when applying dynamic color theme overlay

Resolves #2558

PiperOrigin-RevId: 428033173
  • Loading branch information
dsn5ft authored and pekingme committed Feb 12, 2022
1 parent 64c6d04 commit 56ed070
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -315,7 +315,8 @@ private static void applyDynamicColorThemeOverlay(Activity activity, @StyleRes i
private static Theme getWindowDecorViewTheme(@NonNull Activity activity) {
Window window = activity.getWindow();
if (window != null) {
View decorView = window.getDecorView();
// Use peekDecorView() instead of getDecorView() to avoid locking the Window.
View decorView = window.peekDecorView();
if (decorView != null) {
Context context = decorView.getContext();
if (context != null) {
Expand Down

0 comments on commit 56ed070

Please sign in to comment.