Commit Graph

532 Commits

Author SHA1 Message Date
Andrei Onea
8c2fb5b99b Add @UnsupportedAppUsage annotations
For packages:
  android.database
  android.hardware.display
  android.hardware.input
  android.hardware.location
  android.location
  android.media
  android.media.projection
  android.media.tv

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Merged-In: I570c08292f8a9f512c96f9dce13f5337718f112c
Change-Id: I1d6c60fcb53f404d5775163bf6929395921f5a45
2019-03-06 15:39:19 +00:00
Xin Li
0e71b4f19b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08:00
Kenny Guy
6cbfa79805 Update SQLiteQueryBuilder to match aosp-master and internal master
SQLiteQueryBuilder.appendWhere and appendWhereEscapeString
has @NonNull in master and aosp-master however not in staging.
This breaks the build in staging now the tool that generates
current.txt includes annotations in the signatures.

Test: lunch aosp_taimen-userdebug && make -j
Change-Id: Iea1728a13f2ed651533328b09517dfb6ad381130
2019-01-21 13:22:25 +00:00
Mathew Inwood
152d5a5dcd Merge "Limit access to suspected false positives."
am: aeda49d185

Change-Id: Ib24456aaad850d5aee46dd242513840511942536
2019-01-02 04:48:33 -08:00
Mathew Inwood
55418eada5 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 14:26:35 +00:00
Adrian Roos
963172ac83 Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi"
am: af0e1c2fa5

Change-Id: I016cacee1e1de6c7a8269fc3605ed25716598d9e
2018-12-12 08:33:17 -08:00
Adrian Roos
6115769c16 API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Merged-In: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-12 15:02:26 +01:00
Jeff Sharkey
0f73219cfa Bind update() args as Object[] for performance.
It's wasteful to convert them to String when SQLite already knows
how to bind specific data types, including funky types like byte[].

Also promote to public API, since they're generally useful.

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
Merged-In: I5b418bca1204773fd2795156a2f47906ca1e1a6b
Change-Id: I386cbc97cf3499823bc10251ff315ce381db24cc
2018-12-03 09:41:16 -07:00
Jeff Sharkey
234de02b59 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: Ibc8ce8b1801e7bfd946655fcf8b6865b6d71227c
Merged-In: Ib4fc8400f184755ee7e971ab5f2095186341730c
2018-12-03 09:40:31 -07:00
Jeff Sharkey
fd5131bba5 Merge changes from topic "sqlitez"
am: a920b9c85e

Change-Id: If22eef6e248b9e3bd1f5e22cd5081608494ad733
2018-12-02 11:32:48 -08:00
Jeff Sharkey
0da04839b7 Support for appending "standalone" WHERE chunks.
The existing appendWhere() methods aren't very friendly for
developers, since they require manual tracking of state to decide if
subsequent standalone chunks should be prefixed with "AND".

While it's tempting to offer direct argument binding on the builder
class, we can't really deliver on that API in a secure way, so instead
add separate bindSelection() method which explicitly burns arguments
into a standalone selection string, which can then be appended to
the builder.

This was the last piece of new functionality being used by
SQLiteStatementBuilder, so we can delete that class and migrate
users back to SQLiteQueryBuilder.

Bug: 111268862
Test: atest frameworks/base/core/tests/coretests/src/android/database/DatabaseUtilsTest.java
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Merged-In: I418f24338c90bae8a9dad473fa76329cea00a8c5
Change-Id: I418f24338c90bae8a9dad473fa76329cea00a8c5
2018-12-01 17:23:05 -07:00
Jeff Sharkey
8a634372b3 Bind update() args as Object[] for performance.
It's wasteful to convert them to String when SQLite already knows
how to bind specific data types, including funky types like byte[].

