Skip to content

Commit

Permalink
Actually, SQLite AUTOINCREMENT ids start at 1, so 0 is definitely an …
Browse files Browse the repository at this point in the history
…error
  • Loading branch information
apsun committed Aug 22, 2021
1 parent a6dadca commit bc5f045
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ public static Uri writeMessage(Context context, SmsMessageData messageData) {
id = ContentUris.parseId(uri);
}

// An ID of 0 when writing to the SMS inbox could mean we don't have the
// An ID of 0 when writing to the SMS inbox means we don't have the
// OP_WRITE_SMS permission. See ContentProvider#rejectInsert(Uri, ContentValues).
// Another explanation would be that this is actually the first message written.
// Since it's unlikely to be the latter, assume the write failed.
if (id <= 0) {
Xlog.e("Writing to SMS inbox failed");
throw new DatabaseException("Failed to write message to SMS inbox");
Expand Down

0 comments on commit bc5f045

Please sign in to comment.