Commit Graph

15620 Commits

Author SHA1 Message Date
Jeff Sharkey
13f49c4259 RESTRICT AUTOMERGE
Enable stricter SQLiteQueryBuilder options.

Malicious callers can leak side-channel information by using
subqueries in any untrusted inputs where SQLite allows "expr" values.

This change starts using setStrictColumns() and setStrictGrammar()
on SQLiteQueryBuilder to block this class of attacks.  This means we
now need to define the projection mapping of valid columns, which
consists of both the columns defined in the public API and columns
read internally by DownloadInfo.Reader.

We're okay growing sAppReadableColumnsSet like this, since we're
relying on our trusted WHERE clause to filter away any rows that
don't belong to the calling UID.

Remove the legacy Lexer code, since we're now internally relying on
the robust and well-tested SQLiteTokenizer logic.

Bug: 135270103
Bug: 135269143
Test: atest DownloadProviderTests
Test: atest CtsAppTestCases:android.app.cts.DownloadManagerTest
Change-Id: Iec1e8ce18dc4a9564318e0473d9d3863c8c2988a
2019-09-10 11:07:32 -07:00
Pinyao Ting
a6364d92ed fixes a security vulnerability in slice provider
Bug: 138441555
Test: Manual
Change-Id: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
Merged-In: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
(cherry picked from commit 2b415a4c44)
2019-08-28 23:45:04 +00:00
Prabir Pradhan
03dde38efc apply empty transaction in startActivitySync
Force SurfaceFlinger to update synchronously by applying an empty
transaction. Without this, SurfaceFlinger will only update after the
next vsync, which may only happen after the instrumentation already
starts.

Since InputFlinger will only have the proper InputWindowInfo after
SurfaceFlinger updates, waiting for the vsync caused some
instruemntation tests to be flaky.

Bug: 138263890
Test: atest android.view.cts.HoverTest
Change-Id: I5457ab67ac574530dc1aa84549ca11e7e3f0d714
2019-08-07 12:59:01 -07:00
Kevin Hufnagle
4fbcec13a0 docs: Clarified when onRestoreInstanceState() executes
This method executes only after onDestroy() is called.

Change-Id: I4880cc98ea08945f30b16baa7ae400a5bbe3e439
Test: make ds-docs
Bug: 136241777
2019-08-02 15:43:33 +00:00
TreeHugger Robot
2ac934280c Merge "AM: make isHighEndGfx TestApi" into qt-dev 2019-07-16 16:11:19 +00:00
Adrian Roos
5af40871ea AM: make isHighEndGfx TestApi
Bug: 136784434
Test: n/a
Change-Id: Ie26de8dcf64a02b7757d4f705485cdcb7470f511
2019-07-15 12:05:54 +02:00
TreeHugger Robot
261a2d62e2 Merge "Update docs for UID_STATE" into qt-dev 2019-07-09 17:25:49 +00:00
Svet Ganov
6f672a3835 Specify the duration time base
Test: N/A

Bug: 128316830

Change-Id: Idd8f1aaf1a8e0013c01fdf4d668f9d5e81101559
2019-07-08 16:40:45 -07:00
Svet Ganov
05fcd228b5 Update docs for UID_STATE
Test: N/A

Bug: 128919932

Change-Id: Ibac690db3b58293082f762800bbbff0f832a16b2
2019-07-08 16:30:48 -07:00
Louis Chang
ea203cdbdf Avoid making post state to RESUMED for a PAUSING activity
Make sure the client post execution lifecycle state to RESUMED
only if the activity was RESUMED while delivering new intent.

Bug: 135715788
Test: making skype calls
Test: atest ActivityThreadTest

Change-Id: I1e3054e1d1611aecf6ddf6d482abf2cb3ebdf9a4
2019-07-03 09:44:12 +08:00
TreeHugger Robot
f76bdce6e0 Merge "Restore some greylist entries." into qt-dev 2019-06-28 12:02:43 +00:00
Mathew Inwood
3a75f264a8 Restore some greylist entries.
In Q, these APIs were either:
- removed from the greylist entirely without good reason
- Moved to the restricted greylist without any public alternative
  information added

So they are being moved back to the greylist for Q.

