Kill the app in both profiles if user/admin revokes
the cross profile app op permission, this is to ensure
that any cross profile bound services gets unbound as
soon as the app op is revoked.
Fixes: 154693902
Test: atest ManagedProfileCrossProfileTest
Test: atest FrameworksServicesTests:com.android.server.pm.CrossProfileAppsServiceImplTest
Test: atest CrossProfileAppsServiceImplRoboTest
Change-Id: Iaa3b9196468149c1cec51e9101989f1877374cc5
Unlike splash screen starting window that inherits the size of
activity directly, task snapshot needs the final size to draw right
after adding to display. Otherwise the content will look like as
cropped because the surface size uses different orientation.
And because starting window is added before executing transition,
assume there will have transition if the owner of starting window
is also the top activity.
Bug: 155862858
Test: ActivityRecordTests#testFixedRotationSnapshotStartingWindow
Change-Id: Idb4f9a92a6e2594356416afd0ab6360e94e66497
So the snapshot won't show half if the its has a delta of 90 degree
rotation with the actual activity. If the snapshot is not compatible
with the activity, the starting window type will be splash screen.
Bug: 155862858
Test: atest ActivityRecordTests#testIsSnapshotCompatible
Change-Id: I8d8a926d057f1d18d028fcc03bddbb17ffbbf96b
Because the rotation of activity and task are different, The
information of snapshot may be inconsistent. And since it is a
temporal state, in most cases the snapshot is available after
the fixed rotation is cleared. This fixes a non-rotated snapshot
is shown on a rotated activity when repeating launch and swipe
to home quickly.
Also the fixed rotation launching app should not be cleared if
there is pending rotation, otherwise it is too early that the
display is still in old rotation. This fixes flickering when
switching between activities in different rotation from quickstep.
Bug: 155862858
Test: atest TaskSnapshotControllerTest#testPrepareTaskSnapshot
ActivityRecordTests#testActivityOnCancelFixedRotationTransform
Change-Id: I8e30e87ea4aad907c4ad4338b91fcff3078380ad
This CL also removes the assumptions about the new insets mode, because
we are always in the new insets mode now.
Fix: 156311082
Test: atest ViewRootImplTest DisplayPolicyLayoutTests WindowStateTests
Change-Id: I9f6f8824ae364b9cd95f6715dd761026d602c095
The test has been very likely to fail with OOM error or process crashes.
This is because we repeatedly creating ActivityRecord/ActivityStack/Task
in the test. Even though we release it after each run, the GC can still
throw OOM because of reference by mocking is not released while running
the test. After receiving several OOM's, the test process will crash.
To fix this issue, simply re-use the same ActivityRecord instead of
creating one per loop run. This works for this test as we only care
about the starting window handling inside ActivityRecord.
Test: atest AppWindowTokenTests#testAddRemoveRace
Bug: 130392471
Change-Id: I7df942d364ee07e179b05b6f837494c475197d7c
Fade out system bars when the fixed transform is starting and fade them
in once its finished.
Bug: 150676212
Test: Manual: open and close a landscape application, and open and
immediately cancel opening animation.
Test: atest WmTests:com.android.server.wm.DisplayContentTests#
testApplyTopFixedRotationTransform
Change-Id: I24d33b947193e8b87f13b497c0b32e3794f2b070
Add a method similar to Animatable.shouldDeferAnimationFinish() in
AnimationAdatper to give more flexibility when we can't override
Animatable.
Bug: 150676212
Test: atest
WmTests: com.android.server.wm.SurfaceAnimatorTest#testDeferFinishFromAdapter
Change-Id: I9db3c5d1e1ac92c68fe00eca886ea71965d0142e
Remove mocked local services after test finish, so it won't affect
other tests.
Fixes: 156221489
Test: atest ActivityStartInterceptorTest AppWindowTokenTests
Change-Id: I2e868204fe098c616ff8b2b17c3d47e42d799124
These new tests verify that all fields defined in UsageStats,
UsageEvents.Event and IntervalStats are known fields. This is to ensure
that when new fields are added to these objects or a refactoring is
done, the fields are accounted for when persisting usage stats.
Bug: 155935953
Test: atest UsageStatsPersistenceTest
Test: atest IntervalStatsTest
Change-Id: Ice65391d0af08b64db4ccaa046e57d9fca299319
The transform hint is used to prevent allocating a buffer of a
different size when a layer is rotated. The producer can choose to
consume the hint and allocate the buffer with the same size.
Provide the graphic producer a transform hint if the layer and its
children are in an orientation different from the display's
orientation. The caller is responsible for clearing this transform
hint if the layer is no longer in a fixed orientation.
Bug: 152919661
Test: atest VulkanPreTransformTest
Test: confirm with winscope trace, buffers are allocated taking into
account the transform hint in fixed orientation scenarios
Test: go/wm-smoke
Change-Id: I2ccc21ed8af015716e6cdfde1e3cec67c99f3339
The user can't interact with headless system apps (pre-installed apps
without any activities) but they're expected to work properly. We don't
want to fully exempt the apps from app standby, but they should be fine
operating in the ACTIVE bucket, so we make sure that headless system
apps never fall below the ACTIVE bucket.
Bug: 155761007
Test: atest FrameworksServicesTests:AppIdleHistoryTests
Test: atest FrameworksServicesTests:AppStandbyControllerTests
Change-Id: I1549bb81eca293be31691b079bab2142cbcdf8a7
* Make sure that if the time is rolled back after the deadline
has been reached, it is not undone. When the deadline is
reached it is set to -1 which is far in the past, so timezone
change won't affect it.
* Return sensible value in case when the deadline has just
expired and the suspension itself hasn't been enacted.
Previously the deadline expiration wouldn't be reflected until
mAppsSuspended gets updated after all apps are suspended.
* Update deadline on time changes. This makes it react to time
changes via adb.
* Additional debug logging to investigate further if the issue
persists.
Bug: 155878352
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: I6549f76584121df200ace811285e7a358f262869
Fixes an issue where serverVisible was only updated after updateFrames, but
updating the frames depends on the server visibility being correct since [1].
Also addresses an issue in the test fixture which prevented this regression
from being caught: the server visibility is now set by onPostLayout, instead
of onSetup, to mirror how the server visibility would be set at runtime.
[1]: Id2c482e112c1d73cf7d5b3ba5e1a2d5775f47298
Fixes: 156226586
Test: atest ScreenDecorWindowTests InsetsSourceProviderTest
Change-Id: Id90e6315e9fe230307929a8d992a76a5dae1107c
The test is no longer flaky.
Test: atest TaskStackChangedListenerTest#testTaskChangeCallBacks
Bug: 153707978
Change-Id: I4ca0c15d84728359357e2a42efdb90e06999db68