Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(FIX) Check default SMS app before delete inbox sms #476

Closed
wants to merge 1 commit into from
Closed

(FIX) Check default SMS app before delete inbox sms #476

wants to merge 1 commit into from

Conversation

datnguyen92
Copy link

On certain phones (e.g. Huawei Mate 8 running Nougat), if SMSSync is not the default SMS app, the app will crash when execute method delSmsFromInbox(). Below is the stack trace for this issue:

FATAL EXCEPTION: SmsReceiverService
Process: org.addhen.smssync.debug, PID: 11676
java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
    at android.database.CursorWindow.nativeGetLong(Native Method)
    at android.database.CursorWindow.getLong(CursorWindow.java:511)
    at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:90)
    at android.database.CursorWrapper.getLong(CursorWrapper.java:127)
    at org.addhen.smssync.smslib.sms.ProcessSms.getThreadIdKitKat(ProcessSms.java:273)
    at org.addhen.smssync.smslib.sms.ProcessSms.getThreadId(ProcessSms.java:237)
    at org.addhen.smssync.smslib.sms.ProcessSms.delSmsFromInbox(ProcessSms.java:127)
    at org.addhen.smssync.data.message.ProcessMessage.deleteFromSmsInbox(ProcessMessage.java:198)
    at org.addhen.smssync.data.message.PostMessage.routeSms(PostMessage.java:147)
    at org.addhen.smssync.presentation.service.SmsReceiverService.handleSmsReceived(SmsReceiverService.java:275)
    at org.addhen.smssync.presentation.service.SmsReceiverService$ServiceHandler.handleMessage(SmsReceiverService.java:339)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loop(Looper.java:207)
    at android.os.HandlerThread.run(HandlerThread.java:61)

In order to void that, I propose to check the default SMS app before deleting inbox message

@datnguyen92
Copy link
Author

@eyedol Would you mind to have a look? Just a small fix but may prevent crashes

@datnguyen92 datnguyen92 closed this Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant