I'm working on an App that needs to have a custom ringtone for certain events. Everything is working fine on my Cyanogenmod7 OG Moto Droid, as well as some other phones in our company.
However, there are 2 people with an HTC Evo that are getting the following when I click on "Custom Ringtone". Note, the first line is my app's output that the user wanted a custom tone, and that the system should start loading all possible custom ringtones:
I/System.out(31774): we are to play a custom tone, so unlock the custom thinger!
I/ActivityManager( 132): Displayed org.me.myApp/.Preferences: 340ms (total 5m10s828ms)
D/dalvikvm(31774): GC_EXTERNAL_ALLOC freed 172K, 48% free 3145K/6023K, external 587K/596K, paused 35ms
I/AudioHardwareQSD( 70): AudioHardware pcm playback is going to standby.
D/StreamProcess( 70): OutputStreamProcess::ResetAOLC()
I/ActivityManager( 132): Starting activity: Intent { act=android.intent.action.RINGTONE_PICKER cmp=com.htc/.app.HtcRingtonePickerActivity (has extras) } from pid 31774
V/AgentService_J( 244): Action[23578]:com.htc.android.iqagent.action.ui12
I/HTC_SUBMITTER_C( 244): (0) submitUI12:9,7,8,0,0,-1,0,0,0,0,UI12
V/AgentService_J( 244): (0)MenuItemMax:9,MenuActiveItemNum:7,SelectMenuNo:8,DestAppID:0SrcAppID0,ContorlEventID:-1,UserInputEventID:0,ErrorCode:0ErrorLevel0,VendorDataLength:0,VendorData:UI12
V/AgentService_J( 244): Action[23579]:com.htc.android.iqagent.action.ui19
I/HTC_SUBMITTER_C( 244): (0) submitUI19:1194864298,0
V/AgentService_J( 244): (0)ui19_dwAppID:1194864298,ui19_ucFocusEvent:0
I/ActivityManager( 132): Start proc com.htc for activity com.htc/.app.HtcRingtonePickerActivity: pid=32077 uid=10000 gids={3003}
V/AgentService_J( 244): Action[23580]:com.htc.android.iqagent.action.ui13
I/HTC_SUBMITTER_C( 244): (0) submitUI13:948524778,22,com.htc
V/AgentService_J( 244): (0)ui13_dwAppID:948524778,ui13_ucAppType:22,ui13_szAppName:com.htc
I/Database(30296): sqlite returned: error code = 1, msg = near ")": syntax error
E/DatabaseUtils(30296): Writing exception to parcel
E/DatabaseUtils(30296): android.database.sqlite.SQLiteException: near ")": syntax error: , while compiling: SELECT _id, title, "content://drm/audio", title AS title_key FROM audio WHERE (() AND delivery_type = 1 AND existence= 'exist') ORDER BY title
E/DatabaseUtils(30296): at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
E/DatabaseUtils(30296): at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
E/DatabaseUtils(30296): at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
E/DatabaseUtils(30296): at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
E/DatabaseUtils(30296): at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49)
E/DatabaseUtils(30296): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:53)
E/DatabaseUtils(30296): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1438)
E/DatabaseUtils(30296): at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:351)
E/DatabaseUtils(30296): at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:301)
E/DatabaseUtils(30296): at com.android.providers.drm.DrmProvider.query(DrmProvider.java:614)
E/DatabaseUtils(30296): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:186)
E/DatabaseUtils(30296): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:140)
E/DatabaseUtils(30296): at android.os.Binder.execTransact(Binder.java:320)
E/DatabaseUtils(30296): at dalvik.system.NativeStart.run(Native Method)
D/AndroidRuntime(32077): Shutting down VM
W/dalvikvm(32077): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0)
E/AndroidRuntime(32077): FATAL EXCEPTION: main
E/AndroidRuntime(32077): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.htc/com.htc.app.HtcRingtonePickerActivity}: android.database.sqlite.SQLiteException: near ")": syntax error: , while compiling: SELECT _id, title, "content://drm/audio", title AS title_key FROM audio WHERE (() AND delivery_type = 1 AND existence= 'exist') ORDER BY title
E/AndroidRuntime(32077): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1821)
E/AndroidRuntime(32077): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1842)
E/AndroidRuntime(32077): at android.app.ActivityThread.access$1500(ActivityThread.java:132)
E/AndroidRuntime(32077): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
E/AndroidRuntime(32077): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(32077): at android.os.Looper.loop(Looper.java:143)
E/AndroidRuntime(32077): at android.app.ActivityThread.main(ActivityThread.java:4263)
E/AndroidRuntime(32077): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(32077): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(32077): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(32077): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime(32077): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(32077): Caused by: android.database.sqlite.SQLiteException: near ")": syntax error: , while compiling: SELECT _id, title, "content://drm/audio", title AS title_key FROM audio WHERE (() AND delivery_type = 1 AND existence= 'exist') ORDER BY title
E/AndroidRuntime(32077): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:158)
E/AndroidRuntime(32077): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
E/AndroidRuntime(32077): at android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.java:378)
E/AndroidRuntime(32077): at android.content.ContentProviderProxy.query(ContentProviderNative.java:414)
E/AndroidRuntime(32077): at android.content.ContentResolver.query(ContentResolver.java:264)
E/AndroidRuntime(32077): at android.app.Activity.managedQuery(Activity.java:1635)
E/AndroidRuntime(32077): at android.media.RingtoneManager.query(RingtoneManager.java:719)
E/AndroidRuntime(32077): at android.media.RingtoneManager.getDrmRingtones(RingtoneManager.java:578)
E/AndroidRuntime(32077): at android.media.RingtoneManager.getCursor(RingtoneManager.java:444)
E/AndroidRuntime(32077): at com.htc.app.HtcRingtonePickerActivity.onCreate(HtcRingtonePickerActivity.java:141)
E/AndroidRuntime(32077): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
E/AndroidRuntime(32077): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1785)
E/AndroidRuntime(32077): ... 11 more
V/AgentService_J( 244): Action[23581]:com.htc.android.iqagent.action.ui03
I/HTC_SUBMITTER_C( 244): (0) submitUI03:0,22,0,android.database.sqlite.SQLiteException: near ")": syntax error: , while compiling: SELECT _id, title, "content://drm/audio", title AS title_key FROM audio WHERE (() AND delivery_type = 1 AND existence= 'exist') ORDER BY title
V/AgentService_J( 244): (0)ErrorCode:0,AppType:22,Level:0,Message:android.database.sqlite.SQLiteException: near ")": syntax error: , while compiling: SELECT _id, title, "content://drm/audio", title AS title_key FROM audio WHERE (() AND delivery_type = 1 AND existence= 'exist') ORDER BY title
W/ActivityManager( 132): Force finishing activity com.htc/.app.HtcRingtonePickerActivity
D/InputManagerService( 132): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4076a5c8
W/ActivityManager( 132): Force finishing activity org.me.edispatchesapp/.Preferences
W/ActivityManager( 132): Activity pause timeout for HistoryRecord{405907f0 com.htc/.app.HtcRingtonePickerActivity}
V/AgentService_J( 244): Action[23582]:com.htc.android.iqagent.action.ui19
I/HTC_SUBMITTER_C( 244): (0) submitUI19:-1156700090,1
V/AgentService_J( 244): (0)ui19_dwAppID:-1156700090,ui19_ucFocusEvent:1
D/StatusBarPolicy( 241): onSignalStrengthsChanged
D/StatusBarPolicy( 241): iconIndex=1
V/StatusBarPolicy( 241): cdmaLevel:1;max:6
D/StatusBarPolicy( 241): iconLevel:1
D/StatusBarService( 241): updateIcon slot=phone_signal index=20 viewIndex=15 old=StatusBarIcon(pkg=com.android.systemui id=0x7f02000f level=0 visible=true num=0 ) icon=StatusBarIcon(pkg=com.android.systemui id=0x7f02000d level=0 visible=true num=0 )
V/AgentService_J( 244): Action[23583]:com.htc.android.iqagent.action.ui08
I/HTC_SUBMITTER_C( 244): actionUI08 metric:2, 3
V/AgentService_J( 244): (0)ASU, TECH:2, 3
D/dalvikvm( 241): GC_CONCURRENT freed 930K, 53% free 3396K/7175K, external 3296K/3456K, paused 2ms 3ms
D/AutoSetting(31853): service - mRequestRunnable: screen on delay 10s, request NLP now
D/AutoSetting(31853): service - requestNLP() to last request within 2hrs, don't request 1325066
D/WifiService( 132): acquireWifiLockLocked: WifiLock{NetworkLocationLocator type=2 binder=android.os.BinderProxy@409d60c8} Mode: 2
D/WifiService( 132): enable and start wifi due to updateWifiState
I/u (31817): Not returning location for the following outliers: [113559476793, 2400330000077]
D/dalvikvm(31817): GC_CONCURRENT freed 505K, 46% free 3656K/6727K, external 0K/0K, paused 3ms 3ms
D/WifiService( 132): releaseWifiLockLocked: WifiLock{NetworkLocationLocator type=2 binder=android.os.BinderProxy@409d60c8} Mode: 2
D/WifiService( 132): enable and start wifi due to updateWifiState
I'm not exactly sure, but from what I can tell this is an HTC error.... isn't it? Like I said, it seems to work fine on other phones...
CodePudding user response:
I figured out the answer!!!
In my "settings.xml" file, I have a RingtonePreference where the code was:
<RingtonePreference
android:key="alerts_ringtone"
android:title="Select ringtone"
android:showDefault="true"
android:showSilent="true"
android:ringtoneType=""
/>
where the last line was supposed to read:
android:ringtoneType="all"
With the "all" in there, the HTC Evo's in our office no longer crash. :) I wonder why?