Commit Graph

9706 Commits

Author SHA1 Message Date
Darryl Johnson
48f430566d Merge "Don't override config of display contexts with activity display." 2020-08-20 21:47:53 +00:00
Darryl L Johnson
3c0078e80f Don't override config of display contexts with activity display.
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
2020-08-20 10:15:48 -07:00
TreeHugger Robot
739663d450 Merge "Replace redundant error code with a specific one" 2020-08-20 12:59:20 +00:00
Mohammad Samiul Islam
4292708d0e Replace redundant error code with a specific one
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
2020-08-19 11:11:03 +01:00
Hans Boehm
4f93042048 Merge "Fix ApkAssets mNativePtr accesses" 2020-08-18 04:41:53 +00:00
Hans Boehm
3d49ac4660 Fix ApkAssets mNativePtr accesses
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
2020-08-17 18:32:31 -07:00
Jackal Guo
2c3f50ce8c Merge "Update language to comply with Android's inclusive language guidance" am: 0090d82f18 am: c3972b8d97 am: 460fc577c9 am: c6564bee2a am: 5666ed9b0d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398286

Change-Id: I7c1d365f123d6ac7dfe410da3593af716817aa58
2020-08-17 02:04:55 +00:00
Jackal Guo
5666ed9b0d Merge "Update language to comply with Android's inclusive language guidance" am: 0090d82f18 am: c3972b8d97 am: 460fc577c9 am: c6564bee2a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398286

Change-Id: Idbf4ff204c708c80dadc421d50934e9a041b0378
2020-08-17 01:52:11 +00:00
Jackal Guo
c6564bee2a Merge "Update language to comply with Android's inclusive language guidance" am: 0090d82f18 am: c3972b8d97 am: 460fc577c9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398286

Change-Id: Ia18cae33d2efc71f61c1a2a37b25a1fb2147ccfb
2020-08-17 01:43:16 +00:00
Jackal Guo
460fc577c9 Merge "Update language to comply with Android's inclusive language guidance" am: 0090d82f18 am: c3972b8d97
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398286

Change-Id: Iefb939a07702b1aecfab75a03decf85ab6b55b50
2020-08-17 01:30:51 +00:00
TreeHugger Robot
e00c072047 Merge "Fix confusion of userId vs. uid" 2020-08-14 22:50:55 +00:00
TreeHugger Robot
31e35a2614 Merge "Clean up AppStateTracker state on package removed" 2020-08-14 20:32:48 +00:00
Adam Bookatz
78d63ac323 Fix confusion of userId vs. uid
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
2020-08-14 12:15:12 -07:00
Jordan Jozwiak
3eff9e429f Merge "Allow usage of constant in tests" 2020-08-14 15:55:09 +00:00
Jackal Guo
008df2af16 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 163975639
Test: m docs
Change-Id: Id2af5961bc016d886f25c1f1fa989e6da1d1f44a
2020-08-14 09:15:49 +00:00
Suprabh Shukla
a8ddb7537d Clean up AppStateTracker state on package removed
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
2020-08-13 15:27:13 -07:00
Jordan Jozwiak
142fe6a544 Allow usage of constant in tests
Bug: 146674351
Test: atest com.google.android.permission.gts.DefaultPermissionGrantPolicyTest
Change-Id: I5aa11cedf9b9fe7c409c4b034fe64ffc963985cd
2020-08-11 12:26:15 -07:00
TreeHugger Robot
563598ce6b Merge "fix typo in LocusId" 2020-08-09 05:23:01 +00:00
Pinyao Ting
ae36f5605a fix typo in LocusId
Bug: 163170939
Test: manual
Change-Id: I2e436ebec4931f5c038cd9f10cc5bb0c2a0c39a6
2020-08-08 10:47:46 -07:00
Ryan Mitchell
dc9c803334 Merge "Make resources APIs visible for synthetic bench" 2020-08-07 22:53:48 +00:00
Danning Chen
043d76d29e Merge "Add @hide people service API to access the recent conversations" 2020-08-06 17:09:38 +00:00
Lee Shombert
e87193a896 Merge "Enhance PropertyInvalidatedCache debugging" 2020-08-06 15:41:48 +00:00
Lee Shombert
f168f2737e Enhance PropertyInvalidatedCache debugging
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
2020-08-05 15:52:25 -07:00
Mohammad Samiul Islam
a5bf2d2557 Merge changes from topic "unblock-rollback"
* changes:
  Fail blocking staged session when rollback is committed
  Cleanup how we handle abort of active apex session
