From caa0b54cbcb71b1124ea50cb0cf5abb6a4d1275f Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Fri, 11 Apr 2014 15:59:17 -0700 Subject: [PATCH] Fallback to the default values when indexing from local resource. If we are indexing from a local resource and the indexable resource does not provide icon or class name or rank we fall back to the defaults. Change-Id: Ibbed8b2a92e28799c26f5f80b3f058737535739d --- src/com/android/settings/search/Index.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/search/Index.java b/src/com/android/settings/search/Index.java index 1aeb1ff171..ce273b6dd1 100644 --- a/src/com/android/settings/search/Index.java +++ b/src/com/android/settings/search/Index.java @@ -751,8 +751,13 @@ public class Index { continue; } + final int itemIconResId = (item.iconResId == 0) ? iconResId : item.iconResId; + final int itemRank = (item.rank == 0) ? rank : item.rank; + String itemClassName = (TextUtils.isEmpty(item.className)) + ? className : item.className; + indexFromResource(context, database, localeStr, - item.xmlResId, item.className, item.iconResId, item.rank, + item.xmlResId, itemClassName, itemIconResId, itemRank, item.intentAction, item.intentTargetPackage, item.intentTargetClass, doNotIndexKeys); } -- 2.11.0