zobnin / aio

AIO Launcher page for bug reports and suggestions
17 stars 1 forks source link

Scripts: system::system_info() returns same values for storage and sdcard #113

Closed tburba closed 7 months ago

tburba commented 7 months ago

Describe the bug After an update a few days ago, system::system_info() returns sdcard_available=storage_available and sdcard_total = storage_total. No more possible to monitor the space on the card; values for internal memory are displayed instead.

I needed a way to monitor only RAM, sdcard and internal memory, didn't find a ready solution (unfortunately the "Monitor" widget allows only card or only internal, but not both) and made my own script based on the stock "System info 1.0" script. I look at it almost daily so this change was quite noticeable.

It can't be some bug of mine because your "System info" script now does the same: "Sdcard available" and "Sdcard total" are displaying wrong values, too. See the attached screenshot. The "Monitor" widget with "Show external storage [X]" still shows the card sizes correctly, though.

To Reproduce Enable the "System info" script and examine sdcard and storage statistics. You'll see values for the internal memory reported twice,

Smartphone (please complete the following information): Everything is visible in the screenshot:

Screenshot_20240421-162407

Additional context There were no Android updates recently. The phone offers new Android 13 updates often but I'm not ready to migrate yet.

The "Files and media" permission was not allowed due to some reason, however enabling it didn't make any effect.

zobnin commented 7 months ago

That's very strange behavior. Firstly, the code responsible for retrieving memory information hasn't been changed for two years. Secondly, the Monitor widget and the script API use the same code, so they should display the same values. Try restarting AIO Launcher and see what happens.

tburba commented 7 months ago

Restarting? The entire phone was already restarted multiple times, I did it once more and it didn't help.

Eventually I decided to experiment with common last-resort steps like force-stopping, clearing of cache and user data. But, settings need to be backed up first. Surprisingly, AIO Settings > Backup said "Restarting ..." at the end and the problem vanished immediately.

Apparently there is AIO Settings > About AOI Launcher > Restart AIO Launcher, too. You should always mention this specific function instead of just "restarting", as it isn't a common thing in other apps and even users of AIO might not know about it. It was quite a smart move to incorporate it into the backup step.

Thanks for the hints.

tburba commented 1 month ago

Some more feedback: the problem was coming back after every phone restart, and I used the "Restart AIO Launcher" every time. So it's a minor nuisance. It finally went away after upgrading to Android 13.