commit | fedcd296f59f40ff1570aaf8561a4fb3bf3b7dba | [log] [tgz] |
---|---|---|
author | Tiger Huang <tigerhuang@google.com> | Thu Mar 26 01:54:46 2020 +0800 |
committer | Tiger Huang <tigerhuang@google.com> | Thu Mar 26 01:59:45 2020 +0800 |
tree | 038fca6d5d51d36cf28c87f7ee22d410ab98a79b | |
parent | d0db17a1c26f94b767618b01f6efc4a137caca47 [diff] |
Fix a potential NullPointerException in InsetsPolicy Fix: 151308746 Test: Presubmit Change-Id: Ia98f809c08d741a01a75979c03eb6ddfbc86fd89
diff --git a/services/core/java/com/android/server/wm/InsetsPolicy.java b/services/core/java/com/android/server/wm/InsetsPolicy.java index ac6e75c..fda70d1 100644 --- a/services/core/java/com/android/server/wm/InsetsPolicy.java +++ b/services/core/java/com/android/server/wm/InsetsPolicy.java
@@ -97,7 +97,8 @@ private void updateHideNavInputEventReceiver() { mPolicy.updateHideNavInputEventReceiver(!isHidden(ITYPE_NAVIGATION_BAR), - mFocusedWin.mAttrs.insetsFlags.behavior != BEHAVIOR_SHOW_BARS_BY_TOUCH); + mFocusedWin != null + && mFocusedWin.mAttrs.insetsFlags.behavior != BEHAVIOR_SHOW_BARS_BY_TOUCH); } boolean isHidden(@InternalInsetsType int type) {