Commit Graph

84700 Commits

Author SHA1 Message Date
John Reck
06efa7169a Merge "Expose async & counter publicly" 2018-07-17 16:46:56 +00:00
Jeff Sharkey
4237b16cac Merge changes from topic "downloadvuln"
* changes:
  Execute "strict" queries with extra parentheses.
  Add support for appending standalone phrases.
2018-07-17 16:12:14 +00:00
John Reck
d5a9dc06be Expose async & counter publicly
Also add some go-faster to the JNI

Before:
android.os.TracePerfTest:INSTRUMENTATION_STATUS: enabled_mean=13
INSTRUMENTATION_STATUS: enabled_median=13
INSTRUMENTATION_STATUS: enabled_min=13
INSTRUMENTATION_STATUS: enabled_standardDeviation=0
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: beginEndSection_mean=3849
INSTRUMENTATION_STATUS: beginEndSection_median=3850
INSTRUMENTATION_STATUS: beginEndSection_min=3829
INSTRUMENTATION_STATUS: beginEndSection_standardDeviation=14
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: counter_mean=1836
INSTRUMENTATION_STATUS: counter_median=1837
INSTRUMENTATION_STATUS: counter_min=1832
INSTRUMENTATION_STATUS: counter_standardDeviation=2
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: asyncBeginEnd_mean=4992
INSTRUMENTATION_STATUS: asyncBeginEnd_median=4988
INSTRUMENTATION_STATUS: asyncBeginEnd_min=4964
INSTRUMENTATION_STATUS: asyncBeginEnd_standardDeviation=21
INSTRUMENTATION_STATUS_CODE: -1

After:
android.os.TracePerfTest:INSTRUMENTATION_STATUS: enabled_mean=13
INSTRUMENTATION_STATUS: enabled_median=13
INSTRUMENTATION_STATUS: enabled_min=13
INSTRUMENTATION_STATUS: enabled_standardDeviation=0
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: beginEndSection_mean=2974
INSTRUMENTATION_STATUS: beginEndSection_median=2971
INSTRUMENTATION_STATUS: beginEndSection_min=2958
INSTRUMENTATION_STATUS: beginEndSection_standardDeviation=15
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: counter_mean=1737
INSTRUMENTATION_STATUS: counter_median=1739
INSTRUMENTATION_STATUS: counter_min=1732
INSTRUMENTATION_STATUS: counter_standardDeviation=3
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: asyncBeginEnd_mean=3677
INSTRUMENTATION_STATUS: asyncBeginEnd_median=3679
INSTRUMENTATION_STATUS: asyncBeginEnd_min=3663
INSTRUMENTATION_STATUS: asyncBeginEnd_standardDeviation=11
INSTRUMENTATION_STATUS_CODE: -1

Test: builds, benchmarks, verified tracing still works
Bug: 111503982
Change-Id: I71cb026d034bf9b9f97427d10d5ff9ce3d103561
2018-07-17 14:35:01 +00:00
Martijn Coenen
09fa656886 Merge changes I4e06b3f9,Iffcbbb82,If9dd6913
* changes:
  Move proxy debug info dumping back to Java.
  Dump top binder proxy interface names in dumpsys.
  Make BinderProxy @hide public class.
2018-07-17 12:20:30 +00:00
TreeHugger Robot
56d2327bcb Merge "Remove unused line in PrecomputedText" 2018-07-17 10:53:58 +00:00
Martijn Coenen
331d8dc9fe Move proxy debug info dumping back to Java.
This had to be called from native because serialization
was done from native, but now that serialization is in Java
we can move this back to a more logical place.

Also, this allows us to dump the per-UID proxy counts in
this situation again.

Bug: 109888955
Test: sailfish builds, proxy debug info shown on hitting limits
Change-Id: I4e06b3f93e30ed1c7868ec9e018709a7e796e441
2018-07-17 11:16:17 +02:00
Martijn Coenen
ba75cf1101 Dump top binder proxy interface names in dumpsys.
To facilitate real-time debugging.

Bug: 109888955
Test: builds, adb shell dumpsys activity binder-proxies shows output
Change-Id: Iffcbbb824f4050b6fb8f556c8b4d09115e53da18
2018-07-17 11:16:11 +02:00
Martijn Coenen
03e6d923c5 Make BinderProxy @hide public class.
To make some future refactoring easier.

Added some JavaDoc (mostly links to android.os.IBinder)
to make checkstyle happy.