Also promote to public API, since they're generally useful.

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
Merged-In: I5b418bca1204773fd2795156a2f47906ca1e1a6b
Change-Id: I5b418bca1204773fd2795156a2f47906ca1e1a6b
2018-12-01 17:23:05 -07:00
Jeff Sharkey
e56d8b8a43 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
Merged-In: Ib4fc8400f184755ee7e971ab5f2095186341730c
Change-Id: Ib4fc8400f184755ee7e971ab5f2095186341730c
2018-12-01 17:23:05 -07:00
Jeff Sharkey
6c90f1ded2 Revert SQLiteQueryBuilder for now.
We've encountered subtle bugs in how apps are using this public
API, so revert it back to exactly what shipped in the last
release, and move functionality to new SQLiteStatementBuilder
class, since we already have several customers using it.

Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111486645
Merged-In: Ief059e987f2421e19f6f57a94320c313946a26d7
Change-Id: Ief059e987f2421e19f6f57a94320c313946a26d7
2018-12-01 17:23:04 -07:00
Jeff Sharkey
b17c8e73cb Execute "strict" queries with extra parentheses.
SQLiteQueryBuilder has a setStrict() mode which can be used to
detect SQL attacks from untrusted sources, which it does by running
each query twice: once with an extra set of parentheses, and if that
succeeds, it runs the original query verbatim.

This sadly doesn't catch inputs of the type "1=1) OR (1=1", which
creates valid statements for both tests above, but the final executed
query ends up leaking data due to SQLite operator precedence.

Instead, we need to continue compiling both variants, but we need
to execute the query with the additional parentheses to ensure
data won't be leaked.

Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111085900
Merged-In: I6e8746fa48f9de13adae37d2990de11c9c585381
Change-Id: I6e8746fa48f9de13adae37d2990de11c9c585381
2018-12-01 17:23:04 -07:00
Jeff Sharkey
4039dc4901 Execute "strict" queries with extra parentheses.
SQLiteQueryBuilder has a setStrict() mode which can be used to
detect SQL attacks from untrusted sources, which it does by running
each query twice: once with an extra set of parentheses, and if that
succeeds, it runs the original query verbatim.

This sadly doesn't catch inputs of the type "1=1) OR (1=1", which
creates valid statements for both tests above, but the final executed
query ends up leaking data due to SQLite operator precedence.

Instead, we need to continue compiling both variants, but we need
to execute the query with the additional parentheses to ensure
data won't be leaked.

Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111085900
Merged-In: Ie85a95003ae134eef2fdfbf074c2f82d0a6a9f26
Change-Id: Ie85a95003ae134eef2fdfbf074c2f82d0a6a9f26
2018-12-01 17:23:04 -07:00
Jeff Sharkey
55777e52df Add support for appending standalone phrases.
When users are building queries, they often need to append several
standalone SQL clauses, and it's tedious to track their first clause
so they can manually append " AND " to each subsequent clause.

So add new appendWherePhrase() API which appends a standalone phrase
which is AND'ed together with any existing WHERE query.

Also fix bug in update() which would turn null values into the
string literal "null" instead of passing them through as SQL NULL.

Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111085900
Merged-In: Ia280dd864895654239503e080eaef925f5620d37
Change-Id: Ia280dd864895654239503e080eaef925f5620d37
2018-12-01 17:23:04 -07:00
Jeff Sharkey
0ae655fdae GROUP BY and HAVING aren't ready to be strict.
Despite SQLite documentation saying these clauses follow the "expr"
syntax, queries will fail with obscure "row value misused" errors,
so remove the strict enforcement for now.

Test: manual
Bug: 111480817
Merged-In: Ib8cdcb4e6456110589203189fcfa14e75cd68718
Change-Id: Ib8cdcb4e6456110589203189fcfa14e75cd68718
2018-12-01 17:23:04 -07:00
Jeff Sharkey
3e26b7db55 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.

Extend it to support selection arguments being provided when
appending appendWhere() clauses, meaning developers no longer need
to manually track their local selection arguments along with
remote arguments.

Extend it to support newer ContentProvider.query() variant that
accepts "Bundle queryArgs", and have all query() callers flow
through that common code path.  (This paves the way for a future
CL that will offer to gracefully extract non-WHERE clauses that
callers have tried smashing into their selections.)

Updates ContentValues to internally use more efficient ArrayMap.

