9923 Commits

Author SHA1 Message Date
TreeHugger Robot
766aa3a107 Merge "Restore config of associated window when clearing fixed rotation" into rvc-dev 2020-04-10 16:09:14 +00:00
Ryan Mitchell
6cb79cdfb7 Merge changes from topic "invalidate_idmap" into rvc-dev
* changes:
  Fix InstallOverlayTests fail to install overlay
  Test that upgrading target apk invalidates idmap
  Invalidate idmap when target updates
2020-04-10 15:50:15 +00:00
Riddle Hsu
522029a9f9 Restore config of associated window when clearing fixed rotation
If wallpaper is visible and its target window has fixed rotation
transform, wallpaper token will be associated to share the same
transform. So if the target window cancels the transform, the
associated window, i.e. wallpaper should also be restored to the
original configuration.

Fixes: 153420536
Fixes: 153201558
Test: atest WindowTokenTests#testClearFixedRotationTransform
Change-Id: I75fe8bfadf3b681f2dc33df9c6599a9bbc5769ea
2020-04-10 21:55:45 +08:00
Raff Tsai
5962269af8 Merge "Add SettingsStats puller in StatsPullAtomService" into rvc-dev 2020-04-10 10:08:30 +00:00
TreeHugger Robot
7f091e01ee Merge "Add getInterface(Version|Hash) in ILights stub for test" into rvc-dev 2020-04-10 08:59:57 +00:00
Wei Sheng Shih
1a46294fdb Merge "Support addWindow as other user" into rvc-dev 2020-04-10 08:33:12 +00:00
Ming-Shin Lu
1c92e1f789 Merge "Trigger onTaskAppeared when a task started from recents becomes ready." into rvc-dev 2020-04-10 05:46:13 +00:00
Winson Chung
cb437ade00 Merge changes I7d2ca2a2,I9f1fc593 into rvc-dev
* changes:
  Fix a couple issues with previous CL (keeping tasks hidden)
  Keep task hidden until task appeared
2020-04-10 03:03:21 +00:00
Raff Tsai
87cefd4f28 Add SettingsStats puller in StatsPullAtomService
1. Add typed_features.proto contain StringListParam proto
2. Add SettingsStatsUtil to parse DeviceConfig whitelist and
create log
3. Add test case in SettingsStatsUtilTest

Test: atest FrameworksServicesTests:SettingsStatsUtilTest
      adb shell cmd stats pull-source 10080
Bug: 142941011
Change-Id: I5a161cf12dd6d52ae80813e6d1fe10ecbc5d05cd
2020-04-10 08:37:17 +08:00
Winson Chung
1b5d055f2e Keep task hidden until task appeared
- If the task is previously not visible or has no visible children at
  the point when we start controlling it in the task org, hide the task
  until we send taskAppeared to ensure that the task org can reparent
  and show it otherwise we could see a flash of the task.

  This happens mainly from two cases:
  - when starting a new task with a given win mode, we show it and wait
    for first draw before notifying the task org
  - when transitioning into pip from swipe up, the activity is hidden
    and when it requests to enter pip is made visible again

  Since we are hiding the task w/ the pending transaction, we also need
  to defer all task org callbacks until that's applied to ensure proper
  lifecycle of the calls.
- Also skip app transitions for task org tasks for now

This reverts commit d2fb07e4f632af9ab16667c58b1c1d40711f1544.

Bug: 152809695
Bug: 152134460
Test: Open a bubble, ensure that we don't see the task in fullscreen
      first.  Enter pip, ensure that we don't see flash of the task
      before SysUI can fade it in.
Test: atest PipAnimationControllerTest
Test: atest TaskOrganizerTests
Test: atest SplitScreenTests
Change-Id: I9f1fc5931df1d69a7086c02b633347162cda94bf
2020-04-09 15:55:03 -07:00
Ryan Mitchell
5900a1d3c5 Fix InstallOverlayTests fail to install overlay
There is a key signing problem in general-tests so move all overlays
to device-tests.

Bug: 141998755
Bug: 153631240
Bug: 153630797
Test: atest InstallOverlayTests
Change-Id: Ic8274031c8bd0aca5a6b7ccfee53b047334ab060
2020-04-09 14:17:17 -07:00
TreeHugger Robot
09c3427e5d Merge "Drop down late RARE prediction into RESTRICTED." into rvc-dev 2020-04-09 20:46:06 +00:00
lumark
04bceb99f1 Trigger onTaskAppeared when a task started from recents becomes ready.
In quick switch flows, launcher will first swipe task snapshot
through recents animation, and then start new task with custom animation
options through startActivityFromRecents after gesture finish detected,
and then finish recents animation finally.

