Adds a new parameter to PictureInPictureParams that
allows activities to explicitly allow the system to
put them in PIP mode without them having to call
enterPictureInPictureMode().
Test: atest PinnedStackTests#testAutoPipAllowedBypassesExplicitEnterPip
Bug: 163048957
Change-Id: Ib6fda0e231408f2756a4e1b9fda08536889a1be5
Mentions that Wifi configurations will be lost if CC mode is
toggled on then off.
Bug: 165050243
Test: build
Change-Id: I991e1d877592e89c8839d3f8280b5d83710a3f4a
the app freezer state can be toggled in multiple situations when a
debugging tool like heapdump is invoked, or when system_server dumps its
binder connections. All these uses are potentially concurrent and a
robust method to handle reentrancy is necessary to avoid leaving the
freezer in a state incompatible with a specific operation.
This patch moves freezer enable and disable operations from Process to
CachedAppOptimizer (ActivityManager), introduces a new ActivityManager API
to centralize all freezer state changes to ActivityManager and modifies
client code accordingly.
Bug: 151225245
Test: manually verified that no regression are introduced on freezer
behavior, verified that concurrent behavior is handled properly
Change-Id: I7d588cc6e0499012dce64ed4e42ff2adb336062d
When exiting PiP to fullscreen, SysUI compares the initial rotation
with the screen rotation and skips the animation if they are different,
with the intention that the app should get back to its state prior to PiP.
This generally works well except that app may request
setRequestedOrientation after entering PiP and the initial rotation
SysUI gets in onTaskAppeared would be obsoleted.
This is fixed in this CL by
- Adding a requestedOrientation field in TaskInfo to pass this
information to SysUI, in both onTaskAppeared and onTaskInfoChanged
callbacks
- Sync with the requested orientation as well as display rotation on PiP
exit. Moves also the information we need into PipWindowConfigurationCompact
Video: http://rcll/aaaaaabFQoRHlzixHdtY/gOPXfx5KO9krmzeor49DgG
Bug: 163218295
Test: See video
Change-Id: Idd0b9412dfdfd6fd293a800cded7c7a6b94cafde
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
This reverts commit d3ed35f3e9.
Reason for revert: Droidcop: Potential culprit for Bug 166391370 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: Ib6007f01fdaf0ef74e8b630e5e13862f30689ef0
We should also allow the activity to be recreated in ON_START state,
since ON_START is also a resting state and we don't see a reason to
prevent applications from doing so.
Bug: 162906202
Test: atest FrameworksMockingCoreTests
atest FrameworksCoreTests
atest WmTests
Change-Id: I20a9c1c25c0b5e1a392b18dc5bac26a1551990e2
Add explicit TEST_MAPPING files for tz detector tests to include them in
presubmit.
Bug: 149014708
Test: treehugger
Change-Id: I2133280072ce1b65ddcfc620fdee91be7fef32f8
Implement user-scoped geolocation configuration / behavior.
The main changes:
1) For simplicity, configuration change listener is no longer passed the
latest config. It is left to the listener to request the latest config.
This removes some of the previous complexity that required a SparseArray
to track listeners by userId.
2) The Callback implementation is now responsible for listening for
configuration / user changes and invoking a listener (which will invoke
other listeners). This is to try to have one class know all the various
settings that affect auto time / geolocation detection behavior, which
has become more complicated with the user-scoped geolocation config. The
TimeZoneDetectorInternal has some listener methods added in preparation
for later steps.
3) The new "geolocation detection enabled" setting is added. This allows
users to selectively disable geolocation time zone detection
independently of the location toggle.
4) The TimeZoneConfiguration now carries the ID of the user it is for,
since it now contains user-specific state.
5) Internally, the TimeZoneConfiguration is replaced by the
ConfigurationInternal class, which includes all properties (not just
user visible settings) that influence time zone behavior on the device.
The ConfigurationInternal generates the TimeZoneCapabilities and
TimeZoneConfiguration.
6) In a change from the initial behavior, any previously received
geolocation suggestion is cleared if geolocation detection is turned
off (or the current user switches to one that has it turned off), and
suggestions received when geolocation detection is off are ignored.
This is trying to be careful to avoid caching the geolocation timezone
if the user has signalled they don't want their device to use it.
Test: atest services/tests/servicestests/src/com/android/server/timezonedetector
Test: atest core/tests/coretests/src/android/app/timezonedetector
Bug: 149014708
Change-Id: Ieac9f8f646e16edcb8b6ea6c8749e45761898ac1
1. Scope dowm synchronized block to mAdjustedDisplays put and get
2. Use SoftReference instead of WeakReference because
display's weak reference is cleared after getAdjustedDisplay
returned and the cache didn't take effects previously.
fixes: 162445376
Test: ResourcesManagerPerfTest
Before:
getDisplayMetrics_median: 3413
getDisplayMetrics_mean: 3439
getDisplayMetrics_min: 3364
getDisplayMetrics_standardDeviation: 107
After:
getDisplayMetrics_median: 3048
getDisplayMetrics_mean: 3096
getDisplayMetrics_min: 2999
getDisplayMetrics_standardDeviation: 134
Change-Id: I8a5c3ba960c8231aee78b0e7fb958bf6845d5bb5
Before InputMethodService initializes, InputMethodService#getDisplay
will throw UnsupportedOperationException because it doesn't attach to
any display. However, it may make developers confuse about why
throwing exception for an UI context. This CL workarounds to also
check isUiContext flags to make the result of IMS#getDisplay consistent.
It should be considered to remove after IMS migrate to WindowContext
concept.
fixes: 161964893
Test: atest InputMethodServiceTest#testGetDisplayBeforeInitialization
Change-Id: Ie0bda707f0196b45a8851f645da7ecab6814bed6
When user dismiss pip, WindowOrganizerController#applyChanges would
first try to resize pinned task, this will cause the activity to do
ensureActivityConfiguration and which could trigger configuration
change or relaunch the client activity. However, the windowing mode was
not change yet, so the windowing mode change would be scheduled in
another configuration change to client. But since the windowing mode
is not public, client will treat there is difference so skip that
configuration. To ensure client receive windowing mode change, check it
before check configuration difference.
And in order to prevent the WindowState#reportResized send before
ActivityRelaunchItem send to client, skip resize if we already know
that activity is going to relaunch.
Bug: 165051679
Test: atest ActivityLifecyclePipTests ActivityLifecycleSplitScreenTests
ActivityLifecycleTopResumedStateTests PinnedStackTests SplitScreenTests
ActivityLifecycleKeyguardTests
Change-Id: I7b96bbcf1a71ff75751e14db44c03261862bc857
This change migrates the previous usages of
ResourcesManager#getResources() from using the display id of expected
resources to an override display ID which will override the display
properties from the parent token resources. This ensures that all
contexts derived from a display context keep the overrides for their
intended display.
This also changes the meaning of ResourcesKey#mOverrideConfiguration and
ResourcesKey#mDisplayId. Previously mDisplayId was used as both the
current display of the ResourcesKey and used to apply overrides
to mOverrideConfiguration. This made it unclear whether a particular key
should keep its display override when an activity changes display or
whether it should inherit the new display from the activity. Now the
display IDs and overrides are managed by the ActivityResources struct and the
ResourcesKey is expected to only contain the final display ID expected
for the resources in 'mDisplayId' and the final configuration that should
be applied to the global configuration in 'mOverrideConfiguration'.
Fixes: 153866583
Fixes: 156758475
Fixes: 163813210
Fixes: 163812902
Fixes: 163813227
Test: ActivityThreadTest
Test: ResourcesManagerTest
Test: AppConfigurationTests#testActivityContextDerivedDisplayContextOrientationWhenRotating
Change-Id: If93f98f93ee15b27d8c7292a2f830c2cc0f49277
LoadedApk.updateApplicationInfo can call getResources while holding the
ResourcesManager lock. Remove the wtf and replace it wuth a debug
warning.
Bug: 165367316
Change-Id: I734688edd4e1d218fd0e2438b47ee05e477aa79f
Test: presubmit
The package verifier performs some system critical work that the user
doesn't need to be explicitly aware of. This adds a mechanism for the
verifier to indicate which foreground service notifications should be
hidden, if possible.
Bug: 164440539
Test: use test app to confirm requested fgs notifications are hidden
Change-Id: Ib3eb0b71cc676c145557ade9def98a363e5abebb