Revert "Tests for non-config instance map"
Revert submission 11077952-non-config-map
Reason for revert: API council would like to go straight to Jetpack
Reverted Changes:
Ib2484d433:Add Activity non-config instance map-like API
Ibc3daf82f:Tests for non-config instance map
Bug: 155401916
Change-Id: I9dd8226375e86d66b8cef3731642c0cf9f74434c
This re-deprecates the single instance non-config instance API. Previously this was deprecated in favor of retained fragments. It was then undeprecated and platform fragments were deprecated (although those two events were not related).
The problem here is that there needs to be a composable mechanism of retaining non-config instances for libraries to use.
This is evidenced in Activity.java itself which already emulates a map internal by using a type and named fields.
The Jetpack library (nee support library) has historically needed this as well, and has been forced to resort to marking the single non-config instance API as final, exposing a differently-named overload, and then coalescing everything into a single type with named fields, just like Activity.java.
This change adds a class-keyed map-like API so that anyone can hook in without being directly in the activity subtype hierarchy.
Unlike the single non-config instance API, the map-like API has a few different behaviors:
- You can store an instance into the map anytime between onCreate and onDestroy (including inside those two lifecycle methods). The old API had a dedicated callback. You can use isChangingConfiguration() in onDestroy to conditionally create the retained instance.
- Stored instances are available for the entire lifetime of the activity instance. The old API cleared the non-config object in onResume.
- By virtue of the previous behavior, instances are retained across multiple config changes without having to re-create the state.
While behaviorally different from the old API, this is more in line with the behavior of retained fragments or non-framework solutions like Jetpack fragments and view models.
A compatibility shim for this in Jetpack will be added.
Bug: 152476567
Test: atest ActivityNonConfigInstanceTest
Change-Id: Ib2484d43327dd52e9cceac1f7201a5b4f694f7bb
Previously, window token assigns last config to mLastReportedConfiguration
directly, which makes it share the same reference with getConfiguration(),
and blocks all config changes request to clients.
This CL uses Configuration#setTo instead.
fixes: 152227175
Bug: 150251036
Test: atest WindowContextTests
Change-Id: I44143aa558f223eb301e28f2e9110bfd66eac636
- This removes the need for a separate task stack listener and aligns
with other task info change properties
- Also implement equals/hashCode for the token so we can use it in
containers
Bug: 148977538
Test: atest TaskOrganizerTests
Signed-off-by: Winson Chung <winsonc@google.com>
Change-Id: Ie035e6389fdbdc374c1a4b4a684758efa0cb7a9e
The bundle fields may contain custom Parcelables. And Bundle#size
will call unparcel that causes BadParcelableException from
LaunchActivityItem#hashCode and LaunchActivityItem#equals.
Since the bundle fields of LaunchActivityItem may not be significant
for being the accurate identity of the item, the bundle fields can
be treated roughly (empty or not) to avoid unparceling.
Fixes: 153737846
Test: atest FrameworksCoreTests:TransactionParcelTests#testLaunch
Change-Id: I7ec55bbfcffcd47cfb586ede8053ab411891902d
This will allow us to do all/selected/none preferences for
bubbles in settings.
- Feature is on by default
- App is none by default
- Channel is off by default
Test: atest NotificationManagerServiceTest BubbleExtractorTest
Bug: 138116133
Change-Id: Ifad1c22525123354f76959c2d44392a25d56347d
* accountTypesWithManagementDisabled
* disableScreenCapture
For security logging nothing has to be done since the state is
stored in a system property, just changed it so that the logging
will be started after the migration and only events for the
right user are logged.
Also removed the todo about hardening for power cut case, the
risk of additional complexity sees to outweight the benefit.
Bug: 149075700
Test: atest DevicePolicyManagerServiceMigrationTest
Change-Id: I3a58325f2d6f415e51998c5096c5fc123d26602d