Commit Graph

10205 Commits

Author SHA1 Message Date
shawnlin
bcea9fd89e Support scaled cutout & roundedcorners when resolution is overridden
In current desgin, the confgis for cutout and rounded corner are based
on the original display size. If the display resolution is overridden,
cutous and rounded corners will be drawn in incorrect places with
incorrect size.

We should load the cutout & rounded corners with the orignal display
size and then scale the results with the display ratio which is
calculated by dividing current size with original size.

Bug: 209592558
Test: manual:
      1. Go Settings-> Display-> Screen Resolution
      2. Switch between FHD+ and QHD+
      3. Check if the cutout and rounded corner looks the same as they
	 are in the original display size.
Test: manual:
      1. adb shell wm size 1080x2340
      2. Check if the cutout and rounded corner looks the same as they
         are in the original display size.
Test: atest DisplayCutoutTest LocalDisplayAdapterTest
          ScreenDecorationsTest RoundedCornerResDelegateTest
Change-Id: Iea42b73c0276b82983c1ddbce9455355afdc164d
2022-04-20 10:03:19 +08:00
Julia Reynolds
d6090a038a Make notification getParcelable usages safer
Test: SystemUITests, CtsAppTestCases
Fixes: 198825327
Change-Id: I7a4868a56bc2c9a69d2fb1eae5d53faa3c9dede0
2022-04-15 12:38:27 +00:00
Ryan Lin
565d2b1b85 Merge changes from topic "nodebounds" into tm-dev
* changes:
  remove embeddedMatrix usage for PIP menu
  Change node bounds procedure based on SufaceFlinger Callback
2022-04-14 01:55:04 +00:00
Tiger Huang
e467b6e722 Fix InsetsState#calculateVisibleInsets
Before the new insets system, a window wouldn't receive visible insets
if it:
 - has FLAG_LAYOUT_NO_LIMITS,
 - is not TYPE_WALLPAPER or TYPE_SYSTEM_ERROR, and
 - is not in multi-window mode.

This CL makes the visible insets compatible with the legacy insets
system.

Fix: 223536648
Test: atest InsetsStateTest
Change-Id: Ia73142cfae701d0532a9a397366c50aeef82abb2
2022-04-13 18:13:52 +08:00
Jernej Virag
93599ecf92 Merge "Downscale oversized MessagingStyle avatars" into tm-dev 2022-04-12 15:33:38 +00:00
Lee Shombert
ead48cc667 Merge "Helper classes for IpcDataCache clients" into tm-dev 2022-04-12 14:32:31 +00:00
ryanlwlin
7bdc82af7c Change node bounds procedure based on SufaceFlinger Callback
The attachInfo from ViewRootImpl is not reliable
for DisplayArea manipulation or windowless window.

To fix this problem, we use the transform matrix of
InputWindowHandle, which could transform the bounds
from window coorindate to screen coordinate. We also
transfrom the bounds to logical display coordinates
with the associated display matrix.

Besides, we also record the magnification spec of the window,
which could get the bounds before magnification. We use
this value to decide the property 'visibleToUser'.

Bug: 200797785
Test: atest android.accessibilityservice.cts WindowInfoTest
      atest com.android.server.accessibility
Change-Id: I0917b04fe8b027fb2bd932a6f0604ba1449ebc66
2022-04-12 22:24:21 +08:00
Fabian Kozynski
4ae15e81bc Merge "Don't crash TileService app when systemui crashes" into tm-dev 2022-04-12 13:16:54 +00:00
Jernej Virag
3405f17fe4 Downscale oversized MessagingStyle avatars
Notification API downscales oversized icons in all formats except in MessagingStyle. This seems to be an oversight that can cause massive memory usage.
This downscales avatars to a reasonable size if they're too big.

Bug:193720474
Bug:221890932

Test: atest NotificationTest
      Built a test app with 4000x4000 avatar icon.
      Memory usage went from 250MB to ~170KB per notification.
Change-Id: I35377cdb5d61ee6e23fccc2bffb5d3aec6ca2b7d
2022-04-12 10:58:33 +00:00
Fabian Kozynski
0549cf1251 Don't crash TileService app when systemui crashes
Prevent the host app from crashing if systemui crashes while binding to
it. Instead, just return null and let the new systemui process bind
again, as the service will be unbound.

