Currently, if AppStandbyController is enabled after some listeners have
already registered, the listeners will be told that the system is in a
state of parole even though AppStandbyController thinks it's not in
parole. This change informs AppIdleStateChangeListeners when
AppStandbyController's enabled state changes as well so that they can be
in the correct state.
I also removed the call to setAppIdleEnabled() in onBootPhase() since
updateSettings() is called right afterwards and that also calls
setAppIdleEnabled().
Bug: 112329453
Test: atest AppStandbyControllerTests
also check logs to confirm that NetworkPolicyManagerService and
JobSchedulerService's listeners switch from ON to OFF when the system is
ready.
Change-Id: I88bc293c70b459f54f75f92126ad306d6ab8d9b7
The old hack to grant permissions on upgrade was removed. The new code
applies to
- platfrom upgrade
- initial package installation
- package update
Inheriting the grant state is the default behavior for split permissions.
Special cases will be added later.
Also make sure to revoke the permission once the app declares that it is
aware of the permission.
Test: atest CtsPermissionTestCases:SplitPermissionTest
Change-Id: Ie51971530607f0b585cf7a3e11b01b11a28e1de9
Always create a copy for task info to avoid the original intent
being modified.
Bug: 119052114
Test: atest TaskRecordTests#testCopyBaseIntentForTaskInfo
Change-Id: Ib27bc52c436f3e8b379b4374dc9d5b6031fa0316
We don't want to automatically start home activities while
the home app is being instrumented because it prevents home
activities unexpectedly resumed during testing.
We should still allow launching home activities if requested
(e.g. starting home activity when home key pressed).
Bug: 118891218
Test: atest TaplTests
Test: atest ActivityStackSupervisorTests
Test: atest ActivityManagerMultiDisplayTests
Change-Id: Ia362f875d38748a3dea40b5788a4d86bcc68392c
Final step before we actually start unifing the hierarchy is to have
activity and window manager under one lock. This CL makes it so.
Note, that there are probably areas where this change might lead to dealock
however we can fix those areas as we discover them.
Test: Existing tests pass
Bug: 80414790
Change-Id: Ie4b71d4ceb986256482031a99065b8d2ef60ebe8
Move display update logic from WM into ATM hierarchy by letting
ActivityStack watch for relevant changes and calculate bounds
accordingly and removing configuration updates from WM side
outside of calls from the display-level controller (like how
the other levels work).
One of the main display-changes to account for is rotation. To
make this work without drastically modifying things was to leave
display freeze/startSeamless in WM but move the actual rotation
to ATM while handling SEND_NEW_CONFIGURATION. This prevents
changes to the wm-side hierarchy outside of ATMS's control.
To facilitate this extra communication between ATMS and WM,
this adds rotation into WindowConfiguration. This makes rotation
available to the hierarchy update for policies that care about it
(things like split). It will also replace TaskStack's mRotation
in an upcoming CL and should also let us remove the one-off
variable for landscape->seascape orientation changes (needs
some more research though).
Bug: 113900640
Test: go/wm-smoke + relevant am/wm servicestests
Change-Id: I12c79cc5eb94d48d846f1cf27765c9f9f6741435
Add mockito-based behavioral unit tests for the LaunchObserver.
Verify each state transition.
Test: atest WmTests:ActivityMetricsLaunchObserverTests
Bug: 72170747
Bug: 112680320
Change-Id: Ie8685a1262ccc7730aa5c574274f7ad0caeeedef
According to the mockito FAQ use of thenReturn(mock(...)) is
forbidden. This fixes that pattern in the setup for
ZenModeFilteringTest.
https://github.com/mockito/mockito/wiki/FAQ#can-i-thenreturn-an-inlined-mock-
Test: runtest systemui-notification
Bug: 119063276
Change-Id: Ic62b18063e5837240255e1dd0f5e0feb450f22cb
Use androidx.test not android.support.test.
And remove android.support.test from build by removing unnecessary
frameworks-base-testutils > android.support.test dependency
Bug: 117990406
Test: m checkbuild; atest FrameworksServicesTests:StorageManagerServiceTest
Change-Id: Ia825e0926b46855f9056739441cb21a065692076
Assume a display supports system decoration and allows reparenting
stacks to another display when the display is removed. If there
exists a standard type finishing activity during removing the
display, the activity will be reparented and found the original
stack is empty, then home is started again on the removed display.
This change combines the condition ActivityDisplay.mRemoved into
ActivityStack.isAttached, and defers the resume during finishing
or reparenting, so the stacks in the removing display won't be
focusable and resumed.
Also keep original z-order of the reparented stacks and reduce
unnecessary resume, visibility update for each reparented stack.
Bug: 119093839
Test: atest ActivityDisplayTests#testNotResumeHomeStackOnRemovingDisplay
Change-Id: I7dea2582ce8bd4aa4a18e1d5d721bfb1d9027c6a
We started home activity before system ready because overlay
display was added. It accidentally updated the AM state to booted
without actually finishing booting procedure. The booting procedure
was unable to complete afterward.
Do not start home activity before system booting.
Bug: 118796241
Test: atest ActivityStackSupervisorTests
Change-Id: I4e4a38b742529fc7ba6163c1a05137c68faf83e7
This attribute will stabilize ScreenDecorWindowTests since this test
needs activity is shown even on locked device.
Fixes: 119041502
Bug: 119037340
Test: On sleeping DUT.
atest FrameworksServicesTests:com.android.server.wm.ScreenDecorWindowTests
Change-Id: I98ef00ba32c792c396f3abba447dd20628902492
Merged-In: I8fc2683ad65e627c4e002b767fd23a4dd9f16223
This is a follow up of I28076aad00. Moving tests to other package
accidentally missed an important Activity attribute.
Bug: 113800711
Fixes: 119037340
Test: atest WmTests:com.android.server.wm.ScreenDecorWindowTests on
sleeping device.
Change-Id: I8fc2683ad65e627c4e002b767fd23a4dd9f16223
An erroprone build is usually triggered by Presubmit-Ready and built by
TreeHugger. You may see some failures in Presubmit Build Status of the
Gerrit. The error messages contains nice explanations and the links to how
to fix these.
Bug: 113800711
Test: Trigger Presubmit-Ready in TreeHugger and see errorprone build
successfully.
Test: Pass all WM presubmit tests in FrameworksServicesTests and WmTests
$ tradefed.sh run commandAndExit FrameworksServicesTests \
--include-filter com.android.server.wm. \
--include-annotation android.platform.test.annotations.Presubmit \
--exclude-annotation androidx.test.filters.FlakyTest
$ tradefed.sh run commandAndExit WmTests \
--include-filter com.android.server.wm. \
--include-annotation android.platform.test.annotations.Presubmit \
--exclude-annotation androidx.test.filters.FlakyTest
Change-Id: I06c8162d4196346c4e90557e75f29088f5917284
Don't record anything if any of the classloaders in the chain are
unsupported. (This is slightly unsubtle, but matchs the existing
behavior - see below.) We can't correctly DexOpt secondary dex files
in this case anyway.
Also discard any existing records of unsupported classloaders on read.
Currently this is almost a no-op: BaseDexClassLoader doesn't notify if
there are any unknown class loaders, since
5ac512c07cfa80160e240c359349c1390a20a981, so the new check is
reachable only if there's some sort of mismatch. But I'm going to
change that soon.
Tightened up visibility a bit too.
Bug: 111336847
Test: atest --test-mapping services/core/java/com/android/server/pm/dex
Change-Id: I6af5620a73be7b6440cbafdf6a5c1da1082cbdd4
What could go wrong ;)
Note that ATMS and all other activity management files are still under
the AMS lock. We will be changing them soon to use the WMS lock, but
till then it is important to take care not to use the WMS lock for
activities stuff and AMS lock for window stuff.
Test: Existing tests pass
Bug: 80414790
Change-Id: I69f5a6e40ad892557a425e1f34be987507102136
The following com.android.server.am tests has been moved to WmTests by
Idc2dc9e80d, but those should be moved back to FrameworksServicesTests.
- ActivityManagerServiceTest
- ActivityManagerTest
- ActivityManagerInternalTest
- AppErrorDialogTest
- BroadcastRecordTest
- CoreSettingsObserverTest
- GlobalSettingsToPropertiesMapperTest
- MemoryStatUtilTest
- UserControllerTest
Bug: 113800711
Test: Pass all AM presubmit tests in FrameworksServicesTests
$ tradefed.sh run commandAndExit FrameworksServicesTests \
--include-filter com.android.server.am. \
--include-annotation android.platform.test.annotations.Presubmit \
--exclude-annotation androidx.test.filters.FlakyTest
Change-Id: I8852d1a26d7e9d9e52a06fb8ed90d15b6f40bf1c
Use new field WMS.mGlobalLock instead. This will make it easier to
switch the lock to the same object used by ActivityTaskManagerService
in an upcoming CL.
Test: Existing tests pass
Bug: 80414790
Change-Id: I4202e9028395d79cc60b01ed795528b469a16bf1