Commit Graph

103439 Commits

Author SHA1 Message Date
Winson Chung
cbd8793a44 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

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: If51e98cd007faef35e99acd31b27b20eebbea010
2020-04-03 19:59:05 -07:00
Rob Carr
0bed41a993 Merge "BLASTBufferQueue: Avoid unnecessary transactions" into rvc-dev 2020-04-03 19:04:42 +00:00
TreeHugger Robot
8885e4f115 Merge "[wm] VirtualDisplayConfig to mirror the non-default display" into rvc-dev 2020-04-03 18:59:27 +00:00
Yara Hassan
e081caae5f Merge "Enabled Content Capture in Service" into rvc-dev 2020-04-03 16:53:42 +00:00
Bernardo Rufino
918db9ecde Merge "Refactor ToastPresenter to perform show()/hide()" into rvc-dev 2020-04-03 16:37:06 +00:00
Ryan Mitchell
1b922d56c0 Merge "Begin moving FrameworkResourceLoaderTest to cts" into rvc-dev 2020-04-03 16:03:24 +00:00
TreeHugger Robot
37b8baa3a8 Merge "Only track focused next served view in onViewFocusChanged" into rvc-dev 2020-04-03 15:51:28 +00:00
Amith Yamasani
040563da5f Merge "Mark secondary lockscreen API as SystemApi." into rvc-dev 2020-04-03 14:13:43 +00:00
Bernardo Rufino
dd4f238127 Refactor ToastPresenter to perform show()/hide()
In order to support multi-user, we need to create a new context based on
the user id and retrieve the services from it
(http://b/151414297#comment9). This meant retrieving the services in
ToastUI.showToast() instead of on its constructor, which would make the
code diverge from Toast$TN.handleShow(). In order to avoid that, now
seemed a good time to refactor ToastPresenter to perform show() and
hide().

This means ToastPresenter will now be instantiated in every request for
a new toast in ToastUI, but fortunately with the refactor we were able
to get rid of ToastEntry (which was also beign instantiated in every
request).

Also found out a bug with this where window tokens were being used to
locate the toasts instead of the (non-window) tokens. This is a bit
confusing because the method NM.finishToken(package, token) receives a
non-window token to locate the ToastRecord and then finish its window
token. This didn't have any side-effects because NM itself finishes the
tokens after a time-out. Added a test for this.

Bug: 152973950
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
      ToastWindowTest ToastUITest NotificationManagerServiceTest
      LegacyToastTest
Change-Id: I13cf18890ca22022adb7576c8ecf3285a9b82299
2020-04-03 12:57:08 +00:00
Bernardo Rufino
884e9515d6 Merge "Rename test in TEST_MAPPING" into rvc-dev 2020-04-03 10:02:09 +00:00
Bernardo Rufino
434c17c0e6 Rename test in TEST_MAPPING
ToastTest became ToastWindowTest in ag/10919524, updating TEST_MAPPING
to reflect that.

Test: croot frameworks/base/core/java/android/app && atest --dry-run --test-mapping
Test: croot frameworks/base/core/java/android/widget && atest --dry-run --test-mapping
Test: croot frameworks/base/services/core/java/com/android/server && atest --dry-run --test-mapping
Bug: 152973950
Change-Id: I5b9e9b83d17c4a93a1e830c26d7f44001ccf175d
2020-04-03 08:48:00 +01:00
Jing Ji
0cfca4a3c4 Merge "Fix some Java doc errors" into rvc-dev 2020-04-03 07:40:17 +00:00
Diksha Gohlyan
ffc3e741d2 Merge "Check Read permissions when getDocumentMetadata" into rvc-dev 2020-04-03 06:01:29 +00:00
Lorenzo Colitti
0edabc5e4e Merge "Added a new capability for temporarily unmetered network." into rvc-dev 2020-04-03 04:46:06 +00:00
Winson Chiu
b6eaf6ed79 Merge "Query PlatformCompat for targetSdk check in AndroidPackageParsingTestBase" into rvc-dev 2020-04-03 02:55:29 +00:00
Jack Yu
30be5e5d3d Added a new capability for temporarily unmetered network.
Added a new network capability TEMOPORARILY_NOT_METERED to support
the case that a network can temporarily become unmetered. This
allows carriers to deploy unmetered 5G network. When devices
camp on 5G network, this capability will be dynamically added
to the network and will be removed once leaving 5G coverage.

Bug: 153081494
Test: Manual
Change-Id: I10e26cb0852e67f614e7b9c4e49f95e078602e21
2020-04-02 19:28:41 -07:00
Yohei Yukawa
dbe201d2ac Merge "Let blocked InputConnection APIs fail upon IInputMethod.unbindInput()" into rvc-dev 2020-04-03 02:11:04 +00:00
Winson
468825347e Query PlatformCompat for targetSdk check in AndroidPackageParsingTestBase
There are prebuilts in the tree and perhaps APKs in general
which don't conform to the manifest checks added in R, so the code
that parses the APK to verify v1 vs v2 needs to actually query
PlatformCompat to do the proper targetSdkVersion check and allow
the APK through if it's not updated yet.

A related change to default enabled inside ParsingPackageImpl to
true was also made, as if any malformed APK was allowed through
without an <application> tag, it would never hit the code
where enabled gets assigned to default true.

Any further errors spit out by this test are critical and need to
updated so that their APKs can be installed on R.

Bug: 153058196

Test: manual verify error behavior with broken APK
Test: atest com.android.server.pm.parsing

Change-Id: I2b117f2098d8bd62b92921178a098e838b55b06d
2020-04-02 15:10:13 -07:00
Jing Ji
e2757e64b7 Fix some Java doc errors
Bug: 148413462
Test: Manual
Change-Id: Idfabf5ac6548fd821bc69afb3588c1d124d0011b
2020-04-02 14:27:04 -07:00
Makoto Onuki
bea34c409f Merge "Add WTF when a system server wrapper can't be found" into rvc-dev 2020-04-02 20:39:32 +00:00
Yohei Yukawa
f87f750888 Let blocked InputConnection APIs fail upon IInputMethod.unbindInput()
This is a follow up CL to our previous CL [1], which implemented
fail-fast mode for blocking InputConnection APIs based on
IInputMethod.unbindInput() async signal from IMMS to IMS.

What was not implemented in the previous CL was a mechanism to
immediately unblock a sync InputConnection API call that is already
requested to the IME client process and waiting for its response.

With this CL, any blocking InputConnection API fails immediately when
IInputMethod#onUnbindInput() is delivered to the IME process, without
waiting for the full time-out period (MAX_WAIT_TIME_MILLIS == 2 sec)
to pass.

Implementation Note:

The key idea is to use CountDownLatch to compose multiple wait
conditions.composed wait condition. The CountDownLatch is initialized
with 1 then will be decremented when:

 A. received a result from the IME client
 B. received IInputMethod.unbindInput()

Hence InputConnectionWrapper can simply wait for the CountDownLatch to
become 0 with an existing timeout (MAX_WAIT_TIME_MILLIS) then returns
failure unless the CountDownLatch became 0 because of A.

 [1]: I0f816c6ca4c5c0664962432b913f074605fedd27
      1d113d041f

Fix: 36897707
Test: atest InputConnectionBlockingMethodTest
Test: InputConnectionBlockingMethodTest#*FailFastAfterUnbindInput()
      take shorter time to complete.
Test: Monitor logcat with `adb logcat -s InputConnectionWrapper:*`
      while running `atest InputConnectionBlockingMethodTest`
Change-Id: Ic65a95eb5d0fd56f505a02fd9083bcf6694b6734
2020-04-02 12:54:55 -07:00
Robert Carr
cb250de686 BLASTBufferQueue: Avoid unnecessary transactions
Currently every call to getOrCreateBLASTSurface produces a transaction.
This transaction has two parts, both of which can be eliminated:
	1. The first is the reparent. This was written when the
	client allocated the BLAST SurfaceControl, but now the WM
	allocates it and it has the correct parent to start, so
	we can just eliminate this.
	2. Showing the surface. We can eliminate this by just showing
	the surface by default.

Bug: 152501055
Test: Flip BLAST flag. Play.
Change-Id: If6e28e9153a09909fb3bb061980deb82c132dd5a
2020-04-02 12:28:36 -07:00
Soonil Nagarkar
240eaaaaab Merge "Fix up LocationRequest and ProviderRequest" into rvc-dev 2020-04-02 18:53:16 +00:00
Adam Bookatz
2f559add63 Merge "Avoid getUserBadgeNoBackgroundResId if no badge" into rvc-dev 2020-04-02 18:42:07 +00:00
Nikita Ioffe
d8c1e77cf8 Merge "Make init.userspace_reboot.is_supported a rw property" into rvc-dev 2020-04-02 15:20:34 +00:00
Adrian Roos
56f4b1b9d3 Merge "WindowInsetsAnimation: Fix app driven closing of IME" into rvc-dev 2020-04-02 13:41:46 +00:00
Adrian Roos
f5a0f80fe2 Merge "WindowInsetsAnimation: Synchronously dispatch window insets animation callbacks" into rvc-dev 2020-04-02 13:41:46 +00:00
Yara Hassan
6b6c4b1889 Enabled Content Capture in Service
Bug: 150451947
Fix: 150451947
Test: Locally
Change-Id: Icbcbe4c46c4c5eb39b176b80c01dcce96f9dfbbd
2020-04-02 12:25:35 +01:00
Jorim Jaggi
d80aee2ed8 Merge "WindowInsets: Ignore consumeStableInsets()" into rvc-dev 2020-04-02 11:21:22 +00:00
Jorim Jaggi
ea4fe825b7 Merge "Request fit system windows if soft input mode updates" into rvc-dev 2020-04-02 10:56:27 +00:00
Jorim Jaggi
fe2228aa89 Merge "Initialize sourceless insets with Insets.NONE" into rvc-dev 2020-04-02 10:55:38 +00:00
Yvonne Jiang
70a62376d0 Mark secondary lockscreen API as SystemApi.
It is currently not meant for use by general enterprise device admins.

Bug: 152478326

Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest KeyguardUpdateMonitorTest
Test: atest AdminSecondaryLockScreenControllerTest
Change-Id: I6d60bc35a4e8f74b1da55b042582a2f2fa89d57f
2020-04-02 08:41:04 +00:00
Winson Chiu
bd24ca3daf Merge changes from topic "revert-10921255-revert-10403399-pkg-override-label-icon-DCRMJNYAKW-YCXMFEDIAG" into rvc-dev
* changes:
  Add mPackageParserCallback assignment in TestParams constructor
  Revert "Revert "Allow overriding the label and icon of a MainCom..."
  Revert^2 "Add test constructor to PackageManagerService"
2020-04-02 07:49:40 +00:00
Diksha Gohlyan
0e75809955 Check Read permissions when getDocumentMetadata
Test: not tested
Bug: 151095863

Change-Id: I4f04f08f76d039196c2c67bac80d4a46ebec87f2
2020-04-02 04:30:53 +00:00
Feng Cao
257aa916ac Merge "Define custom equals method for bundles in the inline APIs" into rvc-dev 2020-04-02 02:47:01 +00:00
Mehdi Alizadeh
6ddae0c22b Merge "Adds ShortcutServiceInternal#isSharingShortcut()" into rvc-dev 2020-04-02 01:32:13 +00:00
Alex Buynytskyy
50e0244012 Merge changes from topic "LOADER_USAGE_STATS" into rvc-dev
* changes:
  Checking LOADER_USAGE_STATS before enabling read logs.
  Revert "Update the current API dump"
2020-04-02 00:36:26 +00:00
Alex Buynytskyy
5e860ba105 Checking LOADER_USAGE_STATS before enabling read logs.
Bug: b/152633648
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ic747a51b97b785c627c95bddecc6834ef602ff30
2020-04-02 00:31:41 +00:00
Makoto Onuki
a455e5e281 Add WTF when a system server wrapper can't be found
2nd try -- enable it only within the system server.

This is to detect someone trying to access system services too
early during a boot.

Bug: 149406139
Test: Boot with "adb logcat | grep -w SystemServiceRegistry" and make sure no wtf is logged
Change-Id: I64c6776cedaeb534d98621db2955d585e6846b8d
2020-04-01 17:27:58 -07:00
Rob Carr
f2f056ef71 Merge changes I98b51b43,I03cb69e1 into rvc-dev
* changes:
  InsetAnimationThreadControlRunner: Don't copy controls
  InsetsSourceConsumer: Release directly
2020-04-01 22:43:59 +00:00
Mehdi Alizadeh
f802f3777e Adds ShortcutServiceInternal#isSharingShortcut()
Bug: 152346206
Test: atest com.android.server.pm.ShortcutManagerTest1
Change-Id: I86bea32215a24aa5c7be3a5bc4bbf704b39baea0
2020-04-01 21:49:44 +00:00
Adrian Roos
6a4448f0f8 WindowInsetsAnimation: Synchronously dispatch window insets animation callbacks
Test: atest WindowInsetsAnimationControllerTests
Bug: 152617481
Change-Id: Ie002f2e605f841563d8c2669f949be3ddd666146
2020-04-01 21:30:17 +00:00
Winson Chung
331cd1a9c9 Merge "Move always-on-top to the callers" into rvc-dev 2020-04-01 21:02:26 +00:00
Ryan Mitchell
199b09a1a7 Begin moving FrameworkResourceLoaderTest to cts
This changes removes FrameworkResourceLoaderTest from frameworks/base
before it is moved to CTS.

Bug: 152979463
Test: atest CtsResourcesLoaderTest
Change-Id: I4b899564ab93472cb6d2a5ed0917026753c2827f
2020-04-01 20:09:29 +00:00
Jorim Jaggi
6f2ccea9f9 Initialize sourceless insets with Insets.NONE
...in order to make WindowInsets.equals consider source missing
and source not providing insets the same.

Fixes: 152822955
Test: InsetsAnimationTest
Change-Id: I31cb0278f45c38fb788d4f2bdefb1a13b6870216
2020-04-01 22:00:39 +02:00
Feng Cao
59b682f5cd Define custom equals method for bundles in the inline APIs
Test: atest android.view.inputmethod.cts
Bug: 152811052

Change-Id: I15051493bb37f05b579b16d6e7fee36b05ab10cc
2020-04-01 12:46:15 -07:00
Winson Chiu
8e865ecd06 Revert "Revert "Allow overriding the label and icon of a MainCom..."
Revert submission 10921255-revert-10403399-pkg-override-label-icon-DCRMJNYAKW

Reason for revert: Re-submit broken change with included fix.
Reverted Changes:
Ic5c719cbb:Revert "Allow overriding the label and icon of a M...
Id9d37e661:Revert "Add test constructor to PackageManagerServ...

Bug: 113638339

Change-Id: I4f5247f528f62c175bd34f0e4cb16c9456c8afe4
2020-04-01 19:17:53 +00:00
Selim Cinek
a2b1d3753b Added back the recently alerted indicator to conversations
Previously this was dropped, it's now reintroduced.

Fixes: 150905003
Test: atest SystemUITests
Change-Id: Ia152bc4117fa9c656b3d477ef8e50708e1056148
2020-04-01 11:40:57 -07:00
Selim Cinek
4237e8277a Reintroduced app ops for conversation notifications
Previously app ops weren't showing in conversation notifications
Also made sure that they show in case the app name is long.
Additionally this fixes the coloring of the sender name.

Fixes: 150905003
Test: atest SystemUITests
Change-Id: Iae8026e7efdec8c207d1984dac4ee089abe116b9
2020-04-01 11:40:54 -07:00
Adrian Roos
3b19ff1e0f WindowInsetsAnimation: Fix app driven closing of IME
When using controlWindowInsetsAnimation to close the IME,
delay reporting this to the IME until the animation is actually
finished. Otherwise, the IME will self-hide and start a transition
that breaks the just-begun app-driven transition.

(Regression from I7f6098a61a5942795ffd33a60329e4dd5fb5d6cb which
changed InputMethodService to hide itself in reponse to notifyHidden)

Bug: 151980214
Test: make WindowInsetsTests, ensure that dragging the IME closed doesnt get cancelled
Change-Id: If4e64cc78742a4e1e8c98137bd97d65dd567f674
2020-04-01 18:28:13 +00:00