But that way user may experience flickering before the new task launch
and recents animation finish.

To improve quick switch flickering, we ignore the new task's custom
animation from recents and generate task remote animation target,
and then trigger a callback for launcher to control/animate this
task surface, more like a part of RecentsAnimation,

Also, adding removeTask method for launcher can flexibility remove the
new task animation target once no need to animate, so that launcher
can decide when to finish recents animation.

Bug: 152480470
Test: manual as below steps:
  1) Doing quick switch task.
  2) Make sure launcher can receive onTaskAppeared callback.
  3) Make sure launcher calls removeTask successfully.
  4) Make sure launcher can finish recents animation after 3).
Change-Id: I0692a280a49719229fa8871509bad37a1343a00f
2020-04-10 02:20:03 +08:00
Pavel Grafov
c4adf5e87b Merge "Copy the remaining policies on migration." into rvc-dev 2020-04-09 17:30:36 +00:00
Abodunrinwa Toki
33e891d1a2 Merge "Introduce an IconsContentProvider." into rvc-dev 2020-04-09 17:06:38 +00:00
Makoto Onuki
dedd760e36 Merge "Fix CtsShortcutHostTestCases#testSecondaryUser" into rvc-dev 2020-04-09 16:44:38 +00:00
Sergii Iegorov
477c433b98 Fix CtsShortcutHostTestCases#testSecondaryUser
This patch uses Instrumentation parameter inside
getDefaultLauncher function to obtain user ID
from it and get default launcher namely for that
user as setDefaultLauncher function sets launcher
for the user from Instrumentation context. This
fixes incorrect launcher settings for the cases
that use two sequential calls to get/set
default launcher.

Bug: 145774461
Test: run cts -m CtsShortcutHostTestCases -t \
android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest#testSecondaryUser

Signed-off-by: Sergii Iegorov <sergii.iegorov@globallogic.com>
Change-Id: I8941f5648ad783c7681fdb56677e855756db957d
Merged-in: I8941f5648ad783c7681fdb56677e855756db957d
2020-04-09 08:10:44 -07:00
Pavel Grafov
57c69d1e30 Copy the remaining policies on migration.
* accountTypesWithManagementDisabled
* disableScreenCapture

For security logging nothing has to be done since the state is
stored in a system property, just changed it so that the logging
will be started after the migration and only events for the
right user are logged.

Also removed the todo about hardening for power cut case, the
risk of additional complexity sees to outweight the benefit.

Bug: 149075700
Test: atest DevicePolicyManagerServiceMigrationTest
Change-Id: I3a58325f2d6f415e51998c5096c5fc123d26602d
2020-04-09 15:47:18 +01:00
TreeHugger Robot
0131d50188 Merge "Upgrade case for setAutoTimeRequired" into rvc-dev 2020-04-09 13:06:11 +00:00
Alex Johnston
9876c4f899 Upgrade case for setAutoTimeRequired
* Modified setAutoTimeRequired to call
  pushUserRestrictions after requireAutoTime
  in the active admin is set.
* Modified addSyntheticRestrictions in the
  active admin to include the auto time
  required case.

Bug: 145604635
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.server.devicepolicy.DevicePolicyManagerServiceMigrationTest
Change-Id: Ida4952eeec8ec12573c4049a9bf8e0ce6a951a86
2020-04-09 11:57:49 +01:00
Jeongik Cha
a45aa57363 Add getInterface(Version|Hash) in ILights stub for test
If it is frozen, interface has to implement getInterface(Version|Hash)

Bug: 153501202
Test: m FrameworksServicesTests
Change-Id: Ia9423a7fe524ff225435344b527728ec2646adfc
Merged-In: Ia9423a7fe524ff225435344b527728ec2646adfc
2020-04-09 17:22:13 +09:00
Charles Chen
5c082c998f Merge "Fix WindowContext leak" into rvc-dev 2020-04-09 07:39:29 +00:00
TreeHugger Robot
0350a0c4ec Merge "Use full bounds if fixed aspect ratio does not apply" into rvc-dev 2020-04-09 05:25:53 +00:00
Kweku Adams
5439133550 Drop down late RARE prediction into RESTRICTED.
When an app hasn't been used in a long time (long enough for it to have
naturally time out into the RESTRICTED bucket) and a prediction service
anticipates that an app will not be used anytime soon (by predicting the
app into the RARE bucket), then we drop the app into the RESTRICTED
bucket in such a way that the prediction service can bring it back out
at the appropriate time.