Test: Treehugger
Bug: 136102585
Change-Id: I5ac8b8b9b23c3789d80239cf456072cc7dfa1203
2019-06-28 10:15:37 +01:00
David Nelloms
22a5e4e5d9 Merge "Notify on task display change." into qt-dev 2019-06-28 00:12:49 +00:00
davidln
a06b4b2fa5 Notify on task display change.
This is a targeted fix for not receiving a task stack change callback
when a task with a resumed Activity is reparented to another display.

Bug: 128932906

Test: manual - launch activity from virtual display onto default display
  in a new task, verify callback notified. atest WmTests
Change-Id: Idabad8379cded664bcf302d5c6fb69564d158eb7
Merged-In: Idabad8379cded664bcf302d5c6fb69564d158eb7
2019-06-27 18:54:00 +00:00
Hai Zhang
bae001170b Add link to AndroidX Role library in RoleManager documentation.
Fixes: 136119951
Test: presubmit
Change-Id: Iab4c8617983555b04d7c49b7f9583cf2132d57c8
2019-06-27 00:14:44 +00:00
Ioannis Ilkos
9af8d15783 Merge "Add anon RSS + swap metric" into qt-dev 2019-06-24 08:46:40 +00:00
Antoan Angelov
ab34f61c3b Merge "Update docs for EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS." into qt-dev 2019-06-21 18:07:22 +00:00
Ioannis Ilkos
466ad6c3e0 Add anon RSS + swap metric
We are planning to use this metric to detect leaks.

This CL also decouples the actual memory sampling from AM. This means:
- Less time locking the pid list (we used to lock and then read proc)
- Less serialization / deserialization for the parcel
- Simpler to evolve (e.g. removed the HWM-specific method in AM)

Change-Id: I87a7243156dd8c88cfa85038e7e6cf4963e271e1
Test: manual, MemoryStatUtilTest, UidAtomTests
Bug: b/135418017
2019-06-21 11:10:19 +01:00
arangelov
bb2a802a23 Update docs for EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS.
Bug: Fixes: 134391678
Test: manual
Change-Id: I993af4f4a741283294b1754dfc0adc7c6f6f849e
2019-06-20 16:31:10 +01:00
Makoto Onuki
71acb72cbd Merge "Optionally trigger CG in onTrimMemory()" into qt-dev 2019-06-19 23:24:04 +00:00
Makoto Onuki
0a9ee1af2c Optionally trigger CG in onTrimMemory()
Set a trim-level threshold to debug.am.run_gc_trim_level to activate it.

Bug: 135148702
Test: Manual test with "setprop debug.am.run_gc_trim_level 0", run a lot of
heavy apps and take pictures, and check logcat for the "force_gc" event log.
Test: Manual test with "setprop debug.am.run_mallopt_trim_level 0", run a lot of
heavy apps and take pictures, and check logcat for a debug log.

Change-Id: I73b4dc7374e85e9a22c98ab17da53aa6cb25a188
2019-06-19 10:01:55 -07:00
Philip P. Moltmann
c073e956dc Mark getProfileOwnerAsUser(int) as UnsupportedAppUsage again
As it was in P. There are no public APIs created, hence there is no
better, _public_, alternative.

