[Android Q&A, Help & Troubleshooting] xdmeh:
Hi!

Using android 4.4.2 on a uhappy up920 mtk6592).

All of my widgets have disappeared - the launcher says: "Problem loading widget" and they don't show up in the "add widgets" menu any more (except for the ones that seem to be builtin / mostly "shortcut to" or "google search bar" etc - different ones depending on which launcher I try). The lock-screen widgets still work (p.E.: player control buttons, and the exact same vanilla "clock" widget that says "Problem loading widget" in the launcher). Which makes me think... maybe ownership problem? Not sure if the lock-screen runs as the same user as the launcher...

Tried the stock "launcher3", adw.launcher and nova launcher - same results for each one.

Tried reinstalling launchers (+deleting their configurations) + installed some new widgets (both over the play store + f-droid) - those new ones didn't show up in the "add widget" list either.

Made sure that all apps are installed to phone storage / not SD.

Also tested a lot of quick random things including the applications that brought the missing widgets (p.E.: "material player") - everything except for the widgets still seems to work fine.

Some of the things I remember doing between the last reboot and the first occurrence of the problem:

- Tried to root the phone and partially succeeded

- Used "/system/app mover" to move f-droid and used the latter one's weird "rom upgrade method" to try and install open source SU (this - ATM - is my most likely suspect when it comes to what broke the widgets...)

- Tried to install usb-host functionality and failed (used "usb host check" first, then manually edited + added some files in "/system/etc/permissions", then reverted changes in that folder based on /dev/recovery )

Now I'm trying to figure out what could be wrong (maybe just a permission problem), but I can't find:

- The location of the widget meta-files (I imagine applications that have widgets bring something like ".desktop files" for their widgets, that should then be indexed by the launcher?)

- A config file of sorts where I can check... where the launcher... checks for widgets. So I can check for permission problems...?

... or any useful information for that matter.

Could someone please point me into the right general direction? Any information on where to start debugging the systems / launchers "widget indecing behaviour" or the applications "widget installation directory" or whatever would be of great help...

edit: found an appwidgets.xml in /data/system/users/0 which was chmodded to 600 and and I rechmodded it to 644. But that fixed nothing T_T so now I'm fresh out of ideas.

here's something weird:

I/ActivityManager( 706): START u0 {act=android.appwidget.action.APPWIDGET_PICK cmp=com.android.settings/.AppWidgetPickActivity (has extras)} from pid 1099
V/AppWidget( 2519): array = [Z@42307b90
V/AppWidgetServiceImpl( 706): getInstalledProviders hostName = com.android.settings����������������������������������������������������������������������������������������������������������������
V/AppWidgetServiceImpl( 706): permission of the launcher: 0 enableFiltering = true
D/ActivityThread( 2519): ACT-AM_ON_RESUME_CALLED ActivityRecord{42306778 token=androi

The EFBFBD's are actually U+C080 when I pipe them to a file... the shell turns them into EFBFBD's... so maybe this is normal on a chinese phone after all? Or could this have something to do with the problem. Also no idea if "enableFiltering" should be true :/

edit: Ok, those seem to have been exclusive to adw.launcher... launcher3 seems to have different method to get the list of widgets... . For what it's worth... even though I deleted application cache from the settings menu, some widgets show up in /data/data/com.android.launcher3/cache/widgetpreviews.db - but all of them are shortcuts. No non-shortcut widgets are detected by any launcher... so... something launcher-independent is broken... but not broken for the lock-screen... so... guess I'll try... to chown a launcher's files to the user that runs the lockscreen? Bad idea?

*sigh* I still have no idea what I'm doing, I think i need an intervention!

edit: Hey, who changed my thread title? Maybe it wasn't perfect, but now it's way off..... First of all, the problem occurs with all launchers. Also, that it's saying "problem loading widget" (which is the standard message - i think - when a widget is uninstalled or sometimes just updated) isn't really the main problem, just a symptom. The WHOLE widget list - with any launcher at all - is empty (safe for shortcuts)...

*sigh*

Anyway - one "grep -Ri widget /" later I have learned nothing new... should I be taking a closer look at "AppWidgetHost" or "BIND_APPWIDGET" or "ADVANCED_WIDGET_API" or anything?

edit: Tested with "google now launcher", same problem. Can't figure out where / how the launchers get the widget list (or in this case - fail to get it). There is no mention of "AppWidgetManager" or even just "AppWidget" in the log, even if I clear the cache (/delete and reinstall the launcher) before I try to access the widget list. Or aren't they even trying for some reason?