Bug: 153567783
Test: atest FrameworksServicesTests:AppIdleHistoryTests
Test: atest FrameworksServicesTests:AppStandbyControllerTests
Change-Id: I0ec846a6d1bc8e254cabe6a9b504f4cae071def8
2020-04-08 14:56:46 -07:00
Riddle Hsu
89e8206393 Use full bounds if fixed aspect ratio does not apply
If a non-resizable activity can fill the non-decor space,
its bounds should not exclude decor bounds because the
activity and decor can show as a continuous area. otherwise
unexpected letterbox may be created and IME cannot attach
to it due to the activity doesn't match parent's bounds.

Fix: 152197007
Test: SizeCompatTests#testAspectRatioMatchParentBoundsAndImeAttachable

Change-Id: I61d2c99702fb8642a3bf5728949489b6b98eb508
2020-04-09 02:16:37 +08:00
Andrii Kulian
ac4b972e7a Merge "6/n Manage multiple task display area in the policy" into rvc-dev 2020-04-08 17:35:42 +00:00
Christine Franks
be3b2304d2 Merge "Differentiate per-layer saturation levels" into rvc-dev 2020-04-08 17:16:00 +00:00
Charles Chen
4bff5be1a9 Fix WindowContext leak
The root causes of this issue are:
  1. WindowTokenClient#attachContext makes WindowTokenClient has strong
     reference to WindowContext, which leads to WindowContext cannot be
     GC'd.
  2. WMS#removeWindowToken needs MANAGE_APP_TOKEN permission which
     normal apps don't hold.

This CL does following things:
  1. Use weak reference instead on WindowTokenClient#mContext.
  2. Relax WMS#removeWindowToken to check callingUid if
     MANAGE_WINDOW_TOKEN permission is not held
  3. Deliver config changes to the client side in
     WMS#addWindowTokenWithOption
  4. Some minor fixes

fixes: 150812449
Bug: 150715095
Test: atest WindowContextTest
Test: atest WindowManagerServiceTests
Test: atest WindowTokenTests
Test: atest WindowManagerPermissionTests#testMANAGE_APP_TOKENS
Test: atest
WindowManagerPermissionTests#testADD_WINDOW_TOKEN_WITH_OPTIONS

Change-Id: I9f1d73af2abb78fc9844e6d9eb25e9f0293514e7
2020-04-08 21:30:24 +08:00
wilsonshih
d0fc2ca51f Support addWindow as other user
Support addWindow with the other userId which can be different from Uid.

This can be used when client want to addView for secondary user.
Example:
1. Create context with createContextAsUser or similar method.
2. Get WindowManager with this context.
3. WindowManager#addView

Bug: 151414297
Test: atest WmTests WindowAddRemovePerfTest AddWindowAsUserTest
Change-Id: I13e58d76b1f056f3829bc984c2b61496c8f8d535
2020-04-08 15:15:01 +08:00
TreeHugger Robot
ffe3762342 Merge "Update task organizer state whenever task organizer was set" into rvc-dev 2020-04-08 04:40:17 +00:00
Andrii Kulian
44b3c569f4 6/n Manage multiple task display area in the policy
Delegate task display area creation and container management to the
display area policy implementation. This should allow creating and
handling device-specific task display area arrangements.

Bug: 152116619
Test: WM CTS and unit tests
Change-Id: Ic1182d064e7d8387f701f04fb267e2bb6d4da0c5
2020-04-07 21:30:26 -07:00
Louis Chang
9d35a3ace0 Update task organizer state whenever task organizer was set
Root tasks that created by organizer were not added to
TaskOrganizerStates because those tasks were not visible.
In that case, these tasks were not removed when the organizer
was dead.

Bug: 153287798
Test: atest SplitScreenTests
Test: atest TaskOrganizerTests
Change-Id: Icbe1f119ae6e97f730138af83f265724bb4ae5a9
2020-04-08 10:46:33 +08:00
Christine Franks
6f203b39aa Differentiate per-layer saturation levels
(based on calling package name)

Bug: 153200980
Test: atest FrameworksServicesTests:AppSaturationControllerTest

Change-Id: I7b9bf850c5a27e3fa51da70a7d2f1c72038b043e
2020-04-07 16:03:22 -07:00
Evan Rosky
e68c8ac02b Merge "Remove some more dead-code from old split impl" into rvc-dev 2020-04-07 21:47:44 +00:00
Calin Juravle
11bdb5dfb4 Merge changes from topic "server-reporting" into rvc-dev
* changes:
  Report SystemServer classpath to PackageManager
  Setup dex load reporter for system server
