Skip to content

Commit 931be0e

Browse files
Jim MillerAndroid (Google) Code Review
authored andcommitted
Merge "Don't show empty widget in the case where a widget can't be inflated" into jb-mr1-dev
2 parents 5bc09e2 + 99a3cae commit 931be0e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,12 @@ private int getLayoutIdFor(SecurityMode securityMode) {
667667
private void addWidget(int appId) {
668668
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext);
669669
AppWidgetProviderInfo appWidgetInfo = appWidgetManager.getAppWidgetInfo(appId);
670-
AppWidgetHostView view = getAppWidgetHost().createView(mContext, appId, appWidgetInfo);
671-
addWidget(view);
670+
if (appWidgetInfo != null) {
671+
AppWidgetHostView view = getAppWidgetHost().createView(mContext, appId, appWidgetInfo);
672+
addWidget(view);
673+
} else {
674+
Log.w(TAG, "AppWidgetInfo was null; not adding widget id " + appId);
675+
}
672676
}
673677

674678
private void maybePopulateWidgets() {

0 commit comments

Comments
 (0)