Fixes: 135282729
Test: none
Change-Id: I199cfcc125f948b983eb55a199abf673cc58b7e1
2019-06-14 14:09:35 -07:00
Andrew Solovay
b230dd4fe6 Merge "docs: Fixing broken HTML" into qt-dev 2019-06-10 18:23:40 +00:00
Andrew Solovay
7ad2170f4e docs: Fixing broken HTML
A couple of broken </code> tags were messing up the formatting
for the entire page (see b/134696600 , http://screen/aThdcpoDvJo.png )

Staged the fixed doc to:

http://go/dac-stage/reference/android/app/Activity

(The live version of this doc has already been fixed -- I fixed
the HTML by hand in cl/251937759 -- but we need to fix the Java
comment, or the file will revert when we publish beta 5.)

Bug: 134696600
Test: make ds-docs (& staged HTML output)
Exempt-From-Owner-Approval: Docs-only fix
Change-Id: I7e6d11ca358d747cdc6d04741d31c7acd85aa080
2019-06-07 14:14:04 -07:00
Eugene Susla
fa5fb1f661 Add timeout for setPermissionGrantState
Fixes: 134380096
Test: presubmit
Change-Id: Ifff243068eea2637cf8f6391b52a4c53bc544615
2019-06-07 12:56:47 -07:00
Adam Bookatz
14a34b9efb Merge "loadUnbadgedItemIcon doesn't crash from getUserIcon" into qt-dev 2019-06-06 17:54:24 +00:00
Antoan Angelov
dad55ca4fe Merge "Update docs for EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS." into qt-dev 2019-06-05 14:17:39 +00:00
Bookatz
9313af68c2 loadUnbadgedItemIcon doesn't crash from getUserIcon
AppicationPackageManager.loadUnbadgedItemIcon would call
UserManager.getUserIcon if the icon was supposed to represent
switching to another the parent user (from a work profile).
However, that call requires extra permissions which may not be
available, which would cause a crash. The work profile doesn't
generally have permission to see the parent's icon, so rather
than showing the actual icon, a generic user icon is shown instead.

Bug: 134177607
Test: Manual confirmation: create a work profile and try to share a
picture (from Photos) to the personal profile.

Change-Id: Id79ca50b8e0a26593addbacf1a0ea709a2bc4da2
2019-06-05 03:03:24 +00:00
TreeHugger Robot
57854d3b90 Merge "Post finishing after transition in onBackPressed" into qt-dev 2019-06-04 19:11:52 +00:00
Alan Stokes
9e2457622a Cleanup background activity starts for release.
This removes the parts of the feature that were only needed in beta
releases:
- Toast when a start is or would be blocked.
- Configurable whitelist of exempt apps.
- Global setting to disable.

Not to be submitted until after beta 5 is cut.

Bug: 131747138
Test: atest BackgroundActivityLaunchTest
Test: atest RootWindowContainerTests
Test: atest WmTests:ActivityStarterTests
Test: atest CtsWindowManagerDeviceTestCases:ActivityStarterTests
Test: atest CtsAppTestCases:.ServiceTest

Change-Id: I3d8b9c72c8fac86b93ac57a8a1988f4133043af8
2019-06-04 14:26:00 +00:00
TreeHugger Robot
a54b943d59 Merge "Fix a bug about missing onConfigurationChanged" into qt-dev 2019-06-03 18:09:34 +00:00
arangelov
f59d691da2 Update docs for EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS.
Bug: 134391678
Test: none
Change-Id: I7c88200470163b0ec07f345727cfd85ec4d8b96e
2019-06-03 18:05:51 +01:00
TreeHugger Robot
ae76af46b2 Merge "Prevent double teardown of service connections" into qt-dev 2019-05-31 17:27:34 +00:00
TreeHugger Robot
26a28f64c5 Merge "Remove @VisibleForTesting from DevicePolicyEventLogger getters." into qt-dev 2019-05-30 15:05:26 +00:00
arangelov
3b37af4c3c Remove @VisibleForTesting from DevicePolicyEventLogger getters.
Also make it extendable for mocking and update atoms.proto comments.

Bug: 131833599
Test: compiled
Change-Id: I6a0e8a6175e7e9e46572ea4aa50ce7669a02588b
2019-05-30 14:40:12 +01:00
Christopher Tate
36c998c6b7 Prevent double teardown of service connections
Asynchronicities in activity teardown -> service connection teardown
introduced a race in which the teardown could race with new service
bindings to "the same" service instance, and then wind up attempting to
shut down a new, valid instance inappropriately.  Fixed by making sure
to clear the "what needs to be torn down" bookkeeping as part of the
act of doing that teardown, removing the possibility for stale state.

Fixes: 131029480
Test: manual
Test: atest CtsAppTestCases
Change-Id: I33a63f524d147ff6ec97dd3efb0127dcace8bf3c
2019-05-29 18:46:09 -07:00
Tiger Huang
968064bed0 Fix a bug about missing onConfigurationChanged
The original logic sends the new configuration to the non-activity
components only if there is any public field changed. However, it
doesn't use the latest configuration to compare to the current one,
which caused ActivityThread dropping some onConfigurationChanged
callbacks.

This CL uses the latest configuration to compare to the current one.

Fix: 132653657
Test: Steps in the bug
Change-Id: I969ef189c36ba1903503d8b7de5641103aed8cf3
2019-05-28 07:29:56 +00:00
Rubin Xu
6cf5ea63eb Merge "Fix deadlock in KeyguardDisableHandler" into qt-dev 2019-05-27 19:50:06 +00:00
TreeHugger Robot
98876f0727 Merge "Handling race condition when dumping heaps." into qt-dev 2019-05-25 01:24:39 +00:00
Andrei-Valentin Onea
71a267b66f Merge "Move blacklisted methods back to greylist" into qt-dev 2019-05-24 12:02:31 +00:00
Kweku Adams
4af1b5084b Handling race condition when dumping heaps.
1. The IPC to ActivityThread.dumpHeap() dups the input file descriptor but
closes it when the IPC returns. Since the heap dump is generated
asynchronously, a race condition ensues between the returning close and
the dump being generated. For the intra-system-process call, the race is
with ActivityManagerService closing the created file descriptor. Duping
the file descriptor on the ActivityThread side should deal with this.
2. For some reason, the file descriptor wasn't closed for native heap
dumps. Closing the fd in those cases as well.
3. Catch the RuntimeException from Debug.dumpHprofData in case anything
else was missed.

Bug: 133424499
Test: adb shell am dumpheap com.android.systemui
Test: adb shell am dumpheap system
Test: Use the "Capture System Heap Dump" option in Developer Settings
Change-Id: I44817161533359766250de04e35902587ea9cc40
2019-05-23 16:23:48 -07:00
Sudheer Shanka
c0ff908a40 Trigger a mediascan when downloads get renamed.
Fixes: 132811564
Test: manual
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Change-Id: I319a5b45e703b1eda5846d085c5e1e1e86bbae2b
2019-05-23 10:47:30 -07:00
Mady Mellor
9d662c0f0a Post finishing after transition in onBackPressed
Test: manual - hit back in app & bubbles & when you get a phone call in
      start up wizard
Bug: 132353272

Change-Id: I8bfb868e8e165adb2fa51b6cda1e9afe237d154c
2019-05-23 07:09:18 -07:00
Rubin Xu
13531ccab8 Fix deadlock in KeyguardDisableHandler
At the moment KeyguardDisableHandler calls into DevicePolicyManager
to retrive the aggregated password quality for the current user
while holding the WindowManager lock. This is a lock inversion
and causes deadlock. To fix this, introduce a per-user password quality
cache in DevicePolicyCache and switch KeyguardDisableHandler
to use that instead.

Test: manual
Fix: 129087668
Change-Id: I8c02ca442dde76ed350f22ac04a52adc82d21d00
2019-05-23 11:27:11 +01:00
Sudheer Shanka
4344e7c721 Merge "Don't use linked mediastore uris in DownloadProvider operations." into qt-dev 2019-05-22 02:20:08 +00:00
TreeHugger Robot
7aa28bd502 Merge "Minor improvements on voice interaction workflows." into qt-dev 2019-05-21 21:05:41 +00:00
Sudheer Shanka
1b817f65db Don't use linked mediastore uris in DownloadProvider operations.
When MediaProvider db gets recreated, all the media content ids
get renumbered. It's possible that when DownloadProvider is
trying to delete an entry, it is holding onto a invalid mediastore
uri. So, don't use linked mediastore uris in DownloadProvider
operations. Also, revoke any prior uri grants of media content from
DownloadStorageProvider.

Bug: 132087334
Test: manual
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/AppSecurityTests.java
Change-Id: I4885f5a0ae0b3ab660426605a8a43b8c1d66a4c7
2019-05-21 10:21:43 -07:00
Andrei Onea
2bbb6542f7 Move blacklisted methods back to greylist
These methods used to be greylisted, but have been either accidentally
or prematurely added to blacklist.

Test: m
Bug: 133207859
Change-Id: I0f73828956d0c5e4b1c147580bb11c8073c3461b
2019-05-21 18:13:26 +01:00
TreeHugger Robot
70e0438d59 Merge "Force system ApplicationInfo update and notify DisplayManager" into qt-dev 2019-05-20 19:12:20 +00:00
TreeHugger Robot
b46293f8f6 Merge "Adds setCornerRadius to ActivityView & SurfaceView" into qt-dev 2019-05-20 16:30:20 +00:00