2020-04-07 18:42:29 +00:00
Evan Rosky
50ea8c15fa Remove some more dead-code from old split impl
Removed moveTasksToFullscreenStack (only a small piece of it
was used by pip, so just localized it).

Remove stack creation/reparenting from resizeTask since modes
don't work like that anymore.

Removed some always-false parameters in AS.setWindowingMode

Bug: 133381284
Test: tests pass
Change-Id: I22e846250196eb93b480a05bed1f66d34b51a092
2020-04-07 10:31:36 -07:00
Jian-Yang Liu
41db36ec48 Merge "Updated InsetsPolicy to read config_forceShowSystemBars and prevent system bars from being hidden by applications if true." into rvc-dev 2020-04-07 17:18:33 +00:00
TreeHugger Robot
5eb9c8fada Merge "Store conversation requirement in a setting" into rvc-dev 2020-04-07 03:47:02 +00:00
Bernardo Rufino
2de79fb6fd Merge "Wire user info and use user context for text toasts" into rvc-dev 2020-04-06 21:59:20 +00:00
Winson Chung
be022550d8 Merge "Revert "Keep task hidden until task appeared"" into rvc-dev 2020-04-06 21:19:57 +00:00
TreeHugger Robot
60c8c9cece Merge "Fixes AppsFilterTest" into rvc-dev 2020-04-06 21:09:48 +00:00
Patrick Baumann
339ba0f87d Fixes AppsFilterTest
This change fixes the AppsFilterTest#testWhoCanSee to properly validate
/ assert. The initial commit used a mistakenly created local method to
"assert" instead of the intended hamcrest assert method. Oops.

Test: atest AppsFilterTest
Bug: 143534210
Change-Id: Ibd2de769d63a166f225e2bec75d27eaff2343ee9
2020-04-06 12:50:08 -07:00
Calin Juravle
46bddf8e36 Setup dex load reporter for system server
System server may load code at runtime from outside its original
classpath. In order to ensure this code is optimized (verified) we need to
report it to PackageManager which can optimize it during idle-maintenance
windows.

This CL sets up the reporting infrastructure for system server.

Test: atest DexManagerTest
Bug: 148774920
Change-Id: Ibd2ee38857b97bde426ee0a01c60543f1acb8671
2020-04-06 12:43:13 -07:00
Bernardo Rufino
78f5d83ac8 Wire user info and use user context for text toasts
Text toasts don't currently support multi-user. This CL prepares toasts
for multi-user by wiring the user information from who requested the
toast (in the form of uid) to ToastUI, where text toasts are actually
rendered.

We go only as far as obtaining a new user-specific context for that user
and using that to construct the view. Actual support will come in future
CLs.

Bug: 151414297
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
      ToastWindowTest ToastUITest NotificationManagerServiceTest
      LegacyToastTest
Change-Id: I8c92453c6a2b73c31f9a41ca9ff463d194d4f44f
2020-04-06 20:20:09 +01:00
Chavi Weingarten
a95d39274f Merge changes Id2b99e6d,I32f5469f,I922e3a56 into rvc-dev
* changes:
  Added test for isAnimating bug
  Override base isAnimating in WindowState
  Ignore specified animation types when checking isAnimating
2020-04-06 18:30:15 +00:00
Chavi Weingarten
ae1c541a6f Merge "Added displayPosition in LogicalDisplay" into rvc-dev 2020-04-06 18:29:05 +00:00
Winson Chung
d2fb07e4f6 Revert "Keep task hidden until task appeared"
This reverts commit cbd8793a441bc828ec22dda09145134da7105818.

Reason for revert: b/153273664
Bug: 153273664

Change-Id: Ic3a0778e896afd5e3fdbc234a5b3521257222dcd
2020-04-06 18:17:21 +00:00
Fiona Campbell
b533ef703b Merge "Pass DisplayDeviceConfig to AutomaticBrightness" into rvc-dev 2020-04-06 18:03:51 +00:00
JianYang Liu
ae86b3f16d Updated InsetsPolicy to read config_forceShowSystemBars and prevent
system bars from being hidden by applications if true.

Bug: 149233545
Bug: 151820910
Test: atest InsetsPolicyTest, manual
Change-Id: I2bc610c8388200c47efcbfedf6f24fe867a696ec
2020-04-06 08:14:45 -07:00
TreeHugger Robot
04e287816f Merge "Limit stage install to system and whitelisted packges only (1/2)" into rvc-dev 2020-04-06 14:16:25 +00:00