diff options
Diffstat (limited to 'shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteConnection.java')
-rw-r--r-- | shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteConnection.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteConnection.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteConnection.java index d4b8a1db7..ce65e8ef6 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteConnection.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowSQLiteConnection.java @@ -1,5 +1,6 @@ package org.robolectric.shadows; +import static android.os.Build.VERSION_CODES.CUR_DEVELOPMENT; import static android.os.Build.VERSION_CODES.KITKAT_WATCH; import static android.os.Build.VERSION_CODES.LOLLIPOP; import static android.os.Build.VERSION_CODES.O; @@ -158,11 +159,16 @@ public class ShadowSQLiteConnection { nativeExecute((long) connectionPtr, (long) statementPtr); } - @Implementation(minSdk = LOLLIPOP) + @Implementation(minSdk = LOLLIPOP, maxSdk = 32) public static void nativeExecute(final long connectionPtr, final long statementPtr) { CONNECTIONS.executeStatement(connectionPtr, statementPtr); } + @Implementation(minSdk = CUR_DEVELOPMENT) + public static void nativeExecute(final long connectionPtr, final long statementPtr, boolean isPragmaStmt){ + CONNECTIONS.executeStatement(connectionPtr, statementPtr); + } + @Implementation(maxSdk = KITKAT_WATCH) public static String nativeExecuteForString(int connectionPtr, int statementPtr) { return nativeExecuteForString((long) connectionPtr, (long) statementPtr); @@ -668,7 +674,7 @@ static class Connections { @Override public Long call() throws Exception { statement.stepThrough(); - return connection.getLastInsertId(); + return connection.getChanges() > 0 ? connection.getLastInsertId() : -1L; } }); } |