Launcher Lag (w/ suggested fix)


roee88

Members
Sep 20, 2011
3
11
Hi,

I'm not sure if this is the right place to post this as it has nothing to do with the English translation itself but I couldn't find any other website or forum for submitting MIUI bug reports. Please redirect me if needed.

Description:
MIUI Launcher does not handle widgets correctly, especially those that use RemoteViews.addView internally.

Symptoms:
Possible lag when resuming the launcher if the launcher has widgets on it.

Reason and suggested fix:
The launcher calls mAppWidgetHost.startListening() and mAppWidgetHost.stopListening() on onStart and onStop respectively. This behaviour is suggested for normal application but not for home launchers. The correct code should call these function on onCreate and onDestroy instead. This is the behaviour in all other launchers including the official one (code example: http://gitorious.org/0xdroid/packag...a22107/src/com/android/launcher/Launcher.java ).

On widgets that don't use RemoteViews.addView the lag is small because Android keeps a cache of the full view. But on any widget that does use it the cache only contains the top layer and therefore the entire widget view needs to be created again. This happens on the main thread and causes the lag.

Edit: You can get here a fixed version of the launcher
 
Great find, thanks! But what happens when we upgrade to the next "normal" version of MIUI? Assume the "fix" here would be lost as files would be overwritten?
 
True. This is why I'm reporting it as a bug.
I want it fixed by MIUI developers but the only bug tracker they have is in Chinese and miui.us has no forum for bug reports.