summaryrefslogtreecommitdiff
path: root/core/java/android/util/MergedConfiguration.java
Commit message (Collapse)AuthorAgeFilesLines
* Optimize the Parcel read/write of common window dataRiddle Hsu2021-02-241-9/+9
| | | | | | | | | | | | | | | | The Parcel read/write speed of MergedConfiguration/InsetsSource becomes 4x+ faster. Because writeParcelable sends additional type info which is unnecessary if the type is known on the reading side, replace the usages to writeTypedObject and well-written readFromParcel. That saves the time of class lookup and object creation. Bug: 181025587 Test: vogar --mode app_process --benchmark \ frameworks/base/core/tests/benchmarks/src/android/os/ParcelableBenchmark.java Change-Id: I29548ce6c2e5886f0e90a5dc70d8e9ecc0fb25a8
* Add @Nullable annotation to the parameter of Object.equals() methods.Roman Kalukiewicz2020-10-151-1/+2
| | | | | | | | | | | | | | | | | | Those annotations could be inferred by some tools (like Kotlin), but the https://checkerframework.org/ doesn't check inherited annotations complaining about all equals() invocations that get nullable argument. The change was generated by running find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /' in the frameworks/base directory and by automatically adding and formatting required imports if needed. No manual edits. Bug: 170883422 Test: Annotation change only. Should have not impact. Exempt-From-Owner-Approval: Mechanical change not specific to any component. Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Always send configuration to client from resize and relayout.Bryce Lee2017-06-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the server side would omit reporting new configurations during resize and relayout if the current configuration matched the last reported. However, if the last reported came through a resize, the client side handling would be enqueued as a Handler message. This leads to the possibility of the client getting a new window frame but not a new configuration where this is synchronously handled, such as ViewRootImpl::performTraversals. To address this issue, we now always send the current configuration from the server to the client. The client then identifies changes against its own record of last reported configuration and updates as appropriate. This changelist also adds a call to force window relayout during updateConfiguration, as it's possible this is called after performTraversals is called or resize is handled, leading to a stale window frame. Bug: 24671393 Test: go/wm-smoke Test: Open Camera while rotating phone to landscape. Added temporary logs to detect inconsistencies between measurements and reported rotation on draw. Change-Id: I0d5143dfe80400f6a43ce710750f9fc9d4b93f74
* Switch ActivityRecord last reported config. to MergeConfigurationWale Ogunwale2017-04-251-0/+46
| | | | | | | | | Clean-up before actual fix for b/36897968 that makes the code easier to follow. Test: Existing tests pass Bug: 36897968 Change-Id: I3039548929440f922dc69d7f130169a3d60b1eef
* Separate global and override config sent to clientAndrii Kulian2017-03-161-0/+122
There is some flakiness in View#onConfigurationChanged callback - if ViewRootImpl receives config update earlier than ActivityThread, it may not detect the configuration change and skip inner updates. Also now ViewRootImpl assumes that it receives the global config as a param, but instead it gets merged config from WM. This means that ViewRootImpl#sConfigCallbacks was sending incorrect values to the recipients. This CL switches to sending global and override configuration to the client separately. Also in case if there is a corresponding activity, it first updates it and waits for update callback to ViewRootImpl. This way global config and override config for activity will always be set first and resources will be updated before inner state of ViewRootImpl is updated. Bug: 35870157 Bug: 34164473 Test: android.server.cts.ActivityManagerDisplayTests Test: testOnMovedToDisplayCallback Change-Id: Ic9e7541cf25ecfac6ec90e48f7efb0ece91f657e