Bug: 111268862
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Merged-In: I60b6f69045766bb28d2f21a32c120ec8c383b917
Change-Id: I60b6f69045766bb28d2f21a32c120ec8c383b917
2018-12-01 17:23:04 -07:00
Bill Yi
8b634e9191 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: I695db52f5e22509401258e8b083e7650d401d993
2018-10-24 14:48:44 -07:00
Mathew Inwood
45d2c252b1 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 8c854f86a4)
2018-10-22 17:28:24 -07:00
kopriva
219f7dcb66 docs: fixing errors found with lint checker
through /bluetooth directory

amending through /content directory

Test: make ds-docs

Bug: 117494359

Change-Id: I751e15d60f0b9cc441998b27560050bf62994fef
Exempt-From-Owner-Approval: Docs-only change
2018-10-09 16:01:04 -07:00
TreeHugger Robot
9359f3683c Merge "docs: fix bug 37054309, becuase typo" into pi-dev 2018-09-27 20:03:29 +00:00
kopriva
7364c11185 docs: fix bug 37054309, becuase typo
Test: make ds-docs

Bug: 37054309

Change-Id: I726ed84d62df4036cc274c48ae2f6968f2b7cc3f
Exempt-From-Owner-Approval: Docs-only change
2018-09-27 11:02:07 -07:00
Makoto Onuki
0939c5a2b3 Truncate(*1) it if WAL file is too big when opening DB
*1 -- not truncate(2) but "PRAGMA wal_checkpoint(TRUNCATE)"

Otherwise, depending on how an app operate on a DB, SQLite may not
have a chance to "shrink" the WAL file.

Fixes: 112777941
Bug: 111939259
Test: atest /android/master/frameworks/base/core/tests/coretests/src/android/database/sqlite/SQLiteCompatibilityWalFlagsTest.java
Test: Manual test with google dailer:
1. With normalized_spam.db-wal > 100MB and receive a phone call
-> WAL file gets truncated to 0 bytes.

2. Restart the dialer process and receive a phone call again
-> WAL file is already 0 bytes; won't be truncated.

3. Restart with the WAL file deleted
Same as #2. WAL file will be created before the added logic, but is 0 bytes,
so it won't be truncated.

4. Test with settings put global sqlite_compatibility_wal_flags truncate_size=1024
-> make sure the threshold is overridden

Merged-in: I2b193603e5dfa493ccccb8123db592f0e9c0e7ae
Change-Id: I2b193603e5dfa493ccccb8123db592f0e9c0e7ae
(cherry picked from commit 96e06002ed)
2018-09-24 22:47:02 +00:00
Makoto Onuki
1fda56bbda Fix OWNERS (change google.com to android.com)
Bug: N/A
Test: N/A
Change-Id: I9a9eecfff1a72d7da55be0df73f29985b19c1e38
2018-08-24 14:58:42 -07:00
Makoto Onuki
83c1a68491 Actually make OWNERS in sync with the internal version
Bug: N/A
Test: N/A
Change-Id: Idc1dcc7753a5cf731475ae0f8f01ccd54ac0e3b3
2018-08-24 12:47:20 -07:00
Makoto Onuki
5b3c10cb28 Update OWNERS for database code
Test: N/A

Change-Id: If657f1ac87d9a9e77162816c7ac6abb719b834d4
Merged-in: If657f1ac87d9a9e77162816c7ac6abb719b834d4
2018-08-22 15:43:13 -04:00
Makoto Onuki
962f78649f Default to FULL synchronous mode for sqlite DBs in system server
Test: change pin and immediately crash the kernel with
adb shell 'su root sh -c "echo c >/proc/sysrq-trigger"' and boot
Bug: 112175067

Change-Id: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
(cherry picked from commit 50e00c8dc4)

Merged-in: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
2018-08-17 16:35:46 -07:00
Makoto Onuki
3729e9ce4e Default to FULL synchronous mode for sqlite DBs in system server
Test: change pin and immediately crash the kernel with
adb shell 'su root sh -c "echo c >/proc/sysrq-trigger"' and boot
Bug: 112175067