Test: builds
Change-Id: If9dd6913868a34ea1e3d14fee1860a4ff368e06b
2018-07-17 10:02:06 +02:00
TreeHugger Robot
c3aadf378a Merge "Make stop complete notification call in to ActivityManager blocking." 2018-07-17 05:46:21 +00:00
Seigo Nonaka
73146e7ceb Remove unused line in PrecomputedText
Bug: N/A
Test: N/A
Change-Id: I2456116657d8be893a8c477df14a5de490fbaa37
2018-07-16 18:09:32 -07:00
Jeff Sharkey
a58d6e3405 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: Ie85a95003ae134eef2fdfbf074c2f82d0a6a9f26
2018-07-16 17:21:50 -06:00
Jeff Sharkey
99cc118423 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
Change-Id: Ia280dd864895654239503e080eaef925f5620d37
2018-07-16 14:56:03 -06:00
Christopher Morin
8726b3b84c Merge "Reland "OOM score management"" 2018-07-16 20:06:05 +00:00
Jeff Sharkey
c43acd30c2 Merge "GROUP BY and HAVING aren't ready to be strict." 2018-07-16 16:49:12 +00:00
Jeff Sharkey
bba22006d6 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
Change-Id: Ib8cdcb4e6456110589203189fcfa14e75cd68718
2018-07-16 10:44:15 -06:00
Derek Sollenberger
b6c4f6cda9 Merge "TextView setOverlappingRendering must be true when shadows are used." 2018-07-16 15:49:42 +00:00
Neil Fuller
b1d24c0ace Merge "Avoid use of DateUtilsBridge.icuTimeZone()" am: e859c42e23 am: 25fd54f6f3
am: 3208539011

Change-Id: Ib45c4fd371c9b4b4ab97973eddfd49101c353cc3
2018-07-16 02:09:18 -07:00
Neil Fuller
3208539011 Merge "Avoid use of DateUtilsBridge.icuTimeZone()" am: e859c42e23
am: 25fd54f6f3

Change-Id: I0083ddcadbc391a26ae8d264f8626bdf3b8f988f
2018-07-16 01:58:14 -07:00
Neil Fuller
25fd54f6f3 Merge "Avoid use of DateUtilsBridge.icuTimeZone()"
am: e859c42e23

Change-Id: I6b6452f9609d88ce61959e7c4ae4f0fd8fa97e64
2018-07-16 01:50:04 -07:00
Jeff Sharkey
162d771709 Merge "Extend SQLiteQueryBuilder for update and delete." 2018-07-14 21:35:29 +00:00
TreeHugger Robot
8abf777389 Merge "Better Handling of Battery Stats History Overflow" 2018-07-14 03:07:29 +00:00
TreeHugger Robot
672dbd5b3a Merge "Make ENABLE_COPY_OPTIMIZATIONS non final." 2018-07-14 02:08:40 +00:00
Hui Yu
0ed84f1263 Better Handling of Battery Stats History Overflow
Previously battery history is kept in the in-memory mHistoryBuffer
with size of 512KB (96KB on low memory device). When the buffer is
close to full we drop certain types of history. When the buffer is
full the whole buffer is reset and we lost elder history. On a
device with long battery life this problem is more frequent.

This CL changes mHistoryBuffer to 128KB (64KB on low memory device).
When the buffer is full, it is saved to history file on file system.
By default we allow 32 history files (64 history files on low-memory
device) which gives us 4MB history (compare to 512KB today).

The MAX_HISTORY_BUFFER and MAX_HISTORY_FILES can be remote configured
through GServices or P/H.

In case of history exceeding 4MB, the oldest history file is deleted
and new history file is open.

This change increases battery history by using disk file and the
chance of losing history is greatly reduced.

Bug: 67297625
Test: adb shell dumpsys batterystats --history
Change-Id: Id9aafea761649d7323b97d1e44135f7880a95414
2018-07-13 17:31:19 -07:00
Jorim Jaggi
5439a6ea84 Merge "Pin compiled code of HOME app" into pi-dev
am: 0e5e46f874

Change-Id: I205971bc6c8309fc4ad40b4a4677703adecf4a75
2018-07-13 17:13:14 -07:00
Jeff Sharkey
6adc98c09c 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
Change-Id: I60b6f69045766bb28d2f21a32c120ec8c383b917
2018-07-13 18:11:37 -06:00
Chris Morin
0260f3d79f Reland "OOM score management"
Add 2 additional attirubte |isFocused| and |lastActivityTime| in
ActivityManager.RunningAppProcessInfo and pass them to Chrome via IPC
so Chrome can better prioritize ARC processes.

