diff --git a/android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp b/android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp index 9fb15d96..e6bad866 100644 --- a/android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp +++ b/android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp @@ -239,7 +239,7 @@ namespace sqlcipher { const char *text = (const char*)sqlite3_column_text(statement, 0); if (strcmp(text, "ok") != 0) { LOGE("integrity check failed for \"%s\": %s\n", integritySql, path8, text); - jniThrowException(env, "net/sqlcipher/database/SQLiteDatabaseCorruptException", text); + jniThrowException(env, "android/database/sqlite/SQLiteDatabaseCorruptException", text); goto done; } } @@ -631,28 +631,28 @@ namespace sqlcipher { const char* exceptionClass; switch (errcode) { case SQLITE_IOERR: - exceptionClass = "net/sqlcipher/database/SQLiteDiskIOException"; + exceptionClass = "android/database/sqlite/SQLiteDiskIOException"; break; case SQLITE_CORRUPT: - exceptionClass = "net/sqlcipher/database/SQLiteDatabaseCorruptException"; + exceptionClass = "android/database/sqlite/SQLiteDatabaseCorruptException"; break; case SQLITE_CONSTRAINT: - exceptionClass = "net/sqlcipher/database/SQLiteConstraintException"; + exceptionClass = "android/database/sqlite/SQLiteConstraintException"; break; case SQLITE_ABORT: - exceptionClass = "net/sqlcipher/database/SQLiteAbortException"; + exceptionClass = "android/database/sqlite/SQLiteAbortException"; break; case SQLITE_DONE: - exceptionClass = "net/sqlcipher/database/SQLiteDoneException"; + exceptionClass = "android/database/sqlite/SQLiteDoneException"; break; case SQLITE_FULL: - exceptionClass = "net/sqlcipher/database/SQLiteFullException"; + exceptionClass = "android/database/sqlite/SQLiteFullException"; break; case SQLITE_MISUSE: - exceptionClass = "net/sqlcipher/database/SQLiteMisuseException"; + exceptionClass = "android/database/sqlite/SQLiteMisuseException"; break; default: - exceptionClass = "net/sqlcipher/database/SQLiteException"; + exceptionClass = "android/database/sqlite/SQLiteException"; break; } diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/DatabaseUtils.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/DatabaseUtils.java index 3ab0ff83..8a66eb6c 100644 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/DatabaseUtils.java +++ b/android-database-sqlcipher/src/main/java/net/sqlcipher/DatabaseUtils.java @@ -16,13 +16,14 @@ package net.sqlcipher; -import net.sqlcipher.database.SQLiteAbortException; -import net.sqlcipher.database.SQLiteConstraintException; +import android.database.SQLException; +import android.database.sqlite.SQLiteAbortException; +import android.database.sqlite.SQLiteConstraintException; import net.sqlcipher.database.SQLiteDatabase; -import net.sqlcipher.database.SQLiteDatabaseCorruptException; -import net.sqlcipher.database.SQLiteDiskIOException; -import net.sqlcipher.database.SQLiteException; -import net.sqlcipher.database.SQLiteFullException; +import android.database.sqlite.SQLiteDatabaseCorruptException; +import android.database.sqlite.SQLiteDiskIOException; +import android.database.sqlite.SQLiteException; +import android.database.sqlite.SQLiteFullException; import net.sqlcipher.database.SQLiteProgram; import net.sqlcipher.database.SQLiteStatement; diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/DefaultDatabaseErrorHandler.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/DefaultDatabaseErrorHandler.java index d9f4e0d7..d133073f 100644 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/DefaultDatabaseErrorHandler.java +++ b/android-database-sqlcipher/src/main/java/net/sqlcipher/DefaultDatabaseErrorHandler.java @@ -20,7 +20,7 @@ import java.util.List; import net.sqlcipher.database.SQLiteDatabase; -import net.sqlcipher.database.SQLiteException; +import android.database.sqlite.SQLiteException; import android.util.Log; import android.util.Pair; diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/SQLException.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/SQLException.java deleted file mode 100644 index 8c8c0373..00000000 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/SQLException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -package net.sqlcipher; - -/** - * An exception that indicates there was an error with SQL parsing or execution. - */ -public class SQLException extends RuntimeException -{ - public SQLException() {} - - public SQLException(String error) - { - super(error); - } -} diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteAbortException.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteAbortException.java deleted file mode 100644 index 89b066ce..00000000 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteAbortException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -package net.sqlcipher.database; - -/** - * An exception that indicates that the SQLite program was aborted. - * This can happen either through a call to ABORT in a trigger, - * or as the result of using the ABORT conflict clause. - */ -public class SQLiteAbortException extends SQLiteException { - public SQLiteAbortException() {} - - public SQLiteAbortException(String error) { - super(error); - } -} diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteConstraintException.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteConstraintException.java deleted file mode 100644 index d9d548f6..00000000 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteConstraintException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -package net.sqlcipher.database; - -/** - * An exception that indicates that an integrity constraint was violated. - */ -public class SQLiteConstraintException extends SQLiteException { - public SQLiteConstraintException() {} - - public SQLiteConstraintException(String error) { - super(error); - } -} diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteCursor.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteCursor.java index 258699b3..c65006bb 100644 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteCursor.java +++ b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteCursor.java @@ -19,7 +19,7 @@ import net.sqlcipher.AbstractWindowedCursor; import net.sqlcipher.BuildConfig; import net.sqlcipher.CursorWindow; -import net.sqlcipher.SQLException; +import android.database.SQLException; import java.lang.ref.WeakReference; import java.util.HashMap; diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDatabase.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDatabase.java index 8bf94945..3f4e14d2 100644 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDatabase.java +++ b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDatabase.java @@ -22,7 +22,7 @@ import net.sqlcipher.DatabaseUtils; import net.sqlcipher.DatabaseErrorHandler; import net.sqlcipher.DefaultDatabaseErrorHandler; -import net.sqlcipher.SQLException; +import android.database.SQLException; import net.sqlcipher.database.SQLiteDebug.DbStats; import net.sqlcipher.database.SQLiteDatabaseHook; import net.sqlcipher.database.SQLiteQueryStats; @@ -54,6 +54,8 @@ import android.content.Context; +import android.database.sqlite.SQLiteDatabaseCorruptException; +import android.database.sqlite.SQLiteException; import android.os.CancellationSignal; import android.os.Debug; import android.os.SystemClock; diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDatabaseCorruptException.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDatabaseCorruptException.java deleted file mode 100644 index 2e7373ca..00000000 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDatabaseCorruptException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -package net.sqlcipher.database; - -/** - * An exception that indicates that the SQLite database file is corrupt. - */ -public class SQLiteDatabaseCorruptException extends SQLiteException { - public SQLiteDatabaseCorruptException() {} - - public SQLiteDatabaseCorruptException(String error) { - super(error); - } -} diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDiskIOException.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDiskIOException.java deleted file mode 100644 index de4b5431..00000000 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDiskIOException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -package net.sqlcipher.database; - -/** - * An exception that indicates that an IO error occured while accessing the - * SQLite database file. - */ -public class SQLiteDiskIOException extends SQLiteException { - public SQLiteDiskIOException() {} - - public SQLiteDiskIOException(String error) { - super(error); - } -} diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDoneException.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDoneException.java deleted file mode 100644 index f0f6f0dc..00000000 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteDoneException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -package net.sqlcipher.database; - -/** - * An exception that indicates that the SQLite program is done. - * Thrown when an operation that expects a row (such as {@link - * SQLiteStatement#simpleQueryForString} or {@link - * SQLiteStatement#simpleQueryForLong}) does not get one. - */ -public class SQLiteDoneException extends SQLiteException { - public SQLiteDoneException() {} - - public SQLiteDoneException(String error) { - super(error); - } -} diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteException.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteException.java deleted file mode 100644 index 2c7f11a3..00000000 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -package net.sqlcipher.database; - -import net.sqlcipher.*; - -/** - * A SQLite exception that indicates there was an error with SQL parsing or execution. - */ -public class SQLiteException extends SQLException { - public SQLiteException() {} - - public SQLiteException(String error) { - super(error); - } -} diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteFullException.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteFullException.java deleted file mode 100644 index 66af19fe..00000000 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteFullException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -package net.sqlcipher.database; - -/** - * An exception that indicates that the SQLite database is full. - */ -public class SQLiteFullException extends SQLiteException { - public SQLiteFullException() {} - - public SQLiteFullException(String error) { - super(error); - } -} diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteMisuseException.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteMisuseException.java deleted file mode 100644 index ef261fc7..00000000 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteMisuseException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -package net.sqlcipher.database; - -public class SQLiteMisuseException extends SQLiteException { - public SQLiteMisuseException() {} - - public SQLiteMisuseException(String error) { - super(error); - } -} diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteOpenHelper.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteOpenHelper.java index 259b5b5e..4853f96d 100644 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteOpenHelper.java +++ b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteOpenHelper.java @@ -23,6 +23,8 @@ import net.sqlcipher.DefaultDatabaseErrorHandler; import net.sqlcipher.database.SQLiteDatabaseHook; import net.sqlcipher.database.SQLiteDatabase.CursorFactory; + +import android.database.sqlite.SQLiteException; import android.util.Log; /** diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteQuery.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteQuery.java index ab402465..c87bd590 100644 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteQuery.java +++ b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SQLiteQuery.java @@ -17,6 +17,8 @@ package net.sqlcipher.database; import net.sqlcipher.*; +import android.database.sqlite.SQLiteDatabaseCorruptException; +import android.database.sqlite.SQLiteMisuseException; import android.os.SystemClock; import android.util.Log; diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SqliteWrapper.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SqliteWrapper.java index b1bbbfb4..1d15f99e 100644 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SqliteWrapper.java +++ b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SqliteWrapper.java @@ -23,6 +23,7 @@ import net.sqlcipher.*; +import android.database.sqlite.SQLiteException; import android.net.Uri; import android.util.Log; import android.widget.Toast; diff --git a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SupportHelper.java b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SupportHelper.java index f607645e..26960617 100644 --- a/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SupportHelper.java +++ b/android-database-sqlcipher/src/main/java/net/sqlcipher/database/SupportHelper.java @@ -16,7 +16,7 @@ package net.sqlcipher.database; -import net.sqlcipher.database.SQLiteException; +import android.database.sqlite.SQLiteException; import androidx.sqlite.db.SupportSQLiteDatabase; import androidx.sqlite.db.SupportSQLiteOpenHelper;