mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1245580: Part 1 - doCreateShortcut no longer needs to be on the Background thread r=liuche
When doCreateShortcut was first created, it also handled webapp intents. This required additional work, meaning doCreateShortcut had to be run on the background thread. We now only create an Android Intent, with no additional work, hence we can run directly on the UI thread. MozReview-Commit-ID: BFrAuNfDiFj
This commit is contained in:
parent
38bcf918e4
commit
d74032c6f7
@ -840,7 +840,7 @@ public class GeckoAppShell
|
||||
OnFaviconLoadedListener listener = new OnFaviconLoadedListener() {
|
||||
@Override
|
||||
public void onFaviconLoaded(String url, String faviconURL, Bitmap favicon) {
|
||||
createShortcutWithBitmap(aTitle, url, favicon);
|
||||
doCreateShortcut(aTitle, url, favicon);
|
||||
}
|
||||
};
|
||||
|
||||
@ -853,18 +853,6 @@ public class GeckoAppShell
|
||||
Favicons.getPreferredSizeFaviconForPage(getApplicationContext(), aURI, touchIconURL, listener);
|
||||
}
|
||||
|
||||
private static void createShortcutWithBitmap(final String aTitle, final String aURI, final Bitmap aBitmap) {
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
doCreateShortcut(aTitle, aURI, aBitmap);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method only on the background thread.
|
||||
*/
|
||||
private static void doCreateShortcut(final String aTitle, final String aURI, final Bitmap aIcon) {
|
||||
// The intent to be launched by the shortcut.
|
||||
Intent shortcutIntent = new Intent();
|
||||
|
Loading…
Reference in New Issue
Block a user