Test: atest FrameworksCoreTests:TileServiceTest
Test: manual, tiles still work
Fixes: 168756844
Change-Id: I70e0e8a223a84874415f7e649106398a5e039097
2022-04-11 14:10:21 -04:00
Lee Shombert
529a49ee3d Helper classes for IpcDataCache clients
Bug: 227653108

This adds a helper class that can reduce much of the boilerplate in
code that uses IpcDataCache (or the internal-only variant,
PropertyInvalidatedCache).  See the changes to DevicePolicyManager for
example usage.

Two PropertyInvalidatedCaches APIs are exposed for testing.  The
method createPropertyName() is changed so that apis like "Foo" are
converted to "foo", not "_foo".

Unit tests for the new behavior are added to IpcDataCacheTest.

This was manually tested by dumping the cache info from builds with
and without this change.  Special attention is paid to the
DevicePolicyManager caches.  The same caches were found (as identified
by their key and api) and the caches were enabled/disabled the same.

In the course of testing, multiple instances of DevicePolicyManager
caches were observed.  Cache performance is better if the caches are
static; making them static will be addressed in b/228452829.

Test:
 * atest FrameworksCoreTests:IpcDataCacheTest
 * atest FrameworksCoreTests:PropertyInvalidatedCacheTests
 * atest FrameworksServicesTests:DevicePolicyConstantsTest
 * atest FrameworksServicesTests:DevicePolicyEventLoggerTest
 * atest FrameworksServicesTests:DevicePolicyManagerServiceMigrationTest
 * atest FrameworksServicesTests:DevicePolicyManagerTest
 * atest FrameworksServicesTests:EnterpriseSpecificIdCalculatorTest
 * atest FrameworksServicesTests:OverlayPackagesProviderTest
 * atest FrameworksServicesTests:OwnersTest
 * atest FrameworksServicesTests:PolicyVersionUpgraderTest
 * atest FrameworksServicesTests:SecurityEventTest
 * atest FrameworksServicesTests:SystemUpdatePolicyTest
 * atest FrameworksServicesTests:TransferOwnershipMetadataManagerTest
 * atest MixedDeviceOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
 * atest MixedDeviceOwnerTest#testSetKeyguardDisabledFeatures
 * atest MixedManagedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
 * atest MixedManagedProfileOwnerTest#testNetworkLoggingDelegate
 * atest MixedManagedProfileOwnerTest#testSetKeyguardDisabledFeatures
 * atest OrgOwnedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
 * atest OrgOwnedProfileOwnerTest#testNetworkLoggingDelegate
 * atest OrgOwnedProfileOwnerTest#testSetKeyguardDisabledFeatures
 * atest android.devicepolicy.cts.DevicePolicyManagerTest
 * atest android.devicepolicy.cts.NetworkLoggingTest
 * atest com.android.cts.devicepolicy.DeviceOwnerTest#testAdminActionBookkeeping

Change-Id: I2f4fe4ed25db5fb3100334b9d2ce748ee928c10d
2022-04-11 07:27:16 -07:00
Treehugger Robot
6a60515cba Merge "Update test owners for SSL*,Uri*,Url*" am: f743f382c9 am: 8bbe4be031 am: c2d26b0f31
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2061207

Change-Id: Ia64bc1858468b55acfb565dcb9b09c5dc304534b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-11 12:40:57 +00:00
Treehugger Robot
8bbe4be031 Merge "Update test owners for SSL*,Uri*,Url*" am: f743f382c9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2061207

Change-Id: I7252a776092addf2de300cbf17bc63afbcde2c4f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-11 12:00:14 +00:00
Orion Hodson
c7db718dda Update test owners for SSL*,Uri*,Url*
Bug: 171966843
Test: checkowners.py OWNERS
Change-Id: I15ba32283148c097661cc4273c67ebb15ca845fc
2022-04-11 09:59:00 +01:00
Shan Huang
be460cbac4 Merge "Create OnBackInvokedCallbackInfo to wrap callback and its priority." into tm-dev 2022-04-08 04:07:53 +00:00
TreeHugger Robot
e9145245f5 Merge "Consolidate launch time change notifications." into tm-dev 2022-04-08 00:16:38 +00:00
Shan Huang
b353af0387 Create OnBackInvokedCallbackInfo to wrap callback and its priority.
Main motivation is to store a back callback's exact priority value in WM. This is required by the IME migration (ag/17076160) to compare the priority levels of IME window callback and focused window callback in BackNavigationController.