Change-Id: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
(cherry picked from commit 50e00c8dc4)
2018-08-17 21:09:03 +00:00
Nan Zhang
eb973c97da Merge "Make SQLiteDebug @TestApi" 2018-08-17 16:53:11 +00:00
Fyodor Kupolov
6a82990b5f Make SQLiteDebug @TestApi
Otherwise, Metalava based android_test_current.jar doesn't contain
SQLiteDebug.class which caused build failure on:
out/target/common/obj/APPS/CtsDatabaseTestCases_intermediates/classes-full-debug.jar

Test: CtsDatabaseTestCases
Bug: 77543575
Change-Id: Ied9948e962fb7a81e56be0360cb94b0c318ad14d
Merged-In: Ied9948e962fb7a81e56be0360cb94b0c318ad14d
(cherry-picked from 6fe565e441)
Exempt-From-Owner-Approval: Cherry-picked a CL from git_master, and owner just agreed to use Exempt-From tag.
2018-08-17 16:32:17 +00:00
Jeff Sharkey
19b3d9187e 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 506994268b)
2018-08-16 16:40:00 +00:00
Jeff Sharkey
d1da1d04b9 DO NOT MERGE. Execute "strict" queries with extra parentheses.
SQLiteQueryBuilder has a setStrict() mode which can be used to
detect SQL attacks from untrusted sources, which it does by running
each query twice: once with an extra set of parentheses, and if that
succeeds, it runs the original query verbatim.

This sadly doesn't catch inputs of the type "1=1) OR (1=1", which
creates valid statements for both tests above, but the final executed
query ends up leaking data due to SQLite operator precedence.

Instead, we need to continue compiling both variants, but we need
to execute the query with the additional parentheses to ensure
data won't be leaked.

Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111085900
Change-Id: I6e8746fa48f9de13adae37d2990de11c9c585381
Merged-In: I6e8746fa48f9de13adae37d2990de11c9c585381
(cherry picked from commit 57b04a8680)
2018-08-16 16:39:57 +00:00
Mathew Inwood
f86bea9b42 Add @UnsupportedAppUsage annotations
For packages:
  android.database.sqlite
  android.database

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I0da613d00611e89e49bf73c9ffe35700818efc6b
Merged-In: I2bcc7f0eee31a1775dd7a5dd0f291d0d37bc1292
2018-08-10 16:10:20 +01:00
Jeff Sharkey
506994268b 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
2018-08-03 13:43:44 -06:00
Jeff Sharkey
57b04a8680 DO NOT MERGE. Execute "strict" queries with extra parentheses.
SQLiteQueryBuilder has a setStrict() mode which can be used to
detect SQL attacks from untrusted sources, which it does by running
each query twice: once with an extra set of parentheses, and if that
succeeds, it runs the original query verbatim.

This sadly doesn't catch inputs of the type "1=1) OR (1=1", which
creates valid statements for both tests above, but the final executed
query ends up leaking data due to SQLite operator precedence.

Instead, we need to continue compiling both variants, but we need
to execute the query with the additional parentheses to ensure
data won't be leaked.

Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111085900
Change-Id: I6e8746fa48f9de13adae37d2990de11c9c585381
Merged-In: I6e8746fa48f9de13adae37d2990de11c9c585381
2018-08-03 13:43:40 -06:00
Fyodor Kupolov
8ba2089165 New behavior of setSynchronousMode
setSynchronousMode is now applicable to any journal mode.
This can be useful for apps that want to use stricter durability
settings for their database.

Test: android.database.sqlite.cts.SQLiteDatabaseTest
Bug: 86953240
Change-Id: I7dbaa6d0bc0975da8067e87b402f63f51b4add10
2018-06-01 12:11:42 -07:00
Joshua Baxter
b3c20232f1 docs: fixed typo
am: 3639e2f929

Change-Id: I6f7381045bb25fdcc9f86e3e2dd0d7b8c4eda853
2018-03-27 17:34:53 +00:00
Joshua Baxter
3639e2f929 docs: fixed typo
Test: make ds-docs