2020-08-05 16:55:20 +00:00
Louis Chang
f7b0d0e04e Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference.

Bug: 162536543
Test: Treehugger
Change-Id: I6dac60aac172a8fccf4b5671107b41c5c84ccd76
2020-08-05 09:03:47 +08:00
Mohammad Samiul Islam
8f05043523 Fail blocking staged session when rollback is committed
Bug: 162294757
Test: atest RollbackManagerHostTest#testRollbackFailsBlockingSessions
Test: atest StagedInstallTest
Change-Id: Ia496e4ceb3db61e08875b2b6b060c91a966a5d53
2020-08-04 21:49:56 +01:00
Ryan Mitchell
327747f240 Make resources APIs visible for synthetic bench
Bug: 162347228
Test: atest ResourcesPerfWorkloads
Change-Id: I02ce8dfbd3569311bb1b716d6129e6d9605a1869
2020-08-04 09:58:25 -07:00
TreeHugger Robot
986681192e Merge "Don't clone the locale redundantly in Configuration.setTo()" into rvc-qpr-dev am: 786165bae0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12152573

Change-Id: Ia37b90f198ce8ca923ff5a1909d08225d2e30d35
2020-08-03 19:07:19 +00:00
TreeHugger Robot
786165bae0 Merge "Don't clone the locale redundantly in Configuration.setTo()" into rvc-qpr-dev 2020-08-03 18:42:10 +00:00
Charles Chen
1a364965ee Merge "Annotating context in framework base" 2020-08-03 06:13:18 +00:00
Charles Chen
6591174401 Annotating context in framework base
Bug: 151414704
Test: build & run
Change-Id: I42c8ab699433c51158a1af201da0521413d74dcd
2020-08-03 11:36:54 +08:00
Danning Chen
144e6b344c Add @hide people service API to access the recent conversations
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
2020-07-31 14:28:10 -07:00
Treehugger Robot
913e68c98e Merge "Update language to comply with Android's inclusive language guidance" am: ea575e7bc4 am: 0166574738 am: fd6b8e0da4 am: 49fc83bc70 am: ff52668ab5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382385

Change-Id: I22eba96019cc044949486a7447cd98808bb03c7d
2020-07-31 15:41:23 +00:00
Lais Andrade
49a6652b9c Merge "Update language to comply with Android's inclusive language guidance" am: cb51202601 am: 6c6e238f23 am: 40bdc0c86f am: d2ce0e0f17 am: 5e4cbeea29
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382537

Change-Id: I97bd8e5c53babf73fb48aba24d4057ed0281efea
2020-07-31 15:39:58 +00:00
Treehugger Robot
49fc83bc70 Merge "Update language to comply with Android's inclusive language guidance" am: ea575e7bc4 am: 0166574738 am: fd6b8e0da4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382385

Change-Id: I784c5050682c23e64796689caed846e0952bfed5
2020-07-31 15:08:28 +00:00
Lais Andrade
d2ce0e0f17 Merge "Update language to comply with Android's inclusive language guidance" am: cb51202601 am: 6c6e238f23 am: 40bdc0c86f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382537

Change-Id: Iad19e0977aab66758c01a3b8448a8f432fa92d89
2020-07-31 15:07:19 +00:00
Treehugger Robot
fd6b8e0da4 Merge "Update language to comply with Android's inclusive language guidance" am: ea575e7bc4 am: 0166574738
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382385

Change-Id: I2367b78e9b80b2ffe284cc18adf07e29925656a8
2020-07-31 14:47:01 +00:00
Lais Andrade
40bdc0c86f Merge "Update language to comply with Android's inclusive language guidance" am: cb51202601 am: 6c6e238f23
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382537

Change-Id: I19ef5e99506ffbb2b7dcb79f72fae92161b77f8b
2020-07-31 14:46:24 +00:00
Treehugger Robot
ea575e7bc4 Merge "Update language to comply with Android's inclusive language guidance" 2020-07-31 14:12:37 +00:00
Lais Andrade
d877fa3317 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

#inclusivefixit

BUG=162536543

Change-Id: I8059d138ed476e89c7b796f0b1ad002692987a6f
2020-07-31 12:39:40 +00:00
Lais Andrade
d3797976d8 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

#inclusivefixit

BUG=162536543

Change-Id: I0ff4f00b9251789820023f25623f3bb9f8a437af
2020-07-31 11:12:40 +00:00
Treehugger Robot
a74eacc243 Merge "Update language to comply with Android's inclusive language guidance" am: f8ca47966f am: 26d3e569db am: 2863f04c43 am: 94cdb39dbb am: 9729aa4f7b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374759

Change-Id: I5a7b95f561848cd80b22c502113dc49ced3f646a
2020-07-31 01:03:10 +00:00
Treehugger Robot
2d74d069d8 Merge "Update language to comply with Android's inclusive language guidance" am: 18e37909f3 am: 2009a6f05e am: fee9000990 am: 180266434e am: c38049f901
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374877

Change-Id: Iae2368dff7f55c6e380e35fc2471cef06a9a4538
2020-07-31 01:02:52 +00:00
Treehugger Robot
ace1462bee Merge "Update language to comply with Android's inclusive language guidance" am: df9c0ce0d6 am: 9d5f5e2a5e am: 0cc93e30c4 am: 5b3c38fa33 am: c0e359ff2c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374899

Change-Id: I533aec13284eb989d516fc77c14cf38ab3a7027d
2020-07-31 01:02:36 +00:00
Treehugger Robot
cc81761945 Merge "Update language to comply with Android's inclusive language guidance" am: 0b7e8cc6bc am: b5cf67da5a am: 66ea204537 am: c30e10ff21 am: ac9b44031d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1375856

Change-Id: Ib47f8d0387bbe97b15d8bd8dfef58ed2d3c5c802
2020-07-31 01:02:13 +00:00
Treehugger Robot
9729aa4f7b Merge "Update language to comply with Android's inclusive language guidance" am: f8ca47966f am: 26d3e569db am: 2863f04c43 am: 94cdb39dbb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374759

Change-Id: Ia34928d6533474ad4f000f1b3a5300a8af06fdff
2020-07-31 00:23:28 +00:00
Treehugger Robot
c38049f901 Merge "Update language to comply with Android's inclusive language guidance" am: 18e37909f3 am: 2009a6f05e am: fee9000990 am: 180266434e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374877

Change-Id: I78607daa5e4a2a7860699ab4eee32b8d732d564f
2020-07-31 00:23:16 +00:00
Treehugger Robot
c0e359ff2c Merge "Update language to comply with Android's inclusive language guidance" am: df9c0ce0d6 am: 9d5f5e2a5e am: 0cc93e30c4 am: 5b3c38fa33
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374899

Change-Id: I75eeaaa6b5a5f6a68d64fbbb63f8be2240be4081
2020-07-31 00:23:05 +00:00
Treehugger Robot
ac9b44031d Merge "Update language to comply with Android's inclusive language guidance" am: 0b7e8cc6bc am: b5cf67da5a am: 66ea204537 am: c30e10ff21
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1375856

Change-Id: Ic8b8cd406972720b658b616f0989c731a282b5ca
2020-07-31 00:22:52 +00:00
Jackal Guo
6893cb04b7 Correct protectionToString am: 379eb5c25f am: 53bed2c790
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265005

Change-Id: If7ff60e57fc63180b1f4c1ef0505b2c902be8650
2020-07-30 09:24:49 +00:00