This also consolidates the WindowState#mSystemOnBackInvokedCallback and WindowState#mApplicationOnBackInvokedCallback fields into one field, as tracking two fields for one callback was error prone. We had to remember to clear the application / system field when the other field is set, and failing to do so has resulted in bugs such as b/222675481.


Bug: 224856664
Test: atest BackNavigationControllerTest
Test: atest WindowOnBackInvokedDispatcherTest
Test: m -j and test back behavior throughout the system on apps that
opted in and out.

Change-Id: Ic57113610d934f33d2c9ca4cef59f39a9b87e832
2022-04-07 05:11:42 +00:00
Kweku Adams
09c0ede3bf Consolidate launch time change notifications.
Track pending estimated launch time changes in a single Set so that we
avoid sending repeat notifications for a single package.

Bug: 227796747
Test: atest CtsUsageStatsTestCases:UsageStatsTest
Test: atest FrameworksCoreTests:android.util.SparseSetArrayTest
Test: atest FrameworksMockingServicesTests:PrefetchControllerTest
Test: atest FrameworksMockingServicesTests:UserUsageStatsServiceTest
Change-Id: I671c97e4e4110d0a1c76a8f6400dfe8c1e5055dc
2022-04-06 15:24:34 +00:00
Shivam Agrawal
87550b067a Merge changes from topic "embedding-race-condition" into tm-dev
* changes:
  Send Split Info Callback before Activity#onCreate
  Revert "Removing TaskFragment token from LaunchActivityItem"
2022-04-05 18:36:49 +00:00
Xin Li
be28e53132 Merge changes from topic "merge_8391262" into stage-aosp-master
* changes:
  Fixup OWNERS file merge conflicts.
  Merge Android 12 QPR3 ab/8391262
2022-04-03 06:41:20 +00:00
Ling Ma
8827b92855 Merge changes from topic "truncate operator name" am: ffa0f982b6 am: 9cf73e369d am: eb897b1d85
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2004810

Change-Id: Ie1a67a1a9fae4dbbc321755f7ec9bde8bb84613f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 22:54:46 +00:00
Ling Ma
eb897b1d85 Merge changes from topic "truncate operator name" am: ffa0f982b6 am: 9cf73e369d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2004810

Change-Id: Ic3985aab30f06ce02ec01e43ce8a6c05abd419a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 22:36:38 +00:00
Ling Ma
ffa0f982b6 Merge changes from topic "truncate operator name"
* changes:
  Truncate operator name to fit into SystemProp size
  Add truncateStringForUtf8Storage()
2022-04-01 21:43:23 +00:00
Vadim Caen
d0923a2197 Merge "Split animation methods out of OnBackInvokedCallback" into tm-dev 2022-04-01 20:13:30 +00:00
Vadim Caen
c627777dda Split animation methods out of OnBackInvokedCallback
This makes OnBackInvokedCallback SAM compatible

Bug: 227789359
Test: atest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationLegacyTest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationTests \
        WmTests:com.android.server.wm.BackNavigationControllerTests \
        FrameworksCoreTests:android.window.BackNavigationTest \
        FrameworksCoreTests:android.window.WindowOnBackInvokedDispatcherTest \
        CtsViewTestCases:android.view.cts.OnBackInvokedDispatcherTest
Change-Id: Iab86b0488f1b3048eb02042191acaeb6a645a0bc
2022-04-01 20:09:26 +00:00
Ling Ma
58d9786a64 Add truncateStringForUtf8Storage()
Test: manual
Bug: 210502588
Change-Id: I5d4ded0cb30151bc567cfedcdb1bbbdb9abdca9b
2022-03-31 18:57:05 -07:00
Jernej Virag
6ad5af88f2 Merge "Add code OWNERS to test OWNERS for internal widgets" am: c207bdcf5f am: 04c7193fb1 am: 789701fb45
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2051242

