When I try to select a ringtone OR Alarm sound that is not in the default list of sounds, the File Manager app gets spawned. It is in the “recent elements” tab, which is empty.
On trying to select any other folder, the app crashes (freeze), taking the settings app with it.
When I force stop the app, and open the File Manager manually, I can go to the folder where I stored the ringtone/alarm sound normally and play it with a media player, although the app does occasionally freeze randomly when I switch folders a lot, back and forth.
I first thought the issue was caused by a faulty SD card, so I ejected the SD card, removed it and rebooted the phone, but the issue persists even without it.
Is there a way to access any logs to find out what causes these freezes?
Yes, I cleared cache and files of the File Manager. Unfortunately that did not help.
As a work around, I tried to install an alternative file manager from F-Droid.
This was not successful either. Although the alternative file manager works flawlessly (without random crashes) when using it stand-alone, the File Manager system app shipped with the FP3 can not be uninstalled or even deactivated.
When choosing any “file open” activity from the settings app - such as selecting a new alarmtone/ringtone - it will still always launch the preinstalled file manager even if additional file managers are installed. And hang. Can you point me at a good howto, how to use adb to debug this specific situation?
I didn’t manage to get anything useful from these logs. The app freezes silently.
I tried to install the file browser app from LineageOS instead. The issue is that the app uses the exact same name com.android.documentsui
pm does not let me install the LineageOS version from https://www.apkmirror.com/apk/lineageos/files-lineageos/files-2-9-release/
because of the installed system app that cannot be removed:
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.android.documentsui signatures do not match previously installed version; ignoring!]
I got a breakthrough. As it turns out, there are several side conditions required to trigger the bug.
Requirements for reproduction:
Have a non-root firewall installed (I use NetGuard) that by default does not allow apps to connect to the network/internet that aren’t supposed to.
Have that app enabled to provide a virtual VPN service (WLAN or Mobile Internet don’t need to be activated)
Have the Google drive app installed.
Have either:
Internet connectivity currently disallowed for Google Drive/Play Services in NetGuard)
or
Internet itself currently unavailable (no WLAN/Mobile Data at the moment)
Try to import a Ringtone in settings, thus spawning the file manager
Try to change to a different folder (default folder is “recent files” which is usually empty)
The File Manager (com.android.documentsui) includes google drive as a remote/cloud sync location, using the google drive app as the provider/service.
On attempting to change the folder, it asks google drive for a list of files/folders for some reason. This call however does not return until 3 minutes later, when the missing network connection triggers a timeout in the google drive app API function.
The File Browser then freezes until that timeout happens.
Workarounds:
Uninstall Google Drive
or
Connect to the internet and allow internet access to Google Drive in Firewall
or
Disable/don’t use a firewall ( BAD OPTION )
or
Wait >3 minutes in order to import an alarm sound/ring tone for the timeout.
(One might have to click on “Wait” on the “This application is not responding” dialogue)
Note: it is possible to trigger the bug with repeated folder switches even in the regular UI of the File Manager, too. Same workarounds apply.
I also managed to reproduce the bug using a vanilla Android 9 install on an emulated Google Pixel 3a (using qemu and android studio). So this is definitely a Google bug, not a Fairphone bug. I reported the bug to Google under https://issuetracker.google.com/issues/144639507
There are no 3rd party apps needed to trigger this error, a bad internet connection can trigger it just as good as any non-root firewall.
There seems to be one more workaround:
If one browses into ones own google drive account once within the “Files” app (with firewall disabled, so the actual google drive contents are visible and get cached) the folder contents will be loaded from cache (of the google drive app) and the Files app won’t freeze. I don’t know how long these cache contents remain valid though.