Commit Graph

17813 Commits

Author SHA1 Message Date
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
Julia Reynolds
8d34af82ac Update conversation labels
By adding a util method that prefers longlabel and
falls back to shortlabel.

Test: atest
Bug: 157140669
Change-Id: Ib7229b75b7a8ab87274e9aab1c7816129f04e505
2020-05-20 17:03:35 -04:00
Alex Johnston
67623cf556 setAutoTimeRequired disabled on managed profile
* A security exception should be thrown when
  setAutoTimeRequired is called on a managed profile
* Update javadoc

Bug: 156620695
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetAutoTimeRequired
      atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testSetAutoTimeRequired
      atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testSetAutoTimeRequired
Change-Id: Ifb53c218947f62aa446aa607d3f4eee354586395
2020-05-20 12:50:04 +01:00
Louis Chang
42b72736fa Do not always report configuration change to activity
Activity that does not handle any of the configuration changes was not
relaunched when only changing its size and without cross the size
threshold, see ActivityRecord#crossesSizeThreshold(), but the
new configuration would still be scheduled to the client.

In that case, Activity#onConfigurationChanged() was called when
ActivityConfigurationChangeItem executed, because it requested to
always report to the activity. This was wrong since the activity didn't
request to handle any of the configuration changes.

On the other hand, if configuration change sent from view root came
earlier than ActivityConfigurationChangeItem, the new configuration
change did not propagate to ResourcesManager.

Allow the new configuration changes propagate to ResourcesManager
and report to activity only if the activity has been declared to handle.

Bug: 155589510
Test: atest AppConfigurationTests
Change-Id: If7dd769098a9f06efafda0250bfce71c6c96fb49
2020-05-20 16:54:04 +08:00
Alex Kershaw
e6a81b38d6 Prevent DPCs from requesting INTERACT_ACROSS_PROFILES
Fixes: 156745686
Test: atest
com.android.cts.devicepolicy.CrossProfileAppsPermissionHostSideTest#testCanRequestInteractAcrossProfiles_profileOwner_returnsFalse
Test: atest services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java --verbose

Change-Id: Ia72573991ecccd9a9d01285ba55059e7f9ea14b0
2020-05-19 20:34:17 +01:00
TreeHugger Robot
58657c7c10 Merge "Report resizeTask failure as boolean result" into rvc-dev 2020-05-19 01:39:54 +00:00
Collin Fijalkovich
acb2bba925 Merge changes from topic "dump-cacheinfo" into rvc-dev
* changes:
  Add cache debugging information to bugreports.
  Maintain global list of caches; purge on low memory
2020-05-18 20:52:43 +00:00
Darryl Johnson
0d8822c94a Merge "Make sure config change items are executed in the order dispatched." into rvc-dev 2020-05-18 17:26:14 +00:00
TreeHugger Robot
01ae9d5c22 Merge "Handle apps that upgrade to full conversations" into rvc-dev 2020-05-15 23:35:06 +00:00
TreeHugger Robot
02ed46782e Merge "Some improvements to process state dumpsys output." into rvc-dev 2020-05-15 20:55:13 +00:00
Darryl L Johnson
2b9720c694 Make sure config change items are executed in the order dispatched.
In the previous implementation a batch of process/activity config
changes would effectively be executed out of order. When the server
would dispatch changes in config in quick succession the config change
items would update the pending configs first through the preexecute()
calls and then apply the activity config before the process config
is applied even though the process config was dispatched before the activity
config change item. See b/148639784 for more detail.

Fixes: 148639784

Test: ActivityThreadTest#testHandleActivityConfigurationChanged_EnsureUpdatesProcessedInOrder
Test: ActivityThreadTest#testHandleActivityConfigurationChanged_SkipWhenNewerConfigurationPending