Change-Id: I803f5aabf39fb36d4f1f975de75b22a1789c0df0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 20:36:15 +00:00
Jernej Virag
789701fb45 Merge "Add code OWNERS to test OWNERS for internal widgets" am: c207bdcf5f am: 04c7193fb1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2051242

Change-Id: Id7458a889e8b084a260b18f56db315ee1317b3a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 19:59:30 +00:00
Treehugger Robot
f8adc1692b Merge "[DeviceConfig] cherry-pick deleteProperty SystemApi" am: 6ff14106fc am: ab9e828a43
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2040764

Change-Id: Id0b7cb4f43df62a2a900fc0eab016aeb1a08c89c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 19:22:46 +00:00
Jernej Virag
c207bdcf5f Merge "Add code OWNERS to test OWNERS for internal widgets" 2022-03-31 19:11:07 +00:00
Treehugger Robot
6ff14106fc Merge "[DeviceConfig] cherry-pick deleteProperty SystemApi" 2022-03-31 18:39:09 +00:00
Jernej Virag
ba5392ca14 Add code OWNERS to test OWNERS for internal widgets
This should prevent long review times because test ownership doesn't match code ownership.

Test: n/a
Change-Id: I59812d77db671ee39906df009a918f2881259eab
2022-03-31 15:10:53 +00:00
Adrian Roos
fe61c9af90 VirtualDisplayTest: Rethrow runOnUiThread exceptions on test thread
Catches and rethrows exceptions on the test thread to
avoid taking down the entire instrumentation test when
tests fail.

Bug: 223843046
Test: atest VirtualDisplayTest
Change-Id: I78b6777ff3cabc532cd73390cc5b4c23f64ae127
2022-03-31 15:40:23 +02:00
Jernej Virag
0c36369480 Merge "Fix handling of negative size request for Bitmaps in LocalImageResolver" into tm-dev 2022-03-31 11:29:01 +00:00
TreeHugger Robot
9519e3c94a Merge "Fix VirtualDisplayTest failures" into tm-dev 2022-03-31 08:57:14 +00:00
Shivam Agrawal
39c6eaa64d Revert "Removing TaskFragment token from LaunchActivityItem"
This reverts commit 6dc124025d
in tm-dev. The revert is necessary because SplitController
needs to access the initial task fragment token from the
activity client to ensure that split info callbacks are sent
before an activity is created.

Test: existing tests pass
Bug: b/218791665
Change-Id: I7d6506312b46af026ec19e4aad9d0f31482e175a
2022-03-30 22:33:28 -04:00
Hiroki Sato
2c06ff3da8 Merge changes from topics "presubmit-am-166ca8e59ac8499bb6b4f4cad6aae045", "presubmit-am-1a825bf4d182432b91541a8629e0e351" into tm-dev
* changes:
  Add private API InputMethodManager#reportVirtualDisplayGeometry
  Reland CursorAnchorInfo#createForAdditionalParentMatrix()
2022-03-31 00:15:59 +00:00
Jorim Jaggi
cd106a5aa7 Merge "Fix overcounting after end in case of incomplete callbacks" into tm-dev 2022-03-31 00:07:42 +00:00
TreeHugger Robot
c80324f62a Merge "Add method PrintManager#isPrintServiceEnabled(ComponentName)" into tm-dev 2022-03-30 22:41:09 +00:00
Jernej Virag
26e492cc4b Fix handling of negative size request for Bitmaps in LocalImageResolver
Requesting negative sized bitmap should mean "no restrictions" and not "please resize to -1x-1". This fixes the corner case for pure bitmaps.
Also reduce severity of logging when we're falling back to non-ImageDecoder load since that's not a catastrophic failure.

Bug:227103943
Bug:227008805

Test: tested on device with Notify1.apk while reproducing the issue
      atest LocalImageResolver with new tests
Change-Id: I581d3e637fcafaba68856738f90cc72c42442d60
2022-03-30 14:44:55 +00:00
yuanjiahsu
ad1bf17965 Don't register playback/recording change if caller doesn't care it
When calling VirtualDeviceManager#createVirtualAudioDevice(), if the
caller pass null AudioConfigurationChangeCallback parameter, it means
the caller doesn't care the audio playback/recording change in virtual
display, and we should not register it with AudioManager for
optimization.

