OSDN Git Service

DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete.
authorJeff Sharkey <jsharkey@android.com>
Wed, 25 Jul 2018 20:52:14 +0000 (14:52 -0600)
committerSimon Shields <simon@lineageos.org>
Tue, 30 Oct 2018 11:33:34 +0000 (12:33 +0100)
commitc8304458dae5337c803013a723b4cede94af754d
treeec65db5a6162bb0784dae1aee1b0f68a627429b6
parent2671e7cfcc4f2c1f2b317453d30ceb05414b5db8
DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete.

Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks.  This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.

Bug: 111085900
Test: atest packages/providers/DownloadProvider/tests/
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Change-Id: Ib4fc8400f184755ee7e971ab5f2095186341730c
Merged-In: Ib4fc8400f184755ee7e971ab5f2095186341730c
(cherry picked from commit 506994268bc4fa07d8798b7737a2952f74b8fd04)
core/java/android/database/sqlite/SQLiteDatabase.java
core/java/android/database/sqlite/SQLiteQueryBuilder.java