summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tiger Huang <tigerhuang@google.com> 2020-03-26 01:54:46 +0800
committer Tiger Huang <tigerhuang@google.com> 2020-03-26 01:59:45 +0800
commitfedcd296f59f40ff1570aaf8561a4fb3bf3b7dba (patch)
tree038fca6d5d51d36cf28c87f7ee22d410ab98a79b
parentd0db17a1c26f94b767618b01f6efc4a137caca47 (diff)
Fix a potential NullPointerException in InsetsPolicy
Fix: 151308746 Test: Presubmit Change-Id: Ia98f809c08d741a01a75979c03eb6ddfbc86fd89
-rw-r--r--services/core/java/com/android/server/wm/InsetsPolicy.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/InsetsPolicy.java b/services/core/java/com/android/server/wm/InsetsPolicy.java
index ac6e75c717ff..fda70d14db2b 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 @@ class InsetsPolicy {
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) {