Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch base Excluding Merge-Ins
This is equivalent to a diff from e9352bdf96 to 51cdfe5c9a
2017-11-27
| ||
20:59 | Update some C++ files to match recent changes to the Android core. (check-in: dec1c9374f user: dan tags: trunk) | |
20:21 | Add script to import files from a git checkout. (Leaf check-in: 51cdfe5c9a user: dan tags: base) | |
20:06 | Add the original versions of all the Android files imported and modified in this project. The versions imported are from commit e819e49b31dc0bc82dd617700299ad13ff6fd7f8 on the master branch of the git repository here: https://android.googlesource.com/platform/frameworks/base/ (check-in: bd482c8af6 user: dan tags: base) | |
19:22 | Remove out of date "package.html" files. (check-in: e9352bdf96 user: dan tags: trunk) | |
14:14 | Remove class org.sqlite.database.ExtraUtils. No longer required now that org.sqlite.database.DatabaseUtils works. (check-in: 2332e2eecd user: dan tags: trunk) | |
Added import_from_base.sh.
|
Changes to sqlite3/src/main/java/org/sqlite/database/DatabaseErrorHandler.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - - - - - + - + - - + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
Changes to sqlite3/src/main/java/org/sqlite/database/DatabaseUtils.java.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - + - - - - - - - - + + + + + + + + - - - + - - - | * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
129 130 131 132 133 134 135 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + - - + + | * a parcel, to be used after receiving the result of a transaction. This * will throw the exception for you if it had been written to the Parcel, * otherwise return and let you read the normal result data from the Parcel. * @param reply Parcel to read from * @see Parcel#writeNoException * @see Parcel#readException */ |
︙ | |||
1362 1363 1364 1365 1366 1367 1368 | 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 | - - - - + - | * @param dbVersion the version to set on the db * @param sqlStatements the statements to use to populate the db. This should be a single string * of the form returned by sqlite3's <tt>.dump</tt> command (statements separated by * semicolons) */ static public void createDbFromSqlStatements( Context context, String dbName, int dbVersion, String sqlStatements) { |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/DefaultDatabaseErrorHandler.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - - - - - - + - - + + - + - + - + - + - - - - | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/SQLException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/DatabaseObjectNotClosedException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteAbortException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteAccessPermException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteBindOrColumnIndexOutOfRangeException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteBlobTooBigException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteCantOpenDatabaseException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteClosable.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteConnection.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - - - - - + - - + + - - + + + + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
91 92 93 94 95 96 97 | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | - - | public final class SQLiteConnection implements CancellationSignal.OnCancelListener { private static final String TAG = "SQLiteConnection"; private static final boolean DEBUG = false; private static final String[] EMPTY_STRING_ARRAY = new String[0]; private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; |
︙ | |||
151 152 153 154 155 156 157 | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | - + - - - | private static native String nativeExecuteForString(long connectionPtr, long statementPtr); private static native int nativeExecuteForBlobFileDescriptor( long connectionPtr, long statementPtr); private static native int nativeExecuteForChangedRowCount(long connectionPtr, long statementPtr); private static native long nativeExecuteForLastInsertedRowId( long connectionPtr, long statementPtr); private static native long nativeExecuteForCursorWindow( |
︙ | |||
215 216 217 218 219 220 221 222 | 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | + - + - | private void open() { mConnectionPtr = nativeOpen(mConfiguration.path, mConfiguration.openFlags, mConfiguration.label, SQLiteDebug.DEBUG_SQL_STATEMENTS, SQLiteDebug.DEBUG_SQL_TIME); setPageSize(); setForeignKeyModeFromConfiguration(); setWalModeFromConfiguration(); setJournalSizeLimit(); |
︙ | |||
398 399 400 401 402 403 404 | 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | - - - - - - | } } catch (RuntimeException ex) { throw new SQLiteException("Failed to change locale for db '" + mConfiguration.label + "' to '" + newLocale + "'.", ex); } } |
︙ | |||
428 429 430 431 432 433 434 | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | - + | & SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING) != 0; boolean localeChanged = !configuration.locale.equals(mConfiguration.locale); // Update configuration parameters. mConfiguration.updateParametersFrom(configuration); // Update prepared statement cache size. |
︙ | |||
852 853 854 855 856 857 858 | 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 | - + | try { throwIfStatementForbidden(statement); bindArguments(statement, bindArgs); applyBlockGuardPolicy(statement); attachCancellationSignal(cancellationSignal); try { final long result = nativeExecuteForCursorWindow( |
︙ | |||
1045 1046 1047 1048 1049 1050 1051 | 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 | - - - - - + + + + + - - + + | || statementType == DatabaseUtils.STATEMENT_SELECT) { return true; } return false; } private void applyBlockGuardPolicy(PreparedStatement statement) { |
︙ | |||
1212 1213 1214 1215 1216 1217 1218 | 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 | + + + + - + | private void recyclePreparedStatement(PreparedStatement statement) { statement.mSql = null; statement.mPoolNext = mPreparedStatementPool; mPreparedStatementPool = statement; } private static String trimSqlForDisplay(String sql) { // Note: Creating and caching a regular expression is expensive at preload-time // and stops compile-time initialization. This pattern is only used when // dumping the connection, which is a rare (mainly error) case. So: // DO NOT CACHE. |
︙ | |||
1317 1318 1319 1320 1321 1322 1323 | 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 | + - + + + + + | } else { operation.mFinished = false; operation.mException = null; if (operation.mBindArgs != null) { operation.mBindArgs.clear(); } } operation.mStartWallTime = System.currentTimeMillis(); |
︙ | |||
1374 1375 1376 1377 1378 1379 1380 | 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 | + + + + - + | logOperationLocked(cookie, detail); } } private boolean endOperationDeferLogLocked(int cookie) { final Operation operation = getOperationLocked(cookie); if (operation != null) { if (Trace.isTagEnabled(Trace.TRACE_TAG_DATABASE)) { Trace.asyncTraceEnd(Trace.TRACE_TAG_DATABASE, operation.getTraceMethodName(), operation.mCookie); } |
︙ | |||
1446 1447 1448 1449 1450 1451 1452 | 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 | + + + + - + - + - - + + - + | printer.println(" <none>"); } } } } private static final class Operation { // Trim all SQL statements to 256 characters inside the trace marker. // This limit gives plenty of context while leaving space for other // entries in the trace buffer (and ensures atrace doesn't truncate the // marker for us, potentially losing metadata in the process). |
︙ | |||
1501 1502 1503 1504 1505 1506 1507 1508 1509 | 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 | + + + + + + + + + + + - + | private String getStatus() { if (!mFinished) { return "running"; } return mException != null ? "failed" : "succeeded"; } private String getTraceMethodName() { String methodName = mKind + " " + mSql; if (methodName.length() > MAX_TRACE_METHOD_NAME_LEN) return methodName.substring(0, MAX_TRACE_METHOD_NAME_LEN); return methodName; } private String getFormattedStartTime() { // Note: SimpleDateFormat is not thread-safe, cannot be compile-time created, and is // relatively expensive to create during preloading. This method is only used // when dumping a connection, which is a rare (mainly error) case. So: // DO NOT CACHE. |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteConnectionPool.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - - - - - + - + - + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
992 993 994 995 996 997 998 | 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 | - - - - - - - - - - - - - + | waiter.mSql = null; waiter.mAssignedConnection = null; waiter.mException = null; waiter.mNonce += 1; mConnectionWaiterPool = waiter; } |
︙ | |||
1062 1063 1064 1065 1066 1067 1068 | 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 | - | + ", priority=" + waiter.mPriority + ", sql='" + waiter.mSql + "'"); } } else { indentedPrinter.println("<none>"); } } |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteConstraintException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteCursor.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - - - - - + - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
96 97 98 99 100 101 102 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | - + | * @param editTable the name of the table used for this query * @param query the {@link SQLiteQuery} object associated with this cursor object. */ public SQLiteCursor(SQLiteCursorDriver driver, String editTable, SQLiteQuery query) { if (query == null) { throw new IllegalArgumentException("query object cannot be null"); } |
︙ | |||
136 137 138 139 140 141 142 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | - - - - - - - - - - - - - - - - - - - - + - + | public int getCount() { if (mCount == NO_COUNT) { fillWindow(0); } return mCount; } |
︙ | |||
280 281 282 283 284 285 286 | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | - - | * Release the native resources, if they haven't been released yet. */ @Override protected void finalize() { try { // if the cursor hasn't been closed yet, close it first if (mWindow != null) { |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteCursorDriver.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - - - - - + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteCustomFunction.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - - - - - + + + - - - - - + + + + + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
738 739 740 741 742 743 744 | 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 | - + - - - + + + + + | deleted |= new File(file.getPath() + "-journal").delete(); deleted |= new File(file.getPath() + "-shm").delete(); deleted |= new File(file.getPath() + "-wal").delete(); File dir = file.getParentFile(); if (dir != null) { final String prefix = file.getName() + "-mj"; |
︙ | |||
1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 | 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 | + - + + - + | public long insertOrThrow(String table, String nullColumnHack, ContentValues values) throws SQLException { return insertWithOnConflict(table, nullColumnHack, values, CONFLICT_NONE); } /** * Convenience method for replacing a row in the database. * Inserts a new row if a row does not already exist. * * @param table the table in which to replace the row * @param nullColumnHack optional; may be <code>null</code>. * SQL doesn't allow inserting a completely empty row without * naming at least one column name. If your provided <code>initialValues</code> is * empty, no column names are known and an empty row can't be inserted. * If not set to null, the <code>nullColumnHack</code> parameter * provides the name of nullable column name to explicitly insert a NULL into * in the case where your <code>initialValues</code> is empty. * @param initialValues this map contains the initial column values for |
︙ | |||
1427 1428 1429 1430 1431 1432 1433 | 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 | - + - - - + + - + | * If not set to null, the <code>nullColumnHack</code> parameter * provides the name of nullable column name to explicitly insert a NULL into * in the case where your <code>initialValues</code> is empty. * @param initialValues this map contains the initial column values for the * row. The keys should be the column names and the values the * column values * @param conflictAlgorithm for insert conflict resolver |
︙ | |||
1536 1537 1538 1539 1540 1541 1542 | 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 | - + | * will be replaced by the values from whereArgs. The values * will be bound as Strings. * @param conflictAlgorithm for update conflict resolver * @return the number of rows affected */ public int updateWithOnConflict(String table, ContentValues values, String whereClause, String[] whereArgs, int conflictAlgorithm) { |
︙ | |||
1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 | 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 | + + + + + + + + + + + + + + + | } finally { statement.close(); } } finally { releaseReference(); } } /** * Verifies that a SQL SELECT statement is valid by compiling it. * If the SQL statement is not valid, this method will throw a {@link SQLiteException}. * * @param sql SQL to be validated * @param cancellationSignal A signal to cancel the operation in progress, or null if none. * If the operation is canceled, then {@link OperationCanceledException} will be thrown * when the query is executed. * @throws SQLiteException if {@code sql} is invalid */ public void validateSql(@NonNull String sql, @Nullable CancellationSignal cancellationSignal) { getThreadSession().prepare(sql, getThreadDefaultConnectionFlags(/* readOnly =*/ true), cancellationSignal, null); } /** * Returns true if the database is opened as read only. * * @return True if database is opened as read only. */ public boolean isReadOnly() { |
︙ | |||
1722 1723 1724 1725 1726 1727 1728 | 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 | - + | } } /** * Returns true if the new version code is greater than the current database version. * * @param newVersion The new version code. |
︙ | |||
2190 2191 2192 2193 2194 2195 2196 | 2206 2207 2208 2209 2210 2211 2212 2213 | - + - - - - - - - - | * This can be used to create a function that can be called from * sqlite3 database triggers. * @hide */ public interface CustomFunction { public void callback(String[] args); } |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDatabaseConfiguration.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
157 158 159 160 161 162 163 | 153 154 155 156 157 158 159 160 161 162 163 164 165 | - - - - - - | * @return True if the database is in-memory. */ public boolean isInMemoryDb() { return path.equalsIgnoreCase(MEMORY_DB_PATH); } private static String stripPathForLogs(String path) { |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDatabaseCorruptException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDatabaseLockedException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDatatypeMismatchException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDebug.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - - - - - + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
60 61 62 63 64 65 66 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | - + - + | public static final boolean DEBUG_SQL_TIME = Log.isLoggable("SQLiteTime", Log.VERBOSE); /** * True to enable database performance testing instrumentation. * @hide */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDirectCursorDriver.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - - - - - + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDiskIOException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDoneException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | - - - - - + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteFullException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteGlobal.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - - - - - + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
61 62 63 64 65 66 67 68 69 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | + + - + - + + + - + + + - + + + - + + + - + + + - + + + | /** * Gets the default page size to use when creating a database. */ public static int getDefaultPageSize() { synchronized (sLock) { if (sDefaultPageSize == 0) { // If there is an issue accessing /data, something is so seriously // wrong that we just let the IllegalArgumentException propagate. sDefaultPageSize = new StatFs("/data").getBlockSize(); } |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteMisuseException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteOpenHelper.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - - - - - + - + - - + + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
55 56 57 58 59 60 61 62 63 64 65 66 67 68 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + | // wanted getWritableDatabase. private static final boolean DEBUG_STRICT_READONLY = false; private final Context mContext; private final String mName; private final CursorFactory mFactory; private final int mNewVersion; private final int mMinimumSupportedVersion; private SQLiteDatabase mDatabase; private boolean mIsInitializing; private boolean mEnableWriteAheadLogging; private final DatabaseErrorHandler mErrorHandler; /** |
︙ | |||
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | * {@link #onUpgrade} will be used to upgrade the database; if the database is * newer, {@link #onDowngrade} will be used to downgrade the database * @param errorHandler the {@link DatabaseErrorHandler} to be used when sqlite reports database * corruption, or null to use the default error handler. */ public SQLiteOpenHelper(Context context, String name, CursorFactory factory, int version, DatabaseErrorHandler errorHandler) { this(context, name, factory, version, 0, errorHandler); } /** * Same as {@link #SQLiteOpenHelper(Context, String, CursorFactory, int, DatabaseErrorHandler)} * but also accepts an integer minimumSupportedVersion as a convenience for upgrading very old * versions of this database that are no longer supported. If a database with older version that * minimumSupportedVersion is found, it is simply deleted and a new database is created with the * given name and version * * @param context to use to open or create the database * @param name the name of the database file, null for a temporary in-memory database * @param factory to use for creating cursor objects, null for default * @param version the required version of the database * @param minimumSupportedVersion the minimum version that is supported to be upgraded to * {@code version} via {@link #onUpgrade}. If the current database version is lower * than this, database is simply deleted and recreated with the version passed in * {@code version}. {@link #onBeforeDelete} is called before deleting the database * when this happens. This is 0 by default. * @param errorHandler the {@link DatabaseErrorHandler} to be used when sqlite reports database * corruption, or null to use the default error handler. * @see #onBeforeDelete(SQLiteDatabase) * @see #SQLiteOpenHelper(Context, String, CursorFactory, int, DatabaseErrorHandler) * @see #onUpgrade(SQLiteDatabase, int, int) * @hide */ public SQLiteOpenHelper(Context context, String name, CursorFactory factory, int version, int minimumSupportedVersion, DatabaseErrorHandler errorHandler) { if (version < 1) throw new IllegalArgumentException("Version must be >= 1, was " + version); mContext = context; mName = name; mFactory = factory; mNewVersion = version; mErrorHandler = errorHandler; mMinimumSupportedVersion = Math.max(0, minimumSupportedVersion); } /** * Return the name of the SQLite database being opened, as given to * the constructor. */ public String getDatabaseName() { |
︙ | |||
221 222 223 224 225 226 227 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | - - + + + - | } else { try { if (DEBUG_STRICT_READONLY && !writable) { final String path = mContext.getDatabasePath(mName).getPath(); db = SQLiteDatabase.openDatabase(path, mFactory, SQLiteDatabase.OPEN_READONLY, mErrorHandler); } else { |
︙ | |||
246 247 248 249 250 251 252 | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + | final int version = db.getVersion(); if (version != mNewVersion) { if (db.isReadOnly()) { throw new SQLiteException("Can't upgrade read-only database from version " + db.getVersion() + " to " + mNewVersion + ": " + mName); } if (version > 0 && version < mMinimumSupportedVersion) { File databaseFile = new File(db.getPath()); onBeforeDelete(db); db.close(); if (SQLiteDatabase.deleteDatabase(databaseFile)) { mIsInitializing = false; return getDatabaseLocked(writable); } else { throw new IllegalStateException("Unable to delete obsolete database " + mName + " with version " + version); } } else { |
︙ | |||
293 294 295 296 297 298 299 | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | - - + + - - - - - - - + + + + + + + + - - + + + + + + + + + + + + + + + | if (mDatabase != null && mDatabase.isOpen()) { mDatabase.close(); mDatabase = null; } } /** |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteOutOfMemoryException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteProgram.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteQuery.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteQueryBuilder.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
386 387 388 389 390 391 392 | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | - - + - - - - - - - - - - | // The idea is to ensure that the selection clause is a valid SQL expression // by compiling it twice: once wrapped in parentheses and once as // originally specified. An attacker cannot create an expression that // would escape the SQL expression while maintaining balanced parentheses // in both the wrapped and original forms. String sqlForValidation = buildQuery(projectionIn, "(" + selection + ")", groupBy, having, sortOrder, limit); |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteReadOnlyDatabaseException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteSession.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteStatement.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - - - - - + - + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
77 78 79 80 81 82 83 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - + | /** * Execute this SQL statement and return the ID of the row inserted due to this call. * The SQL statement should be an INSERT for this to be a useful call. * * @return the row ID of the last row inserted, if this insert is successful. -1 otherwise. * |
︙ | |||
99 100 101 102 103 104 105 | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + - + - + | /** * Execute a statement that returns a 1 by 1 table with a numeric value. * For example, SELECT COUNT(*) FROM table; * * @return The result of the query. * |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteStatementInfo.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteTableLockedException.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteTransactionListener.java.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/java/org/sqlite/database/sqlite/SqliteWrapper.java.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - - - - - + - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
46 47 48 49 50 51 52 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | + - + | // FIXME: need to optimize this method. private static boolean isLowMemory(SQLiteException e) { return e.getMessage().equals(SQLITE_EXCEPTION_DETAIL_MESSAGE); } public static void checkSQLiteException(Context context, SQLiteException e) { if (isLowMemory(e)) { Toast.makeText(context, com.android.internal.R.string.low_memory, |
︙ |
Changes to sqlite3/src/main/jni/sqlite/android_database_SQLiteCommon.cpp.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | - - - - + + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
61 62 63 64 65 66 67 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + + + + - | user message */ void throw_sqlite3_exception(JNIEnv* env, int errcode, const char* sqlite3Message, const char* message) { const char* exceptionClass; switch (errcode & 0xff) { /* mask off extended error code */ case SQLITE_IOERR: |
Changes to sqlite3/src/main/jni/sqlite/android_database_SQLiteCommon.h.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - - - - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ |
Changes to sqlite3/src/main/jni/sqlite/android_database_SQLiteConnection.cpp.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | - - - - - - + + + - + + + + + - - - - - - + - - | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
83 84 85 86 87 88 89 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | - - + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - - - - - - - - + | OPEN_READ_MASK = 0x00000001, NO_LOCALIZED_COLLATORS = 0x00000010, CREATE_IF_NECESSARY = 0x10000000, }; sqlite3* const db; const int openFlags; |
︙ | |||
229 230 231 232 233 234 235 | 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | - - + - | delete connection; } } // Called each time a custom function is evaluated. static void sqliteCustomFunctionCallback(sqlite3_context *context, int argc, sqlite3_value **argv) { |
︙ | |||
268 269 270 271 272 273 274 | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | - + + - + - | env->DeleteLocalRef(argsArray); } env->DeleteLocalRef(functionObj); if (env->ExceptionCheck()) { ALOGE("An exception was thrown by custom SQLite function."); |
︙ | |||
310 311 312 313 314 315 316 | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | - - | } static void nativeRegisterLocalizedCollators(JNIEnv* env, jclass clazz, jlong connectionPtr, jstring localeStr) { SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr); const char* locale = env->GetStringUTFChars(localeStr, NULL); |
︙ | |||
365 366 367 368 369 370 371 | 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | - - - - | // is always finalized regardless. ALOGV("Finalized statement %p on connection %p", statement, connection->db); sqlite3_finalize(statement); } static jint nativeGetParameterCount(JNIEnv* env, jclass clazz, jlong connectionPtr, jlong statementPtr) { |
︙ | |||
554 555 556 557 558 559 560 | 508 509 510 511 512 513 514 515 516 517 518 519 520 521 | - | return env->NewString(text, length); } } return NULL; } static int createAshmemRegionWithData(JNIEnv* env, const void* data, size_t length) { |
︙ | |||
584 585 586 587 588 589 590 | 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | - - + | return fd; } } close(fd); } |
︙ | |||
607 608 609 610 611 612 613 | 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | - - - - - + - - - - + + + - - - - - - - + - - + + + + - - - - - + + + + - - - - + + - - - + - - - + - - - - - + + + - - + - - - - + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + - - - + + - - - + - - - - - + + + - - - - - + + + + + + + + + - - - - + - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + - - - - - - + - - - - - - - - - - + + + + + + + + + + - - - + + + + + - - - - - - + + + + - - + + - - - + - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - + + - - - - - - - + - - - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - + + + - - - - + + - - - + + - - - - - - - - - + + + + + + + + + + + + - - - - + + - - - - - + + - + - - - + + - - + - - - - - - - + + + + + + + | return createAshmemRegionWithData(env, blob, length); } } } return -1; } |
︙ | |||
854 855 856 857 858 859 860 | 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 | - - - - - - - + - - - + - + | sqlite3_progress_handler(connection->db, 4, sqliteProgressHandlerCallback, connection); } else { sqlite3_progress_handler(connection->db, 0, NULL, NULL); } } |
︙ | |||
910 911 912 913 914 915 916 | 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 | - + - - - - - - - - - - - - - - - - + - - - + + - - - + + - - + + - - - + + - - - - - - - - - - - - - - - - - - - - | (void*)nativeExecuteForString }, { "nativeExecuteForBlobFileDescriptor", "(JJ)I", (void*)nativeExecuteForBlobFileDescriptor }, { "nativeExecuteForChangedRowCount", "(JJ)I", (void*)nativeExecuteForChangedRowCount }, { "nativeExecuteForLastInsertedRowId", "(JJ)J", (void*)nativeExecuteForLastInsertedRowId }, |
Changes to sqlite3/src/main/jni/sqlite/android_database_SQLiteDebug.cpp.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - - - - - - + + + + + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |
︙ | |||
55 56 57 58 59 60 61 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | - + - + - - - - - - - - - - + - + - - + - + - + | env->SetIntField(statsObj, gSQLiteDebugPagerStatsClassInfo.largestMemAlloc, largestMemAlloc); } /* * JNI registration. */ |
Changes to sqlite3/src/main/jni/sqlite/android_database_SQLiteGlobal.cpp.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | - - - - - - + + - - - - - + + - + + - + + - + + + - + - - - - + - + - - + | * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ |