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
As discussed on b/163039465#comment3, it's not desirable to have two
distinct catch-all error bucket, where the difference is very subtle.
Opting to use STAGED_SESSION_CONFLICT which is more specific, but not
too specific. We can use this error is any scenarios where a staged
session interferes with installation of another staged session and
we have to fail one of them, e.g a staged session is blocking a
rollback or rollback will be causing API downgrade which will break
another staged session (b/163734200).
Bug: 163039465
Test: atest atest RollbackManagerHostTest#testRollbackFailsBlockingSessions
Test: atest StagedInstallTest
Change-Id: Ia05350024093cd537e8ced5ea02af5853620d6ef
Actually acquire the monitor it claims to be guarded by. Since it was a
final field, it's still not entirely clear what that means.
Clear mNativePtr when we deallocate its referent. This prevents native
heap corruption if methods here are called from another finalizer.
Remove mOpen and use mNativePtr instead.
This probably does not fix the bug below. But let's get rid of the
possible heap corruption source we know about.
Bug: 159041693
Test: Build and boot
Change-Id: I6f0f6250ca8b6a4274c346ae99f1f94cab5844e1
Some functions were trying to get the UserHandle of a userId,
but were instead treating the userId as a uid, and thereby
getting the wrong UserHandle.
Bug: 162543841
Test: atest com.android.internal.app.ChooserActivityTest
Test: atest com.android.internal.app.ResolverActivityTest
Test: atest ScreenshotNotificationSmartActionsTest
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: Ib977267e3bae0aa3c7b6b31cfe8f0b3f9cc884b1
Exempted bucket state was leaking post uninstall in a way that would
persist till the next install of the same package.
Also cleaning up defunct entries from other lists.
Clarified bucket state to always use exempted instead of exempt in
code.
Test: atest FrameworksMockingServicesTests:AppStateTrackerTest
Manual:
1. Install an app and put it under battery restriction
2. Install an app and put it on the power exemption list
3. Uninstall both of the apps
4. They should not appear under 'Exempted' or 'Restricted' packages list
in `adb shell dumpsys alarm`
Bug: 162763690
Bug: 156868557
Change-Id: I710edbb85d811ea0beced3b59fe89f59bcec6dd8
Bug: 162103383
Update 'dumpsys cacheinfo': add the number times a cache is cleared,
rename misses due to cache disabled/unset/corked to "skips", and fix the
logic counting cache invalidates.
Make the cache name distinct from the property. There is no change to
legacy caches (which continue to use the property as the name) but
caches that share the cache_key.package_info property now have distinct
names.
Add the property name to auto-corker debug messages.
Test: Boot and run 'dumpsys cacheinfo' to verify the output.
Change-Id: I3e3e500dc9a1559fd7ccdc49fb00292ab5f712c1
This @hide API allows the settings to retrieve and remove recent cached
conversations from people service.
Bug: 162593584
Test: test on device
Change-Id: I176d87a0fb1ca3ebcc24bdb1cebcb6d8f4c9bb53