Bug: 218528439
Test: atest CtsVirtualDevicesTestCases
Change-Id: I00120f2506f593100ef8c523a4f6addffe46597b
2022-03-30 04:10:17 +00:00
Erik Wolsheimer
b7b880315a Add method PrintManager#isPrintServiceEnabled(ComponentName)
Bug: 180582919
Test: atest FrameworksCoreTests
Change-Id: I2f7e87d9e56f3abc22c04eee3e0863d5de48a9f9
2022-03-29 21:38:35 +00:00
TreeHugger Robot
93ac91554a Merge "Fix mobile radio battery consumption double counting" into sc-v2-dev am: f709e34b90 am: 9d9976b68f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17206575

Change-Id: I9c301bd9e347fedaa1a04ce8f2e50fda402ece4d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 20:54:57 +00:00
TreeHugger Robot
9d9976b68f Merge "Fix mobile radio battery consumption double counting" into sc-v2-dev am: f709e34b90
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17206575

Change-Id: I472e4dc6a9b0ae0f8f76e2b620ec59e53aba0b3a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 20:39:43 +00:00
TreeHugger Robot
f709e34b90 Merge "Fix mobile radio battery consumption double counting" into sc-v2-dev 2022-03-29 20:19:40 +00:00
Hiroki Sato
62af809a65 Reland CursorAnchorInfo#createForAdditionalParentMatrix()
This logically relands the CL [1], which added an @hide method
CursorAnchorInfo#createForAdditionalParentMatrix().
The corresponding change was once removed in [2].
This is a preparation to reland a change that supports
InputMethodManager#reportActivityView() again.

[1] Ic7f9057623ffc61ec7a6121735dc39adecf4649d
[2] I0a05453eeed863db5bfe4b965ab4bcbad67f2783

Bug: 224424149
Test: CursorAnchorInfoTest
Change-Id: I0a411453c7c26795d28e913a96be8eb8fa3684d7
2022-03-28 20:03:15 +09:00
Jorim Jaggi
7e9b844f52 Fix overcounting after end in case of incomplete callbacks
The original intent of the code was to wait until we get one frame
with end vsync id or beyond end vsync id with both HWUI and SF
callbacks being reported such that we can ensure that our data
collection is complete.

However, the logic unintentionally started janky frames after the
end in case there were callbacks missing on the end vsync id,
leading to skewed metrics.

Also expand unit tests to verify jank number results.

Test: FrameTrackerTest
Fixes: 223787365
Change-Id: I90948d9ab2d44bf805e78f5611e072a7cc9ae0cd
2022-03-25 23:02:58 +00:00
Charles Chen
25704b6ac3 Fix VirtualDisplayTest failures
The failures are due to legacy behaviors in the test, which includes:
1. Use Toast without managed token
2. Show presentation on the default display

Currently, we need a managed window token for toast, and also the
display to show preentation should be a presentation display.
A built-in display isn't a presentation display by default.

In this CL, we
1. Use the default window type for Presentation
2. Use fullscreen overlay dialog on the default display
to fix this test

Bug: 223843046
Test: atest VirtualDisplayTest

Change-Id: Ifa790a3436ed487f4af79296e47a900d62cea375
2022-03-25 14:58:48 +08:00
Mark Renouf
fe4b81853e Merge "Remove permission token from startActivityAsCaller" into tm-dev 2022-03-25 02:32:08 +00:00
Muhammad Qureshi
bbc750f010 [DeviceConfig] cherry-pick deleteProperty SystemApi
This is a cherry-pick of deleteProperty SystemApi that is already added
in internal branches.

Currently there is only a shell command to delete a property.
Adding an API to do the same.

Bug: 184001163
Bug: 226423598
Test: atest android.provider.DeviceConfigTest
Change-Id: I43d7177c509501efd65e32ab3ad000d17d6ffb6c
Merged-In: I43d7177c509501efd65e32ab3ad000d17d6ffb6c
2022-03-24 11:50:37 -07:00