This object is in archive! 

Locus cannot access SD storage after phone shutdown

Henning shared this problem 7 years ago
Closed

My general storage location is:

/storage/ext_sd/Android/data/menion.android.locus.pro/files


Whenever my phone shuts down due to low battery while I am navigating, Locus cannot access the location anymore because it is "write protected".


What I then have to do, is rename the folder to ".bak", let Locus recreate it, and then copy all data files back to this location. This is extremely annoying and has caused time delay in time critical mountain expeditions.


It seems Locus is not correctly "closing" the folder when Android sends a "terminate due to shutdown" message. Please fix this, because Locus seems to be the only app with this problem on my smartphone, and I have 200 apps all working correctly on the SD card.

Replies (11)

photo
1

Good day Henning,

this is very unfortunate problem really hard to solve. If you turn off Locus manually, then there is no such problem, right?


Problem is

a) there is nothing like "terminate due to shutdown" message. Application has absolutely no idea, that it is terminated by system

b) there is nothing like "opened folder". In worst case, Locus keeps openeded database for points and tracks and maybe few more files. But thanks to system of Android permissions, application cannot change permissions on these folders.


What version of Android and ROM are you using?

photo
1

It seems to happen only when the phone shuts down due to low power. Sometimes I forget to attach the power bank in time. I have Android 5.02 with HTC Sense 6.0, Kernel 3.4.0-g661ae11, Build 2.19.401.1

Very annoying problem for an otherwise superb piece of software.

Let me know if you need more infos. You can contact me in skype: time2kite

photo
1

I have a new Observation, which might help to create a workaround:

When I remove the SD card without shutting down the phone before, Locus AND OSMAnd both cannot use their maps on the ext_sd anymore, because the default folders are suddenly R/O.


Workaround:

folder A is now R/O. So:

1. rename folder A to A.bak on ext_sd

2. restart the app. default folder B is then created on ext_sd

3. copy all files from A.bak to B and delete A.bak on success

This would definitely worked - I use it always.

photo
1

Good day Henning,

thank you for an additional information. I'm testing it on two devices with SD card, unfortunately on both of them, same problem do not appear. After "accident" removal of battery, putting it back and start device, a while later also Locus Map, all works correctly.


I'm really worried, that I won't be able to do anything here, for me it looks like on 99% issue in Android. No matter if Locus close some connection to database or not, access to private database should be always available, no matter what happen.


May you please try to simulate this problem, and after restart, wait few minutes, then start Locus and if same problem happen again, create a log by this method : http://docs.locusmap.eu/doku.php?id=manual:faq:how_to_create_debug_log .


Most probably in log will be just a basic error "Locus do not have permission", anyway to be sure, this is only method how to detect it when same problem do not happen on my device. Thanks!

photo
1

Ok, I will test some more and look at bug report

photo
1

I have some new interesting observations:


It happened again, possible after a phone restart, but I cannot tell for sure. Locus then comes with an error messsage that the ext_sd is not accessible, but all the other suggestions don't work either (see attched screenshots). So I am stuck, even after a restart of the phone and after deleting the data folder.


What's happens next is interesting: Since I cannot use Locus, I try navigating with OSMAnd. But here the same problem. So I delete the data folder in ext_sd/Android/data/osmand. I then restart OSMAnd, and it asks me to choose the storage location. I choose ext_sd, and up comes a popup from Android, that I should select the top folder of my SD in order to get write access! After that OSMAnd recreates the folder with R/W, and I can copy the backup back, and everything is fine.


NOW, I restart Locus and Locus also recreates the previously deleted data folder, and I can finally restore the backu. SO, there's something that OSMAnd does differently. It provokes a message from Android, and after that it seems Android can access the ext_sd with write permission for other apps as well.


I hope this helps in some way, because this problem makes Locus potentially unusable in field situations. I've wasted lots of time trying to get it to work again.


Please let me know your thoughts.

photo
1

Good day Henning,


I'm really sorry for your troubles and for "waste" of your time. Anyway your observation does not helps here, sorry. From my point of view, this is definitely some software issue (maybe hardware issue with SD card?) on your device. Fact that OSMAnd has exactly same problem after restart only shows that it's not an issue of Locus Map.


I'm sorry, but if this is happen to you often and it has no solution (like placing Locus into internal memory and in case of low space, maps place over "external maps" on SD card), I may only offer refund of your purchase.


Thanks for understanding.

photo
1

I don't understand your last comment "external maps on SD card". That's exactly what I am having problem with. Anyhow, here's a WORKAROUND for anyone else having this problem:

- after boot of phone, go into "options > memory" and "remove SD card"

- when the phone says "ready", take out the SD card and put it back in

- wait a minute, then restart Locus. Everything should work.

PS: Thanks to Menion for his patience, and No, I don't want a refund, because even with this problem I enjoy using Locus.

photo
1

Hello,

still quite complicated solution.


When I was working about "external maps", I was thinking more about placing whole Locus Map directory into root of internal memory and downloaded raster maps and mainly LoMaps/Vector maps, place into something like storage/ext_sd/Locus_data/maps . Then this directory may be added as "external directory" in map manager so Locus Map should use them. This is at least how I use Locus Map on devices with limited internal storage.

photo
1

Ok, I switched the general folder to internal memory, and copied the database manually from the external SD. Worked fine, and I will report.


I thought that it wouldn't make a difference, since the maps are still on SD. But I guess they don't need R/W access then. If that is the case, it is a good solution!


Thank you for your help,

A satisfied customer

photo
1

Hello,

by database I hope you mean content of "maps" or "mapsVector" directory (maps).


It is as you wrote. Locus root directory needs random-write access, which is not possible to obtain for root of SD card. But maps (already downloaded) are satisfied with read-only access. So hope this will work fine for you!


I'm sorry I do not have a ideal solution to what happen on your device, but hope this will be working alternative. Thanks for understanding.

Replies have been locked on this page!