goodev / a2dpvolume

Automatically exported from code.google.com/p/a2dpvolume
1 stars 0 forks source link

App always crashes on startup on devices with Android 4.1 Jellybean #127

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Device (phone) brand: Samsung
Device (phone) model: Galaxy Nexus (Verizon)
Android OS version: 4.1
App version: Compiled from head (2.8.6)
What steps will reproduce the problem?
1. Install A2DP Volume.
2. Try to start app from Launcher.

What is the expected output? What do you see instead?
Expect app to start. App force closes with crash report interface.

Please provide any additional information below.

The cause is a change in the way SQLite handles database connections and db 
locking.

http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.ht
ml#isDbLockedByCurrentThread()

You can see that DB locking is going away. Not sure which API revision that 
change occurred in. The crash reason in JB is closing an already closed 
database connection now results in a crash instead of whatever behavior was 
happening on previous platforms. Also I think trying to call a bunch of methods 
on a closed db results in a crash.

I'm more than happy to submit a patch that cleans this up. But I think in order 
to do the right thing I need to understand what is with the DB locking? What 
issues have been observed on previous Android versions that still needs to be 
remediated? Have there been issues with simultaneous DB read/writes? (Like 
between the service and the activity?)

Currently changing main.java at line 858 to:
        if (myDB == null) {
            myDB = new DeviceDB(application);
        }
Instead of constantly closing and reopening the DB seems to resolve the issue. 
But I haven't stress tested it in the car yet.

Thanks!

Original issue reported on code.google.com by ericfrie...@gmail.com on 9 Jul 2012 at 11:07

GoogleCodeExporter commented 9 years ago
I just moved and will not have time to work on this app for a while.  Please be 
patient until I get up and running again.

Original comment by JimR...@gmail.com on 11 Jul 2012 at 10:46

GoogleCodeExporter commented 9 years ago
No worries! Enjoy your move.

Original comment by ericfrie...@gmail.com on 11 Jul 2012 at 6:05

GoogleCodeExporter commented 9 years ago
OK, I removed the deprecated method.  Try this (2.8.7 attached test file) and 
let me know if it fixes the issue.

Original comment by JimR...@gmail.com on 19 Jul 2012 at 12:53

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 123 has been merged into this issue.

Original comment by JimR...@gmail.com on 19 Jul 2012 at 12:56

GoogleCodeExporter commented 9 years ago
I have a Galaxy Nexus with 4.1 as well and am seeing the same crash as reported 
with v2.8.6.

I just tried the new version 2.8.7 and unfortunately it still crashes on 
start-up. After clicking OK on the crash dialog (there is no "Report" option), 
I then see a bubble that says "A2DP volume service started". If I try to 
restart the app again it still crashes just the same.

I'm not an Android developer so I can't contribute to this but I'm really 
looking forward to being able to use this app to solve a problem I've been 
having. Thanks for your work on this!

Original comment by c.lum...@gmail.com on 19 Jul 2012 at 4:34

GoogleCodeExporter commented 9 years ago
Issue 129 has been merged into this issue.

Original comment by JimR...@gmail.com on 21 Jul 2012 at 2:45

GoogleCodeExporter commented 9 years ago
So will the service run in the backgrund (icon showing it set in preferences)?  
If so, then I can focus on the main activity to find the problem.  I need crash 
reports to help solve the problem.  I don't have a Jellybean device yet.  
Downloading the Jellybean emulator now to start testing....

Original comment by JimR...@gmail.com on 21 Jul 2012 at 2:55

GoogleCodeExporter commented 9 years ago
OK, I got it working in the emulator, need folks to test on device.  Please try 
2.8.8 attached and report results.

Original comment by JimR...@gmail.com on 21 Jul 2012 at 12:29

Attachments:

GoogleCodeExporter commented 9 years ago
The app runs on my device now! Couple of small issues though and I still need 
to test with bluetooth devices later today.

1. When I select "Find Devices", it pulls the list from my paired devices as it 
should, but all the names say "bad_name" even though when I select it it pops 
up the description with the correct name under that and the MAC address. When I 
edit the entry and change the name (and other device options) it saves and 
displays the name properly in the list.

2. After selecting "Enable reading SMS messages" in the preferences and then 
back to the home screen it gives a pop-up saying "TTS data missing. Install 
now?" with Yes or No. When I select "Yes" it brings me to my system's TTS 
options but only shows languages to download that I don't want. I have already 
downloaded the English data a long time ago (and it works fine from other apps) 
but A2DP Volume seems to not be able to detect that it's there and valid. I'll 
do an SMS read test later to see if it still works anyway.

Thanks for getting the app running on JB! What I really want to use it for is 
connecting to a second music receiver bluetooth device in my car after the 
phone automatically connects to my car's built-in bluetooth headset profile.

Original comment by c.lum...@gmail.com on 21 Jul 2012 at 7:24

GoogleCodeExporter commented 9 years ago
The other issues will need to be addressed separately.  Thanks for testing!  I 
pushed this out to Play Store to at least get folks working again.  

Original comment by JimR...@gmail.com on 21 Jul 2012 at 7:52