Commit Graph

17846 Commits

Author SHA1 Message Date
Hui Yu
c05fd22ce1 Merge "Add uid to PendingStartActivityUids when activity resumed." into rvc-dev 2020-06-09 05:01:28 +00:00
Hui Yu
08ab384989 Add uid to PendingStartActivityUids when activity resumed.
Previously we add uid to PendingStartActivityUids at activity start.
Now we also add uid to PendingStartActivityUids at activity resumed
because we can not wait for updateOomAdj() to be run by a runnable that
WindowManager send to DisplayThread at activity resumed.

At ActivityManagerService.getProcessStatesAndOomScoresForPIDs(), if the
ProcessRecord is in PendingStartActivityUids, we hard code the
ProcessRecord to be PROCESS_STATE_TOP and FOREGROUND_APP_ADJ, ahead of
result of updateOomAdj() the comes later.

Bug: 155143386, 157180494
Test: Reproduce steps of 155143386, swipe between GCA and
Snapchat, camera access is allowed after swipe.

Change-Id: Ia11b0e3400e4df851b250beb01dcfda43580668b
2020-06-08 15:35:26 -07:00
Joanne Chung
c6adc68368 Handle SyncResultReceiver.TimeoutException
1.Change SyncResultReceiver.TimeoutException to checked exception
2.Handle the SyncResultReceiver.TimeoutException in AutofillManager,
ContentCaptureManager, ContentSuggestionsManager
3.Fix the bug we should throw e.rethrowFromSystemServer()

Bug: 156044027
Test: atest CtsAutoFillServiceTestCases
Test: atest ContentSuggestionsManagerTest
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I959d2aca2b80866c076fae2520de66c123f5367d
2020-06-08 14:53:45 +08:00
Shawn Lin
c54d84a858 Merge "Add a @hide ctr to disable background layer in ActivityView & SurfaceView" into rvc-dev 2020-06-08 03:34:20 +00:00
Philip P. Moltmann
8083336a88 Merge "Make it clear that checking shouldShowPermissionRationale is recommended" into rvc-dev 2020-06-06 18:10:11 +00:00
Steve Elliott
05e10b59af Merge "Fix missing icon for one-to-one convos" into rvc-dev 2020-06-06 15:12:04 +00:00
Svetoslav Ganov
0ce4fba38f Merge "Correctly offset app op history on reboot" into rvc-dev 2020-06-06 14:50:03 +00:00
Stanislav Zholnin
c784a29dfd Merge "Keep unforwarded operation for noted ops." into rvc-dev 2020-06-06 14:12:38 +00:00
Stanislav Zholnin
e44f134adb Keep unforwarded operation for noted ops.
Align treatment of noted ops with AsyncNotedOps.

Fixes: 154775996
Test: atest AppOpsLoggingTest#disableCollectedAndNoteSyncOpAndCheckLog
Change-Id: I3dcd8275b6229946875bc184d25b18d2da76d5ba
Merged-In: I3dcd8275b6229946875bc184d25b18d2da76d5ba
2020-06-06 06:45:16 +00:00
Vinit Nayak
2983b70983 Merge "Pass displayId to onActivityRotation()" into rvc-dev 2020-06-05 18:58:32 +00:00
Ryan Mitchell
0053a10ea0 Merge "Use a ReferenceQueue to prune weak references" into rvc-dev 2020-06-05 18:27:50 +00:00
Svet Ganov
185ddf644b Correctly offset app op history on reboot
The offset was computed based off the offset represented by
the most recent historical file while we have to use the time
this file was written.

Also now we persist the history on reboot and shutdown,
significantly minimizing the possibility of data loss.

Added test API to emulate reboot of the history to allow for
precise and tightly controlled test to prevent flakes due to
boot time deviations.

Test: atest android.app.appops.cts.HistoricalAppopsTest#testRebootHistory

Fixes:156853195

Change-Id: I4142371f8bc2b1d710cc8c300e7e79cb03764c04
2020-06-05 09:55:27 -07:00
shawnlin
ba532aff3e Add a @hide ctr to disable background layer in ActivityView & SurfaceView
Bug: 152441717
Test: 1. Open bubble
      2. adb shell dumpsys SurfaceFlinger
      3. Check result