Change-Id: I3c926076ac8dba73eb0471c7bc91313df519cf92
2020-05-15 09:40:30 -07:00
Julia Reynolds
bc23c7e813 Handle apps that upgrade to full conversations
- Apps that have sent incomplete conversations only are allowed
into the conversation section, but not allowed to have full controls.
Users can also demote these apps entirely from the converstion space
- Once an app starts using complete notifications, it can no longer
be fully demoted out of the conversation space, it's only demoted on
a per conversation basis.
- If an app has sent full conversation notifications, and then sends
an incomplete one, the incomplete notification will not be shown in
the conversation space.

Test: atest
Bug: 155276427

Change-Id: Iba9b01c53949632b6db2834511165e3571387ac9
2020-05-15 12:17:13 -04:00
Daichi Hirono
fa23f600c6 Report resizeTask failure as boolean result
Previously ActivityTaskManagerService#resizeTask throws
IllegalArgumentException when the task windowing mode is not suitable for
resize. However caller cannot ensure the windowing mode before
acquiring window lock.

To descriminate windowing mode mismatch from programming errors
(e.g. Preconditions.check failures), the CL changes the way of reporting
windowing mode mismatch to returning boolean value.

Bug: 156196109
Test: None
Change-Id: I36f473899c4f6d7f5d5d25f081a57fe14ebbb1a8
2020-05-15 07:24:11 +00:00
Winson Chung
b159f28fce Merge "Skip parceling destroyed buffer" into rvc-dev 2020-05-14 17:32:08 +00:00
Winson Chung
5bd2a157c6 Skip parceling destroyed buffer
- Haven't been able to repro, but we shouldn't crash system server

Bug: 154382448
Test: Just adding a destroyed check
Change-Id: I412ab1703602723511a6bd3c598d34b6ade68db7
Merged-In: I412ab1703602723511a6bd3c598d34b6ade68db7
2020-05-14 16:05:07 +00:00
Dianne Hackborn
cb6db38143 Some improvements to process state dumpsys output.
The detailed dumpsys output of ProcessRecord had some formatting
issues.  Cleaned this up, also reorganized and improved some of
the other output.

And improved debugging output of capabilities -- have special
formatting to print the flags in a more human-readable way, and
added this to the process list summaries.

Looks like this:

    Proc #28: psvc   F/ /PER  LCM  t: 0 32602:com.google.android.providers.media.module/u0a236 (service)
        com.google.android.providers.media.module/com.android.providers.media.fuse.ExternalStorageServiceImpl<=Proc{31384:system/1000}
    Proc # 4: psvc   F/ /PER  LCM  t: 0 31614:com.android.bluetooth/1002 (service)
        com.android.bluetooth/.gatt.GattService<=Proc{31384:system/1000}
    Proc # 2: fg+50  F/A/TOP  LCM  t: 0 4029:com.google.android.apps.maps/u0a186 (fg-service-act)
    Proc # 0: vis    F/A/TOP  LCM  t: 0 32033:com.google.android.apps.nexuslauncher/u0a155 (service)
        com.google.android.apps.nexuslauncher/com.android.launcher3.notification.NotificationListener<=Proc{31384:system/1000}
    Proc # 8: vis    F/ /BTOP LCM  t: 0 32563:com.google.android.googlequicksearchbox:interactor/u0a151 (service)
        com.google.android.googlequicksearchbox/com.google.android.voiceinteraction.GsaVoiceInteractionService<=Proc{777:com.google.android.googlequicksearchbox:search/u0a151}
    Proc # 7: vis    F/ /BTOP LCM  t: 0 4406:com.google.android.tts/u0a204 (service)
        com.google.android.tts/.service.GoogleTTSService<=Proc{4029:com.google.android.apps.maps/u0a186}
    Proc # 6: vis    F/ /BTOP LCM  t: 0 777:com.google.android.googlequicksearchbox:search/u0a151 (service)
        com.google.android.googlequicksearchbox/com.google.android.apps.gsa.publicsearch.PublicSearchService<=Proc{4029:com.google.android.apps.maps/u0a186}
    Proc # 1: vis    F/ /BTOP LCM  t: 0 32254:com.google.android.gms.persistent/u0a152 (service)
        com.google.android.gms/com.google.android.location.internal.GoogleLocationManagerService<=Proc{4029:com.google.android.apps.maps/u0a186}
    Proc #47: vis    F/ /BFGS ---  t: 0 31954:com.google.android.ext.services/u0a70 (service)
        com.google.android.ext.services/android.ext.services.notification.Assistant<=Proc{31384:system/1000}
    Proc #16: vis    F/ /BFGS LCM  t: 0 32515:com.google.android.as/u0a112 (service)
        com.google.android.as/com.google.android.apps.miphone.aiai.captions.SystemCaptionsManagerService<=Proc{31384:system/1000}
    Proc #51: vis    F/ /IMPF ---  t: 0 2072:com.qualcomm.qcrilmsgtunnel/1001 (service)
        com.qualcomm.qcrilmsgtunnel/.QcrilMsgTunnelService<=Proc{31915:com.android.phone/1001}
    Proc #48: prcp   b/ /IMPB ---  t: 0 3783:com.google.android.inputmethod.latin/u0a182 (service)
        com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME<=Proc{31384:system/1000}

