diff options
author | Jim Miller <jaggies@google.com> | 2013-05-10 00:03:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-05-10 00:03:56 +0000 |
commit | 0055383554983842c5d7bab25a981c6eb804a38c (patch) | |
tree | 8899aee4e42361f5bd303d8045e402005a3bcb7f /policy | |
parent | 83d6df27d40aed18a7dc42c9320f83656cc81ea0 (diff) | |
parent | 982d21b9dc73eebd4b68a63579cf8be78c788c32 (diff) | |
download | frameworks_base-0055383554983842c5d7bab25a981c6eb804a38c.zip frameworks_base-0055383554983842c5d7bab25a981c6eb804a38c.tar.gz frameworks_base-0055383554983842c5d7bab25a981c6eb804a38c.tar.bz2 |
Merge "Attempt to fix NPE in keyguard" into jb-mr2-dev
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java index fbeca4f..c470870 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -326,10 +326,15 @@ public class KeyguardHostView extends KeyguardViewBase { } private int getWidgetPosition(int id) { - final int children = mAppWidgetContainer.getChildCount(); + final KeyguardWidgetPager appWidgetContainer = mAppWidgetContainer; + final int children = appWidgetContainer.getChildCount(); for (int i = 0; i < children; i++) { - if (mAppWidgetContainer.getWidgetPageAt(i).getContent().getId() == id) { + final View content = appWidgetContainer.getWidgetPageAt(i).getContent(); + if (content != null && content.getId() == id) { return i; + } else if (content == null) { + // Attempt to track down bug #8886916 + Log.w(TAG, "*** Null content at " + "i=" + i + ",id=" + id + ",N=" + children); } } return -1; |