Bug: 29576205
Test: Ensure new process information is passed to Chrome.
2018-07-13 15:54:03 -07:00
Jorim Jaggi
0e5e46f874 Merge "Pin compiled code of HOME app" into pi-dev 2018-07-13 22:36:08 +00:00
Shrijana Ghimire
8e63b746ba Merge "Merge "docs: Fixed typos in AdapterView Javadoc." into pi-dev am: 9ef41ccf42" into pi-dev-plus-aosp
am: 74ecab8a44

Change-Id: I676fa766b26ecfc145ed4d5dd60b1af70dc99529
2018-07-13 12:48:15 -07:00
Shrijana Ghimire
a58f9d550d Merge "docs: Fixed typos in AdapterView Javadoc." into pi-dev
am: 9ef41ccf42

Change-Id: I03291b3758127de3bfef480a6561930f5901014c
2018-07-13 12:29:55 -07:00
Shrijana Ghimire
9ef41ccf42 Merge "docs: Fixed typos in AdapterView Javadoc." into pi-dev 2018-07-13 19:03:24 +00:00
Neil Fuller
6d5c4a8d8d Avoid use of DateUtilsBridge.icuTimeZone()
DateUtilsBridge is only used in one place in framework.
The usage is avoidable by sticking to java.util. This
decreases the number of non-public libcore classes in
use by framework.

Test: build
Bug: 111055375
Change-Id: Ifd6576b5b6df1e154f16ec201a4575d0b95de66d
2018-07-13 19:54:29 +01:00
Derek Sollenberger
d4ca6d1c7a TextView setOverlappingRendering must be true when shadows are used.
The updates to the HWUI renderer now require that setOverlappingRendering be
set when shadows are used.  Without this change modifying the alpha of the
TextView will produce incorrect blending results.

Bug: 111381525
Test: Test app in bug
Change-Id: I523c5ef698e8db912dd2ef848eeeffb3465b990a
2018-07-13 12:02:53 -04:00
TreeHugger Robot
141d67c3a7 Merge "Pin compiled code of HOME app" 2018-07-13 15:47:19 +00:00
Julia Reynolds
b992c34510 Merge "Add notification settings to backup&restore" 2018-07-13 14:17:07 +00:00
Jorim Jaggi
7119800f4b Pin compiled code of HOME app
Keeping the code in memory of the currently set home app is
important for latency as we don't have any kind of starting
window/splash screen when pressing the home app to hide any latency.

Memory impact:

Pinning dex/vdex:

In practical scenarios, this should be < 500kb.
The home app is usually profile-speed compiled, for which the
resulting dex/vdex files are about 2 mb. However, during regular
use, at least 1.5 MB of it is referenced in memory. This makes
sense: By definition profile-speed only compiles the things that
is usually frequently executed during regular execution.

Pinning apk:
With Launcher 3 in practical scenarios this should be about 3.7 MB,
as the APK is about 5.7 MB but 2 MB are usually referenced in any
case.

Bug: 111132016
Bug: 78585335
Test: Inspect "adb shell dumpsys pinner" after boot.
Test: Check for pinned files after updating camera/home.
Test: Check for pinned files after user switch with different
default apps.
Test: Check for pinned files after bg-dexopt.
Test: Check for pinned files after bg-dexopt + kill pid.

Change-Id: I6cdbc06d089efeb1c72a51216879ba0573502009
Merged-In: I6cdbc06d089efeb1c72a51216879ba0573502009
2018-07-13 13:20:48 +00:00
Jorim Jaggi
402d78ebb7 Pin compiled code of HOME app
Keeping the code in memory of the currently set home app is
important for latency as we don't have any kind of starting
window/splash screen when pressing the home app to hide any latency.

Memory impact:

Pinning dex/vdex:

In practical scenarios, this should be < 500kb.
The home app is usually profile-speed compiled, for which the
resulting dex/vdex files are about 2 mb. However, during regular
use, at least 1.5 MB of it is referenced in memory. This makes
sense: By definition profile-speed only compiles the things that
is usually frequently executed during regular execution.

Pinning apk:
With Launcher 3 in practical scenarios this should be about 3.7 MB,
as the APK is about 5.7 MB but 2 MB are usually referenced in any
case.