Bug: 156545187
Test: manually checked output
Change-Id: I99d8136b98b39e74d9f316da5954f85aec570c01
2020-05-13 17:34:35 -07:00
Collin Fijalkovich
ceefcec397 Add cache debugging information to bugreports.
Following the model for dumpsys gfxinfo, this patchset adds a
CacheBinder service that dumps cache state information from each
process.

Bug: 153661880
Test: adb shell dumpsys cacheinfo
Test: adb bugreport

Change-Id: Ie7cce70e56777a200e3e3e92ab895126b6f29032
2020-05-13 11:15:22 -07:00
Daniel Colascione
8c239da8d5 Maintain global list of caches; purge on low memory
Bug: 140788621
Test: m
Merged-In: I3ba88e0a6f6c0f26465903988e7432156bd5be20
Change-Id: I3ba88e0a6f6c0f26465903988e7432156bd5be20
(cherry picked from commit 22c2ddb201)
2020-05-13 11:15:14 -07:00
TreeHugger Robot
d775b6404f Merge "Allow some OpEntry#* methods for apps targeting R" into rvc-dev 2020-05-12 23:18:52 +00:00
Philip P. Moltmann
ac44350639 Allow some OpEntry#* methods for apps targeting R
Bug: 156254238
Test: built
Change-Id: Ie4a2cb155c40d46c52d44e0f53c05d52a8a9b523
2020-05-12 09:10:14 -07:00
Martijn Coenen
5019f6c50b Merge "Limit rename() workaround to /storage/emulated." into rvc-dev 2020-05-12 15:01:13 +00:00
Riddle Hsu
8e726a2ef7 Merge changes from topic "b147213487" into rvc-dev
* changes:
  Send fixed rotation adjustments to the associated client
  Add support to override display adjustments by token
  Add fixed rotation display adjustments
2020-05-12 09:05:17 +00:00
Martijn Coenen
76ce2ccb19 Limit rename() workaround to /storage/emulated.
This workaround was intended to silently fix EXDEV move failures due to
the /Android/data and /Android/obb bind mounts. However, the workaround
should be limited to moves to *and* from the emulated filesystem. For
moves from the emulated filesystem to another filesystem (or
vice-versa), this would never have worked in the first place, and we
want to give the app this feedback, so it knows it needs to do a more
expensive copy operation and can show this in the UI. We know some apps
(like DocsUI) already handle this.

Public volumes (eg /storage/ABCD-1234) don't need this workaround, since
they don't have the bind mounts. Private volumes that aren't primary
don't have these bind mounts either.

