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
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
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
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
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
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
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
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
This should prevent long review times because test ownership doesn't match code ownership.
Test: n/a
Change-Id: I59812d77db671ee39906df009a918f2881259eab
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
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
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
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
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
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
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
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