Change-Id: I3bda67bb56781eb75b51dc51f491a97efac7b4ef
2020-06-05 16:08:37 +08:00
Vinit Nayak
bedb9f33c2 Pass displayId to onActivityRotation()
Bug: 154580671
Change-Id: I220e1e9ac1a381c6ebadc3849a393225d1f53e3e
2020-06-04 17:15:32 -07:00
Steve Elliott
3d360da16d Fix missing icon for one-to-one convos
Fixes: 158089612
Test: manual
Change-Id: If588073ff1df557b755b844277e893e001822d79
2020-06-04 11:11:11 -04:00
Riddle Hsu
1421b3dace Merge "Override application display adjustments while launching activity" into rvc-dev 2020-06-04 06:20:45 +00:00
Vinit Nayak
38dbc97939 Merge "Add new callback for when activity rotates" into rvc-dev 2020-06-04 04:21:10 +00:00
Ryan Mitchell
a74111f81c Use a ReferenceQueue to prune weak references
Currently ResourcesManager iterates over all of its weak references to
Resources objects and calls Reference#get to determine if the object
has been garbage collected. This method of pruning WeakReferences
causes reference locks to be acquired in the native layer and causes
lock contention when "references are being processed" by the garbage
collector.

This change uses a ReferenceQueue to determine if a reference has been
garbage collected which should improve performance of
ResourcesManager#getResources when the system is under memory pressure.

By only removing garbage collected references when creating new
Resources objects, the lists grow larger and are periodically pruned
rather than attempting to prune entries from the list every getResources
invocation.

Bug: 157575833
Test: used debugger to observe pruning happening correctly
hange-Id: I3277e80edfa441d24de165e738d33c4fac6b4121
Change-Id: I3277e80edfa441d24de165e738d33c4fac6b4121
2020-06-04 00:47:35 +00:00
Peiyong Lin
1371b76afd Merge "Allow to load implicit layer from /vendor/app." into rvc-dev 2020-06-04 00:40:15 +00:00
Peiyong Lin
eb1c5a4c28 Allow to load implicit layer from /vendor/app.
Currently when loading implicit layers from apks, NativeLoaderNamespace
doesn't allow to dlopen the binaries if they come from apks from
/vendor/app. Implicit layers ship within /vendor/app should work like
other implicit layers. This patch extracts the construction of library
paths of the implicit layers and includes those paths when
NativeLoaderNamespace is created as the part of the permitted library
paths.

Bug: b/157832445
Test: atest android.gputools.cts.CtsRootlessGpuDebugHostTest
Test: setup debug layer and use adb logcat to check vulkan loader output
Change-Id: Ie2ca989bcab890578b5aa540d07f2aee2a0182bd
2020-06-03 21:30:08 +00:00
Vinit Nayak
66bf45ffa8 Add new callback for when activity rotates
Launcher needs to distinguish display changes
that result naturally vs apps that launch
in a fixed portrait/landscape rotation during
the quickstep gesture.This callback helps anticipate
if a subseqent onDisplayChanged() will
have resulted from a natural rotation or not.

Bug: 154580671
Change-Id: I59ee7985a9f367e8fc5826c08476c1a25d1426b0
2020-06-03 10:55:42 -07:00
Riddle Hsu
a474039bdc Override application display adjustments while launching activity
A launching activity with fixed rotation may get information from
a Display object which is associated with application resources.
In order to let the display size and rotation are consistent with
the activity configuration, the override configuration of activity
will update to the display adjustments of application resources.

Fixes: 157558894
Test: AppConfigurationTests#testRotatedInfoWithFixedRotationTransform

Change-Id: I7f72d838170a5f588bb8dd279ae081d1a3ddba95
2020-06-03 22:34:01 +08:00
Steve Elliott
cc1937581a Merge "Always use Shortcut Icon in conversation if available" into rvc-dev 2020-06-02 18:46:38 +00:00
Evan Severson
1fe28b24c0 Merge "Remove stopship for permissioncontroller pkg name" into rvc-dev 2020-06-02 18:39:00 +00:00
Zimuzo Ezeozue
efbc3f2d5e Merge "Support apps sharing file:// URIs with the camera API" into rvc-dev 2020-06-02 10:45:33 +00:00
Zim
c7496a3a62 Support apps sharing file:// URIs with the camera API
The camera API, MediaStore.ACTION_IMAGE_CAPTURE requires apps to pass
a content:// URI with write permissions to the camera. Unfortunately,
apps haven't been doing this and we only started hitting problems in R
for two reasons:
1. The FileUriExposedException that should crash apps when they try to
share file:// URIs acroos binder is skipped. This is because, the
image_capture intent is passed across binder as a field in a
ChooserActivity Intent and the child intents are not checked for
file URI exposed
2. Prior to R, when camera gets a file:// URI, camera issues a file
open(2) in its process. This open(2) succeeds because the camera had
write_external_storage permission which gave it write access to all
files on external storage