Bug: 111132016
Bug: 78585335
Test: Inspect "adb shell dumpsys pinner" after boot.
Test: Check for pinned files after updating camera/home.
Test: Check for pinned files after user switch with different
default apps.
Test: Check for pinned files after bg-dexopt.
Test: Check for pinned files after bg-dexopt + kill pid.

Change-Id: I6cdbc06d089efeb1c72a51216879ba0573502009
2018-07-13 15:16:48 +02:00
TreeHugger Robot
f97fa4d77b Merge "Skip execution of transactions on a destroyed activity" 2018-07-13 03:38:16 +00:00
Lucas Dupin
401ea1647a Merge "Dark Notification Shade" 2018-07-13 02:09:31 +00:00
Lucas Dupin
f03e752407 Dark Notification Shade
Test: adb shell service call uimode 4 i32 1 # day
Test: adb shell service call uimode 4 i32 2 # night
Bug: 110758454
Change-Id: Ib6fce91d1aeff7e1fbfe8a7a528095487fbdb3f8
2018-07-12 17:30:34 -07:00
Jorim Jaggi
bdc73423c6 Merge "DO NOT MERGE Remove WTF spam" into pi-dev
am: 650ead619e

Change-Id: I6d4300530516c25a5eb9af8ea8f924591eff3b95
2018-07-12 15:09:20 -07:00
Tomasz Wasilczyk
5f6ba52f59 Export BandDescriptor for AIDL.
Bug: 73950974
Test: it builds
Change-Id: I96321c24c96a848ab01cca47f563d70e4ff99b89
2018-07-12 21:51:01 +00:00
Jorim Jaggi
650ead619e Merge "DO NOT MERGE Remove WTF spam" into pi-dev 2018-07-12 21:32:53 +00:00
TreeHugger Robot
aa29832a8b Merge "Make IAutofillManager fully oneway." 2018-07-12 20:31:25 +00:00
TreeHugger Robot
a741f5dca4 Merge "Depecrate flags, and try to match them to actions" 2018-07-12 19:34:40 +00:00
Neil Fuller
a57acd367c Merge "Move XML object factory logic to libcore" am: 8176fb99e1
am: 7add22db60

Change-Id: If395891203fae0a8b55f8f58430adc979b758db2
2018-07-12 11:42:14 -07:00
Neil Fuller
7add22db60 Merge "Move XML object factory logic to libcore"
am: 8176fb99e1

Change-Id: Ib0940ecb89eaf11841bbd66cdaf1c5379466496c
2018-07-12 11:26:03 -07:00
Donghui Han
ebc6cb38a0 Merge "camera2: Treat face detect mode larger than FULL as FULL" into pi-dev am: 2fca393cc1
am: d05d630060

Change-Id: I3947264d88d0c558f8c7fb5ee22160af934e411e
2018-07-12 11:19:07 -07:00
Donghui Han
d05d630060 Merge "camera2: Treat face detect mode larger than FULL as FULL" into pi-dev
am: 2fca393cc1

Change-Id: I77b6b8e6d469a9e28478ddd7975f9c065caef20b
2018-07-12 10:47:53 -07:00
Felipe Leme
d4e52285ed Make IAutofillManager fully oneway.
The critical methods on this interface - like updateSession() - were already
void, so all we had to do were to "onewaywize" the other methods. We could
either refactor them to be truly async, or implement a blocking mechanism that
let them still be sync *and* oneway - because these methods are not in the
critical path, we opted for the latter, which is simpler and less risky.

Fixes: 73536867

Test: mmma -j ./frameworks/base/apct-tests/perftests/autofill/ && \
      adb install -r $OUT/data/app/AutofillPerfTests/AutofillPerfTests.apk && \
      adb shell am instrument -w -e class android.view.autofill.LoginTest \
      com.android.perftests.autofill/android.support.test.runner.AndroidJUnitRunner
Test: CtsAutoFillServiceTestCases

Change-Id: I380430aa2a7805aed6f629afb360566fc5402abb
2018-07-12 10:37:05 -07:00
Brett Chabot
968a5322b9 Make ENABLE_COPY_OPTIMIZATIONS non final.
Test: make -j56 Run_robolectric_robolectric_tests
Change-Id: I6ef235fef5a2daf55fab059b4d1b3a9afce09c8d
2018-07-12 10:33:43 -07:00