Bug 1265708 - Strip ref from URL when adding homescreen icons r=sebastian

We add URL metadata based on the base URL, we should retrieve it this way too.

MozReview-Commit-ID: ICP54V5vRgv

--HG--
extra : rebase_source : ba9444683883f47fe7fa7b5fb7bbca1201ac2f5d
This commit is contained in:
Andrzej Hunt 2016-06-03 14:05:29 -07:00
parent 0717f299cf
commit 1fd425a95e

View File

@ -17,6 +17,7 @@ import org.mozilla.gecko.db.URLMetadataTable;
import org.mozilla.gecko.favicons.cache.FaviconCache;
import org.mozilla.gecko.util.GeckoJarReader;
import org.mozilla.gecko.util.NonEvictingLruCache;
import org.mozilla.gecko.util.StringUtils;
import org.mozilla.gecko.util.ThreadUtils;
import android.content.ContentResolver;
@ -629,13 +630,15 @@ public class Favicons {
final BrowserDB db = GeckoProfile.get(context).getDB();
final String metadataQueryURL = StringUtils.stripRef(url);
final ContentResolver cr = context.getContentResolver();
final Map<String, Map<String, Object>> metadata = db.getURLMetadata().getForURLs(cr,
Collections.singletonList(url),
Collections.singletonList(metadataQueryURL),
Collections.singletonList(URLMetadataTable.TOUCH_ICON_COLUMN)
);
final Map<String, Object> row = metadata.get(url);
final Map<String, Object> row = metadata.get(metadataQueryURL);
String touchIconURL = null;