Now, camera targets R and (2) fails because camera does not have write
access to files owned by other apps. To workaround, we do the
following in the apps process when it targets < R:
a. When we detect a file:// URI for the camera in an Intent, we create
the file on disk if it is not already created.
b. Scan the file to insert it in the database and retrieve a
content:// URI
c. Replace the file:// URI with the content URI in the image_capture
intent

This works because, the system will ensure the camera is granted write
access to the content URI.

Test: Manual
Bug: 156336269
Change-Id: I4849ff5e806a8207650ff7534846c36ecdc6d3c0
2020-06-01 20:33:52 +01:00
Evan Severson
eb1e329207 Remove stopship for permissioncontroller pkg name
The change to use the overridden package name in the resources table
won't be included in the current release.

Test: Compile
Bug: 147434671
Change-Id: I9acbf921814088dfaba485d9acc845da650caf87
2020-06-01 12:19:31 -07:00
Julia Reynolds
829ac140f8 Merge "Add method for Settings" into rvc-dev 2020-05-31 18:57:41 +00:00
Charles Chen
13e3568567 Merge "Fix get display from display context derived context not working" into rvc-dev 2020-05-30 06:35:35 +00:00
Charles Chen
e22c4cb3c6 Fix get display from display context derived context not working
In ContextImpl, we checked the flag "mIsAssociatedWithDisplay" to
identify if a context can access a display or not. The flag wasn't
passed from outer context, and it leads to an issue that context
which created from #createConfigurationContext from display context
failed to obtain display instance.

This CL passes mIsAssociatedWithDisplay from outer context and
also add test to verify the behavior.

fixes: 157719118
Test: atest ContextTest ContextAccessTest

Change-Id: Ibeb2a08c75f90304e12dcf99293c84409c5eea34
2020-05-30 12:46:59 +08:00
Philip P. Moltmann
677df219aa Make it clear that checking shouldShowPermissionRationale is recommended
Bug: 157779069
Test: Docs change only
Change-Id: I288cb852f94ff2e59ede843946d6bee898f0c643
2020-05-30 01:10:23 +00:00
Steve Elliott
6373829000 Always use Shortcut Icon in conversation if available
Bug: 153751740
Test: manual
Change-Id: Ib1002b53d700d2857f69cd476de79a4e34f90559
2020-05-29 15:56:00 -04:00
Julia Reynolds
0c45c6e8ff Add method for Settings
Test: manual
Bug: 156033178
Change-Id: I3c334c6697e9bc13451faa0c0df1cdbdc3eaf6ea
2020-05-29 19:37:56 +00:00
TreeHugger Robot
9aa8852510 Merge "Fix transition return issues when more than 1 level depth" into rvc-dev 2020-05-29 04:32:46 +00:00
Hongwei Wang
e37b84d19e Set isInPictureInPictureMode earlier
Per https://developer.android.com/guide/topics/ui/picture-in-picture
After app requests enterPictureInPictureMode and receives onPause
callback, it will continue playback if isInPictureInPictureMode is true.

However, with ag/11273366, isInPictureInPictureMode will now return true
after the new configuration is dispatched to app, which happens after onPause.
This may cause app, following the guidance, to cease playback in PiP mode.

Fixes this by setting the internal mIsInPictureInPictureMode earlier
right in enterPictureInPictureMode

Video: http://go/recall/-/aaaaaabFQoRHlzixHdtY/fVRqG7UWoKkQQhFxPkzcUt
Bug: 156924033
Test: manually enter PiP from Twitch
Change-Id: I8e0865076fcb756cfa5db39901f460ab5ad69b99
2020-05-28 11:41:39 -07:00
Jeff Chang
6d834d86fb Fix transition return issues when more than 1 level depth
d85bed510, Adding support for cross-task hero transition, When running
cross-task, only play the enter animation, but the judgment for start
exit transition with shared element is broken. For the case on the issue,
when the exit transition completes, the activity is on the top of task,
it is not allowed to execute return transition.

