Commit Graph

103453 Commits

Author SHA1 Message Date
Steven Thomas
6ec6fbc2cc Add frame rate flexibility token
Add support for temporarily relaxing frame rate restrictions in surface
flinger. This is used by CTS tests to get a consistent device state
while running frame rate tests.

Bug: 148033900

Test: - On a Pixel 4, I turned the brightness down and covered the
ambient light sensor, causing the display manager to set a frame rate
restriction. I ran the frame rate CTS test without these CLs applied,
and confirmed the test failed because surface flinger couldn't switch
frame rates, as expected. Then I ran the tests with the CLs applied, and
confirmed the tests pass.

- I confirmed that, without adopting shell permission identity, the CTS
test is denied the request to acquire a frame rate flexibility token. So
normal apps won't be able to access this.

Change-Id: Ie2b611cf5726c14a7a22e315a85bf6200d190682
2020-04-04 19:55:00 -07:00
Winson Chung
17849976da Merge "Keep task hidden until task appeared" into rvc-dev 2020-04-04 18:06:04 +00:00
TreeHugger Robot
43bc020fc0 Merge "Only apply VPN isolation if it's fully routed" into rvc-dev 2020-04-04 03:44:46 +00:00
Raff Tsai
6944511300 Merge "Add name space settings_stats" into rvc-dev 2020-04-04 03:18:04 +00:00
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
Mehdi Alizadeh
6991da300f Merge "Wrap ShortcutQuery in a parcelable wrapper object and pass it direcly through aidl." into rvc-dev 2020-04-04 00:23:47 +00:00
TreeHugger Robot
2c1f53ad6f Merge "Disable the freezer while we're collecting binder interface descriptors." into rvc-dev 2020-04-03 22:41:52 +00:00
Rob Carr
73e4cc48c7 Merge "BLASTBufferQueue: Fix unnecessary copying of Surface" into rvc-dev 2020-04-03 21:48:08 +00:00
TreeHugger Robot
59a65bdc0f Merge "Revert "Fix DecorView error about non-visual context"" into rvc-dev 2020-04-03 19:53:56 +00: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
Vadim Tryshev
5420fffe19 Revert "Fix DecorView error about non-visual context"
This reverts commit 828c498904.

Reason for revert: b/152806048
Bug: 152806048

Change-Id: I0ba53944a7fddf42cccf79c6495945c8afa3ab31
2020-04-03 18:06:05 +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
Raff Tsai
a0756cd60f Add name space settings_stats
settings_stats name space contains whitelist keys which is needed
for logging.

Design doc: https://docs.google.com/document/d/1OijtO3QfFxYiIUyNbVm7pGzZ8zx2xV-1CrLYQEIGDTI/edit
Bug: 142941011
Test: rebuild

Change-Id: Ib6cb2b1203dbc0f5c575099e91dd0a40a3e17ca9
2020-04-03 17:58:16 +08: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
Robert Carr
1dd148d9ac BLASTBufferQueue: Fix unnecessary copying of Surface
When we call mSurface.transferFrom(getOrCreateBLASTSurface()) we
always end up incrementing mSurface.generationId, because
BLASTBufferQueue.java::getSurface will always return a new native
wrapper object. We had a similar situation with
mSurface.copyFrom(mSurfaceControl), and had to build IGBP
comparison in to the native method. Here though, it's easier
to just rely on the stability of the Surface (never changes
for the lifetime of the BLASTBufferQueueAdapter) to avoid
duplicate calls to transferFrom.

Bug: 152501005
Test: Existing tests pass.
Change-Id: I64b9a6ae3cabfa75974e040460638417bfac6845
2020-04-02 15:29:34 -07: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
Pinyao Ting
1f31f3ee79 Wrap ShortcutQuery in a parcelable wrapper object and pass it
direcly through aidl.

As part of the effort to simplify the implementation of
LauncherAppsService, We create ShortcutQueryWrapper, a parcelable
object that wraps ShortcutQuery and pass it to LauncherAppsService
directly.

Bug: 148104408
Test: atest ShortcutQueryTest
Merged-In: I2e2ccaf38ef6bd558b4b02e647a7e263c7e612a9
Change-Id: I2e2ccaf38ef6bd558b4b02e647a7e263c7e612a9
(cherry picked from commit d043004cee)
2020-04-02 21:51:59 +00: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
Lorenzo Colitti
5ccee0c73c Only apply VPN isolation if it's fully routed
VPN is considered fully routed if both IPv4 and IPv6 have
either a default route or a prohibit route.

Bug: 145332510
Test: atest FrameworksNetTests
Merged-In: I59cf48552bca98092d1212e3d718fd420add5458
Change-Id: I59cf48552bca98092d1212e3d718fd420add5458
2020-04-02 10:36:19 +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