In PWM, use the specific WindowState's WindowFrame to
update the frame instead of using the global object in PWM
and passing it to WindowState
Test: go/wm-smoke
Bug: 111359087
Change-Id: I9c215bf2113f0ae5c89654a58ef93e7ed7620e84
Adds various changes to PowerManagerService to support mocking out
various managers and methods.
Adds a simple goToSleep() API test that verified it went to sleep.
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
Change-Id: Iae8d6fcec05c3fc8a48ed5808d6813f1fdd7c7ca
Seen in on devices with work profiles.
- Only bind the the current started user(s)
- Wrap applyEnqueuedAdjustmentFromAssistant with a try/catch
since assistant services cannot recover from it on their own.
Additionally, while debugging this rebindServices hurt my brain,
so I've split it up a bit and added comments and tests.
Test: runtest systemui-notification, device restart and log queries
Bug: 113296846
Change-Id: I19b9044ff87712f9ef5401457217156ea9fb9f1f
Fix two conditions:
- If the reused activity is in the top focused stack, it is unable
to reparent to preferred display because top task is the same as
reused task.
- If the reused activity is in preferred display, it is unnecessary
to get launch stack that may produce a dangling stack.
Also make TestActivityDisplay support real multiple display.
Originally it gets display from DisplayManager which restricts
to use default display only.
Bug: b/115277654
Test: atest FrameworksServicesTests:ActivityStarterTests# \
testDeliverIntentToTopActivityOfNonTopDisplay
Test: atest FrameworksServicesTests:ActivityStarterTests# \
testReparentTopFocusedActivityToSecondaryDisplay
Change-Id: Id24c235a8a4ffab2917d46fc287413f9bf28c58d
Notifications sent from suspended apps were being preemptively
blocked by isBlocked in NotificationMangerService. Instead, isBlocked
should only block notifications the user has specified to block. This
should not include suspended packages. (Notifications sent from
suspended apps are marked as hidden/suspended in the RankingMap in
PostNotificationRunnable so they can be resurfaced when the sending
app is unsuspended.)
Change-Id: I377eec04c9636e800bcd2709984c19610f2c524e
Bug: 113100262
Test: atest cts/tests/app/src/android/app/cts/NotificationManagerTest.java
Test: runtest -x cts/tests/tests/notificationlegacy/src/android/app/notification/legacy/cts/LegacyNotificationManagerTest.java
Test: runtest -x frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
Install will be broken up into four phases:
1) Prepare - Analyzes any current install state, parses the package and
does initial validation on it.
2) Scan - Interrogates the parsed packages given the context collected
in prepare.
3) Reconcile - Validates scanned packages in the context of each other
and the current system state to ensure that the install will be
successful. Any failures to reconcile will fail the install.
4) Commit - Commits all scanned packages and updates system state. This
is the only place that system state may be modified in the install flow
and all predictable errors must be determined before this phase.
This change moves most low hanging fruit out of prepare and into one of
the phase that most makes sense to own it.
Bug: 109941548
Test: manual - install a few dozen apps from Play Store
Test: manual - install update to GMS Core
Change-Id: Ibd4acc15996d8621d16e1f94d0d5c07826f66e3d
- Remove @BeforeClass `Looper.prepare()` that do not work with atest
- Fix TouchExplorerTest: mock AccessibilityGestureDetector to not create
internal handler.
- Fix broken tests in MagnificationControllerTest
- Remove @FlakyTest annotation from MagnificationControllerTest &
FingerprintGestureControllerTest
When using atest, timeout is applied to command `am instrument`. Then
@BeforeClass & @Before are both running on instrument thread, but test
cases are running on a seperate thread. It dispatch messages immediately
if the looper is associated to the same thread. When runniung tests with
atest, dispatching the message is not always done in the same thread. So
verifying the expectation on test thread would be flaky.
The solution to use a looper associated with test thread would be ugly.
Because the looper related stuff should set up without @Before or
@BeforeClass including preparing a looper on demand in a utility
function for every test case needed.
Here changing the handler behavior to enqueue but to dispatch messages
explictly from test could serialize the execution. This would use main
looper (no need to prepare) to create handler, but dispatch and clear
messages ourself. Not good enough but less ugly to run `am instrument`
with or without timeout.
Bug: 74748946
Test: atest -d FrameworksServicesTests:com.android.server.accessibility
Test: adb shell am instrument -w -e package com.android.server.accessibility \
com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
Change-Id: Ib67d8b7305511d218b23f4b5ab0b0a12bea9ae10
When moving a stack to top including its parent (display),
if the target position is adjusted to non-top because there
is other always-on-top stack in this container, the display
should also be moved to top for higher focus priority.
Z-order
Top |----------------|
Display 1 | [Normal stack] |
|----------------|
|----------------|
Display 0 | [Pinned stack] |
| [Normal stack] | <- Moving task in here
Bottom |----------------|
Bug: 113099160
Test: atest TaskStackContainersTests#testDisplayPositionWithPinnedStack
Change-Id: I877fd2acddeeb6d68fe6f4336dd202b9db11d94e
When launching a non-resizeable activity to different display,
check if the new configuration should update to activities and
notify systemui to show a toast activity with message "App may
not work on a secondary display".
Bug: 112288258
Bug: 112963441
Test: atest ActivityManagerMultiDisplayTests
Test: atest FrameworksServicesTests:ActivityRecordTests
Change-Id: If86bb8593ecca382074583e6bb998fcba1ee96aa
Don't tell listeners about changes to enqueued notifications;
they'll pick up the changes in the post notification runnable.
Change-Id: I56c4ba79bcf42c30ad9a0da936eb0b774a6f3f08
Fixes: 74236718
Test: runtest systemui-notification
1) Moving WMS.setInputMethodWindowLocked to DisplayContent,
each display can have its own IME window.
2) Add getDisplayIdFromWindow in WindowManagerInternal,
used for InputMethodManagerService to know which display
for given IME window token.
3) Support add / remove IME window according displayId.
4) Modify WMS.inputMethodClientHasFocus to traverse all active display
if inputMethodClient focused.
5) Add displayId parameter for IInputMethod.initializeInternal to
update context display then client can addView to right display.
Note: 1) There should be zero behavior difference as long as the target
app is running on the default display.
2) The current implementation is not final and there are still
chances that the current IME may not work well or even crash
depending on how the IME is implemented.
Bug: 111364446
Test: manual, use ActivityView & launch Messages in VirtualDisplay,
tap search icon to see if soft input keyboard shown &
app window size is adjusted by soft input.
Change-Id: I8da315936caebdc8b2c16cff4e24192c06743251
Short summary:
There is no need to have these 3 utility classes in frameworks.jar,
because these classes are used only from InputMethodManagerService
(IMMS) and its utility classes. We should move them to services.jar.
Long summary:
* InputMethodSubtypeSwitchingController
This class was mistakenly placed in the current Java package since its
beginning [1]. This class is purely a state machine that is designed
to be used only from IMMS hence there has been no way for app
processes to use this class in a meaningful way.
* LocaleUtils
This class was also mistakenly placed in the current Java package
since its beginning [2]. This class is purely a state machine that is
designed to be used only from IMMS hence there has been no way for app
processes to use this class in a meaningful way.
* InputMethodUtils
The situation of InputMethodUtils is a bit different. It was
introduced in the right place actually [3], because the original
purpose of this class was to share some utility methods between IMMS
and the Settings application. For that purpose, having this class
under frameworks/base/core/java instead of frameworks/base/services/
totally made sense.
What was unfortunate is that we have kept adding more and more utility
methods into InputMethodUtils since then, even though most of methods
have been used only from IMMS. To make things worse, more and more
random components started depending on this utility class. When we
realized it, we were in the situation where we could not even easily
refactor methods in InputMethodUtils without updating a bunch of
call-sites across repositories, including multiple platform-specific
Settings app and SetupWizards.
This is basically why I decided to stop allowing Settings apps and
SetupWizard to use InputMethodUtils, and decided to let them depend on
SettingsLib [4] instead. After many cleanup CLs [5], we have finally
achieved the state where InputMethodUtils is used only from the system
server process.
* A special bonus
With my previous CL [6], we can even make these 3 utility classes
package-private, which guarantees that only IMMS and its utility
classes directly depends on these utility classes.
* Risk
Now that this is purely a mechanical refactoring of an implementation
detail within frameworks/base, there should be no observable behavior
difference.
[1]: I11ed9a767588f8080753cd9bce011dac7db579ad
d7443c83ce
[2]: I315cf3722a06e00bdbfac284c4949578da8fe78d
102ff0726d
[3]: I0bc9954f163a3ec38d08b9ba842a8a31176eb6a6
8e303cc5dd
[4]: frameworks/base/packages/SettingsLib
[5]: CLs that have Bug 77730201 in their commit messages
[6]: I023d8f2863601ee54f304988117d8ea750770f70
603f4d00c6
Bug: 77730201
Bug: 114660660
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:com.android.internal.inputmethod
Test: atest FrameworksServicesTests:com.android.server.inputmethod
Change-Id: I37594096151d77adb6741a41d7985a4506f96ccb
When I needed to introduced a new helper method for
TextServicesManagerService (TSMS) to fix Bug 22042994 [2] I was just
lazy and decided to put it into InputMethodUtils instead of creating a
new utility class for TSMS.
Now that InputMethodUtils is going to be moved to
com.android.server.inputmethod as a package-private utility class, it
is time to pay off my laziness.
With this CL, getSuitableLocalesForSpellChecker() will be extracted
out from InputMethodUtils to a new package-private utility class
com.android.server.textservices.
This is purely a mechanical refactoring. There should be no
observable behavior difference.
[1]: I094f1c33430f7904a1dac6167431d6df64a07212
174843afb6
Bug: 77730201
Bug: 114660660
Bug: 115516399
Test: atest FrameworksCoreTests:com.android.internal.inputmethod
Test: atest FrameworksServicesTests:com.android.server.textservices
Change-Id: If6cd051aa0ae7780631d5bec5b7d01faac4a83a0
This class should have lived in services.jar. When I introduced
LazyIntToIntMap [1] to re-enable cross-profile use of spell checker
APIs, I unnecessarily put this class in frameworks.jar despite the
fact that this utility class is used only in the system server
process.
This CL also makes this utility class package-private so that other
component will not accidentaly depend on it.
This is purely a mechanical refactoring. There should be no
observable behavior difference.
[1]: Ic046f832f203115106409a53418a5746eb6d4939
3f8c568883
Bug: 115516399
Test: atest FrameworksServicesTests:com.android.server.textservices
Change-Id: I9390ba11687e1db66d02fe1cdfb9ed59adde3768
Right now, NPMS listens for all the procstate changes. This will slows
down processing of procstate changes which actually matter and also
fills up the netpolicy history pretty quick.
Bug: 112485285
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Test: atest services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
Change-Id: Iaaef8ea4ee16f5b69cafc1e7e5908c6ff6fe1ed3
Tidy up constructor that was hidden rather than removed
to allow pre-release versions of zebedee to work.
Test: atest BrightnessMappingStrategyTest
Test: atest android.display.cts.BrightnessTest
Test: atest BrightnessConfigurationTest
Change-Id: I89989d426ba84232843ddd45f614b837d47086a6
Create ActivityStacks with UNDEFINED override by default.
Added "memory" of previous override mode during transient modes
(split-screen/pip) and restore that instead of hard-coding
fullscreen upon leaving one of those modes.
Added override mode to containers dump output.
Bug: 113900640
Test: go/wm-smoke
relevant com.android.server.am tests (ActivityStack, TaskRecord,
ActivityStarter, ActivityRecord, ActivityManagerService).
Added test to explicitly check override mode.
Change-Id: I4ab51b4b14604b4953fdab6632cb507b8a39d45a
This will allow apps to delegate posting to persistently
running apps, to decrease the numbers of times apps need to wake up
just to post a notification.
Bug: 111452544
Test: runtest systemui-notification
Change-Id: I1ead239747f2871f222d0ce6a971d1448a0766ad
Use showWhenLocked attribute to prevent TestActivity goes to
Paused/Stopped.
Bug:111708089
Test: atest FrameworksServicesTests:com.android.server.wm.ScreenDecorWindowTests
Change-Id: I3ae1963f376caa3fba6c3694b8265bedb55e54b4
The test utility classes under com.android.server.testutils are moved
to servicestests/utils directory in order to easily be shared between
FrameworksServiceTests and upcomming WmTests.
Test: tradefed.sh runAndExitTest FrameworksServicesTests \
--include-annotation android.platform.test.annotations.Presubmit \
--exclude-annotation androidx.test.filters.FlakyTest
Bug: 113800711
Change-Id: I39c623a286df1067fffadc25c8a49c12cc05c82c
Injecting and mocking dependencies to make the service unit testable.
Shuffled around initialization to make that possible.
Also added the first batch of unit tests. The idea is to have extensive
coverage of minute pieces of alarm manager logic, which should help us
catch any regressions caused by future changes to the code.
Test: atest com.android.server.AlarmManagerServiceTest
atest CtsAlarmManagerTestCases
Bug: 111454659
Change-Id: Ifa1c09646f688cf5c41abe17d98dbc19978eac70