This CL modifies the condition to allow the return transition. For start
exit back transition, the isReturning is always true. We can use it to
decide if it is allowed to play the return transition.

Bug: 137838129
Test: atest ActivityTransitionTest
      Manual testing on ApiDemos with Activity transition

Change-Id: Iaa6a875dbe305f6356887616b797dc45e76a4b56
2020-05-28 18:00:43 +08:00
TreeHugger Robot
f37b09335f Merge "Remove InstantAppResolverTests for migration to CTS" into rvc-dev 2020-05-28 00:23:16 +00:00
Julia Reynolds
1e8ce29af7 Merge "Clarify conversation policy" into rvc-dev 2020-05-27 20:43:59 +00:00
Collin Fijalkovich
4edffac782 Merge "Add performance counters to cacheinfo dumps." into rvc-dev 2020-05-27 18:24:04 +00:00
Julia Reynolds
2fcfe23f79 Clarify conversation policy
Test: make
Fixes: 157482114
Change-Id: Icb6993a4c2c651465cadfa31c1d1915b7352994c
2020-05-27 12:47:10 -04:00
Louis Chang
e500c6773b Merge "Do not always report configuration change to activity" into rvc-dev 2020-05-27 04:17:14 +00:00
Collin Fijalkovich
88aa314afa Add performance counters to cacheinfo dumps.
Tracks the number of hits, misses, refreshes, and invalidations on a
per-cache basis, and makes that information available through dumpsys
cacheinfo.

Bug: 157175501
Test: adb shell dumpsys cacheinfo
Change-Id: Icabdd82acda2edc54d787d0a2d15a33ba18fd668
2020-05-26 18:47:42 -07:00
Stanislav Zholnin
86b0b984cf Remove UidAtomTests from presubmit due to failures.
Test: manual

Bug: 155714228
Change-Id: I661c6503c387a00803bb949e3e8ca431045dd266
2020-05-25 19:01:34 +00:00
easoncylee
3e213cffec Fix mis-configuration of TEST_MAPPING file.
UidAtomTests:testAppOps is a test class and test method of
CtsStatsdHostTestCases. To run this in Test Mapping, it should
specify CtsStatsdHostTestCases. as the name in TEST_MAPPING file,
and android.cts.statsd.atom.UidAtomTests as the options.

Bug: 155714228
Test: presubmit test.
Change-Id: I7df08ae811425020ebbeae6a8e9f1317065c00c9
2020-05-24 21:32:51 +00:00
Julia Reynolds
28c3a34faa Merge "Update conversation labels" into rvc-dev 2020-05-21 18:53:24 +00:00
Winson
badad7b62f Remove InstantAppResolverTests for migration to CTS
See change I79b7c42e8a495c0f4ba4cd42a076ac3b43ee2919

Bug: 155114274
Bug: 155115137
Bug: 155115845
Bug: 155116506
Bug: 155116748
Bug: 155117421

Test: atest CtsInstantAppTests

Change-Id: I09023d098c93758c049169a909c27c230bb3dd9b
2020-05-21 11:50:43 -07:00
TreeHugger Robot
5d6cf38cd1 Merge "Prevent DPCs from requesting INTERACT_ACROSS_PROFILES" into rvc-dev 2020-05-21 16:25:25 +00:00
Hui Yu
600ce540ca Merge "Check PendingStartActivityUids list before updateOomAdj is done." into rvc-dev 2020-05-21 16:00:43 +00:00
Alex Johnston
fa6cf17648 Merge "setAutoTimeRequired disabled on managed profile" into rvc-dev 2020-05-21 10:08:51 +00:00
Hui Yu
3f5b1521f0 Check PendingStartActivityUids list before updateOomAdj is done.
While starting activity, WindowManager posts a runnable to DisplayThread to updateOomAdj.
The latency of the thread switch could cause client app failure when the app is checking
ActivityManagerService.isUidActive() before updateOomAdj is done.

Use PendingStartActivityUids to save uid after WindowManager start activity and before
updateOomAdj is done.

PendingStartActivityUids list is checked in
ActivityManagerService.isUidActive() and
AppOpsService.UidState.evalMode(). A uid in this list is treated same as
uid is active.

Bug: 157180494
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerCameraLaunchTest.java
Change-Id: If0685c3c2fad01e48f3fcf2228057041f4ec9b00
2020-05-20 23:04:34 -07:00