diff options
| author | 2012-09-17 20:53:51 -0700 | |
|---|---|---|
| committer | 2012-09-17 20:53:51 -0700 | |
| commit | 99a3cae55bd1a4ea6d82aa7fa2a67170e7cd5b3e (patch) | |
| tree | 139561f56421220201fdc47a9207533e0ad0ca53 | |
| parent | b45965f519d41f138f0d0edfb587e4861e2199f4 (diff) | |
Don't show empty widget in the case where a widget can't be inflated
If the use deletes the widget by disabling a package or removing it,
we used to show a placeholder widget. Now it skips the widget if it's
not available.
Change-Id: I8582139bf982e41f3f16b5c002e248c5717290aa
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java | 8 |
1 files changed, 6 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 955c2304d86d..7c7cfd689111 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -662,8 +662,12 @@ public class KeyguardHostView extends KeyguardViewBase { private void addWidget(int appId) { AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext); AppWidgetProviderInfo appWidgetInfo = appWidgetManager.getAppWidgetInfo(appId); - AppWidgetHostView view = getAppWidgetHost().createView(mContext, appId, appWidgetInfo); - addWidget(view); + if (appWidgetInfo != null) { + AppWidgetHostView view = getAppWidgetHost().createView(mContext, appId, appWidgetInfo); + addWidget(view); + } else { + Log.w(TAG, "AppWidgetInfo was null; not adding widget id " + appId); + } } private void maybePopulateWidgets() { |