Bug: 146430607
Test: N/A
Change-Id: I7bfe88e07708fe044ce8df02000a97cfad19bdee
2020-05-12 10:32:48 +02:00
Hongwei Wang
f7e5a23106 Set mIsInMultiWindowMode in activity creation
When an Activity is launched directly into split-screen mode, there
won't be any onMultiWindowModeChanged callback. Upon activity creation,
the current windowing mode should be part of the configuration, use
the windowing mode from that as initial values for both
isInPictureInPictureMode and isInMultiWindowMode.

Bug: 155811896
Bug: 156204380
Test: launch activity to split-screen secondary and verify
      isInMultiWindowMode in dumpsys
Change-Id: I6061a2d5687b68a981abcf8b184bfb007cdcf501
2020-05-11 18:03:55 -07:00
Tim Murray
52d70eaa12 Merge "fix app binder tracing on userdebug builds" into rvc-dev 2020-05-11 20:20:03 +00:00
Tim Murray
6d2b1bfe38 fix app binder tracing on userdebug builds
All apps are profileable on debuggable builds, so enable binder
tracing during app startup on debuggable builds if binder tracing has
already been enabled.

Test: binder tracing shows up for new apps on userdebug
Bug: 156259316
Change-Id: I8cc6c2f711943c21b54f346a23ba7089dc9c9180
2020-05-11 10:27:09 -07:00
Riddle Hsu
d490c57905 Send fixed rotation adjustments to the associated client
So the real information of display can be adjusted according
to the adjustments for the application started with fixed
rotation transform.

The enabling adjustments may be sent in different ways:
- Launch activity
  The information is bundled with LaunchActivityItem.
- Resume activity or update non-activity window
  Send a standalone FixedRotationAdjustmentsItem.

The disabling adjustments (null) are always sent by
FixedRotationAdjustmentsItem.

Bug: 147213487
Test: AppConfigurationTests#testRotatedInfoWithFixedRotationTransform
      TransactionParcelTests#testFixedRotationAdjustments

Change-Id: I5238888a5c8352db83fc12749f4de2bfabf46026
2020-05-11 22:17:03 +08:00
Riddle Hsu
e03b9669e3 Add support to override display adjustments by token
This is the bridge to link customized adjustments to an activity
or window token.

The DisplayAdjustments in ResourcesImpl is associated with
ResourcesKey. The new usage requires to associate with token.
That is why the new field is added in Resources.

Bug: 147213487
Test: atest ResourcesManagerTest#testOverrideDisplayAdjustments
Change-Id: Ie79c331654d564aee7af8c6ce98a4c72dd3132b1
2020-05-11 13:30:14 +08:00
Beverly Tai
78a66d6c36 Merge "Add badge colors for dark theme" into rvc-dev 2020-05-10 18:10:15 +00:00
Beverly
2b4306a8ec Add badge colors for dark theme
Test: manual
Test: atest UserManagerTest#testProfileTypeInformation
Fixes: 149669756
Change-Id: Ib3fd377a4902bbe936d574dc52bac4eae6e25dd4
2020-05-07 09:20:19 -04:00
Hui Yu
a6099ac785 Merge "Revert "Add isUidActiveOrForeground() for camera/audio to use."" into rvc-dev 2020-05-06 16:59:34 +00:00
Marco Ballesio
ce9b47859d Merge changes from topic "developer option for app freezer" into rvc-dev
* changes:
  Resources and strings for freezer settings
  Settings option to enable/disable the app freezer
  ActivityManager API to check availability of app freezer
2020-05-06 16:35:44 +00:00
Galia Peycheva
95f8aba25e Merge "Add isDreaming method to DreamManager" into rvc-dev 2020-05-06 08:18:19 +00:00
Marco Ballesio
240bea3f47 ActivityManager API to check availability of app freezer
A method to verify the availability of the app freezer is required for
configuration code running in places like the Settings app

Bug: 155465196
Change-Id: I5779d263536091689a099eec0815f207dfbbf6ad
Test: verified its workings through the developer options CL
2020-05-05 15:22:43 -07:00