View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011798 | MMA | General | public | 2014-01-29 14:56 | 2014-12-02 20:03 |
Reporter | marek | Assigned To | |||
Priority | urgent | Severity | major | Reproducibility | sometimes |
Status | resolved | Resolution | fixed | ||
Product Version | 1.0.4 | ||||
Target Version | 1.1.0 | Fixed in Version | 1.1.0 | ||
Summary | 0011798: Initialization of application in Application instance --> battery drain & other issues | ||||
Description | Many things are initialized in onCreate method of application instance. But this method shouldn't be used this way, because Application is not real component with complete lifecycle and it is not reliable. It probably causes these issues: 1. Content provider is not created. All DB operations fails because URLs are unknown. 2. Theme is not set. It cause NPE sometimes. 3. Sometimes, application instance is created twice. According to http://developer.android.com/guide/components/fundamentals.html and http://stackoverflow.com/questions/3947052/android-application-class-being-called-twice all this initialization procedures should be moved to Services or Activities. We are now using DbInfoRefreshSevice, that might be improved and all DB operations might be moved here. After that we have to implement running of this Service from Activity. StartActivity might be the best candidate. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Fixed in build | 345 | ||||
|
I have found another issue. Start of MediaMonkey app causes start of StorageObserverService. This service is stopped when MediaMonkey goes to background. But MediaMonkey instance can be created even when no activity is started so there is nothing that can stop the service. This cause battery drain because MMA fails to stop. This is quite rare but important issue. I have attached log with this issue at 15:58:02.940. |
|
Partly fixed in build 228 Some functionality were moved to SyncLauncher. Here it started only when some Activity is started. This should fix the battery drain issue and some crashes. This is probably save. I have made some tests but it should be tested further..especially some special cases like: a. mounting/unmounting storage when MMA is not running - MMA should start but finish shortly b. finishing while some sync is running - i.e. stop delay should expire before sync is finished..i.e. it might be easily tested with short notification stop delays - MMA should not restart StorageObserverService and should finish after some sync service (WifiSyncService, MediaStoreService, UsbSyncService) is finished. This is visible in system options..in details of running app. c. it should be tested with various notifications stop delays But there is still some code that should be moved from MediaMonkey instance. |
|
Fixed in build 345 |