Bug: 36941741

Change-Id: I451d8095bcc5d30dbefe3503441d718a69d821ca
2018-03-26 18:17:08 -07:00
Fyodor Kupolov
681ec3128e Include additional information in the dumpsys
Test: adb shell dumpsys dbinfo system
Bug: 64262688
Change-Id: I43d76e505e4d5598994c9af3e615c572017f120c
2018-03-20 18:50:07 -07:00
Fyodor Kupolov
692573b1b2 Introduced DISABLE_COMPATIBILITY_WAL flag
If set, Compatibility WAL will not be used.
Currently this flag is set if SQLiteOpenHelper.setWriteAheadLogging(false)
is called before opening the database. Previously this call was ignored
since ENABLE_WRITE_AHEAD_LOGGING flag is only set when setWriteAheadLogging(true)

Test: CtsDatabaseTestCases
Bug: 74116447
Change-Id: Ic486e178b9da5d747840be739303a2685b91f35b
2018-03-06 13:31:30 -08:00
Fyodor Kupolov
ab05b143ba Added SQLiteOpenHelper.setOpenParams
Using the new constructor can be difficult as it requires an app to
make a decision which version of constructor to use before instantiating
the object. By adding setOpenParams method, apps can keep the old
structure of the code and only add API level check after instantiating
a helper object.

Test: SQLiteOpenHelperTest
Bug: 70863722
Change-Id: I1705dd790e3549d0d8e75eb33b1d9b5bdadcb3c9
2018-02-12 15:33:13 -08:00
Andreas Gampe
3f24e69dbe Frameworks: Annotate trivial @GuardedBy in core/java
Add @GuardedBy for simple functions that require a single lock
and are named XYZLocked.

Bug: 73000847
Test: m
Test: m javac-check-framework RUN_ERROR_PRONE=true
Change-Id: Icb5114fea2ff2385e1cc7511121026099e05c0ee
2018-02-08 02:19:42 -08:00
Fyodor Kupolov
a17858d072 Merge "Fix JavaDoc for enableWriteAheadLogging" 2018-02-07 01:51:57 +00:00
Jeff Sharkey
ad357d1839 Pass in the user defined by Context.
The majority of Manager-style classes already use Context.getUserId()
when making calls into the OS, so clean up the remaining callers to
unify behind this strategy.

This gives @SystemApi developers a nice clean interface to interact
across user boundaries, instead of manually adding "AsUser" or
"ForUser" method variants, which would quickly become unsustainable.

Test: builds, boots
Bug: 72863821
Exempt-From-Owner-Approval: trivial changes
Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
2018-02-03 02:11:45 +00:00
Fyodor Kupolov
4b5c35984c Fix JavaDoc for enableWriteAheadLogging
Test: build
Bug: 65206410
Bug: 64262688
Change-Id: I92e27b048ae8717c5007ac39d6a6de7b59dc7072
2018-02-02 14:57:50 -08:00
Chris Craik
0834e3561e @FastNative for CursorWindow
Test: adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk && adb shell cmd package compile -m speed -f com.android.perftests.core && adb shell am instrument -w -e class android.database.CursorWindowPerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Change-Id: I4d2f8846592426b993ca44a187ac0e2de7313170
2018-01-26 15:03:49 -08:00
Fyodor Kupolov
2abd2a4976 Clarify usage of context in the JavaDoc
The context is only used for resolving database paths.

Test: build
Bug: 70863722
Change-Id: I675dcd35da9d73b57dbd0bf3e357bfffdf485168
2018-01-18 01:39:10 +00:00
Fyodor Kupolov
7fcd659705 Enabled SQLiteCompatibilityWalFlags class
In system_server, it should be deactivated until InstallSystemProviders
is finished.

Test: SQLiteCompatibilityWalFlagsTest
Test: setting put global ... + verify that dumpsys dbinfo has the new flag
Bug: 70226732
Bug: 70517616
Change-Id: Iec6a5e61a5d7e4cc0ac602f2b630357c54bb4456
2017-12-15 17:34:52 -08:00