Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d34edb1 authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Do not filter out the size configs if no configuration buckets" into...

Merge "Do not filter out the size configs if no configuration buckets" into tm-qpr-dev am: cf3b16d6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18902473



Change-Id: I0537a5e5237e3ce8b9ccd9b8070f198847739c61
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents fc28fab2 cf3b16d6
Loading
Loading
Loading
Loading
+4 −13
Original line number Diff line number Diff line
@@ -104,24 +104,15 @@ public final class SizeConfigurationBuckets implements Parcelable {
    /**
     * Get the changes between two configurations but don't count changes in sizes if they don't
     * cross boundaries that are important to the app.
     *
     * This is a static helper to deal with null `buckets`. When no buckets have been specified,
     * this actually filters out all 3 size-configs. This is legacy behavior.
     */
    public static int filterDiff(int diff, @NonNull Configuration oldConfig,
            @NonNull Configuration newConfig, @Nullable SizeConfigurationBuckets buckets) {
        final boolean nonSizeLayoutFieldsUnchanged =
                areNonSizeLayoutFieldsUnchanged(oldConfig.screenLayout, newConfig.screenLayout);
        if (buckets == null) {
            // Only unflip CONFIG_SCREEN_LAYOUT if non-size-related  attributes of screen layout do
            // not change.
            if (nonSizeLayoutFieldsUnchanged) {
                return diff & ~(CONFIG_SCREEN_SIZE | CONFIG_SMALLEST_SCREEN_SIZE
                        | CONFIG_SCREEN_LAYOUT);
            } else {
                return diff & ~(CONFIG_SCREEN_SIZE | CONFIG_SMALLEST_SCREEN_SIZE);
            }
            return diff;
        }

        final boolean nonSizeLayoutFieldsUnchanged =
                areNonSizeLayoutFieldsUnchanged(oldConfig.screenLayout, newConfig.screenLayout);
        if ((diff & CONFIG_SCREEN_SIZE) != 0) {
            final boolean crosses = buckets.crossesHorizontalSizeThreshold(oldConfig.screenWidthDp,
                    newConfig.screenWidthDp)