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

Commit 7761800f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8799858 from 0b670f20 to tm-qpr1-release

Change-Id: I039d339c1b684c40e50482edd098e13caa5002f6
parents becbaae7 0b670f20
Loading
Loading
Loading
Loading
+12 −14
Original line number Diff line number Diff line
@@ -5863,20 +5863,20 @@ public final class ActivityThread extends ClientTransactionHandler

        final boolean movedToDifferentDisplay = isDifferentDisplay(activity.getDisplayId(),
                displayId);
        final Configuration currentConfig = activity.mCurrentConfig;
        final int diff = currentConfig.diffPublicOnly(newConfig);
        final boolean hasPublicConfigChange = diff != 0;
        final Configuration currentResConfig = activity.getResources().getConfiguration();
        final int diff = currentResConfig.diffPublicOnly(newConfig);
        final boolean hasPublicResConfigChange = diff != 0;
        final ActivityClientRecord r = getActivityClient(activityToken);
        // TODO(b/173090263): Use diff instead after the improvement of AssetManager and
        // ResourcesImpl constructions.
        final boolean shouldUpdateResources = hasPublicConfigChange
                || shouldUpdateResources(activityToken, currentConfig, newConfig, amOverrideConfig,
                movedToDifferentDisplay, hasPublicConfigChange);
        final boolean shouldReportChange = shouldReportChange(diff, currentConfig, newConfig,
        final boolean shouldUpdateResources = hasPublicResConfigChange
                || shouldUpdateResources(activityToken, currentResConfig, newConfig,
                amOverrideConfig, movedToDifferentDisplay, hasPublicResConfigChange);
        final boolean shouldReportChange = shouldReportChange(activity.mCurrentConfig, newConfig,
                r != null ? r.mSizeConfigurations : null,
                activity.mActivityInfo.getRealConfigChanged());
        // Nothing significant, don't proceed with updating and reporting.
        if (!shouldUpdateResources) {
        if (!shouldUpdateResources && !shouldReportChange) {
            return null;
        }

@@ -5896,9 +5896,6 @@ public final class ActivityThread extends ClientTransactionHandler
                amOverrideConfig, contextThemeWrapperOverrideConfig);
        mResourcesManager.updateResourcesForActivity(activityToken, finalOverrideConfig, displayId);

        activity.mConfigChangeFlags = 0;
        activity.mCurrentConfig = new Configuration(newConfig);

        // Apply the ContextThemeWrapper override if necessary.
        // NOTE: Make sure the configurations are not modified, as they are treated as immutable
        // in many places.
@@ -5909,8 +5906,10 @@ public final class ActivityThread extends ClientTransactionHandler
            activity.dispatchMovedToDisplay(displayId, configToReport);
        }

        activity.mConfigChangeFlags = 0;
        if (shouldReportChange) {
            activity.mCalled = false;
            activity.mCurrentConfig = new Configuration(newConfig);
            activity.onConfigurationChanged(configToReport);
            if (!activity.mCalled) {
                throw new SuperNotCalledException("Activity " + activity.getLocalClassName() +
@@ -5925,8 +5924,6 @@ public final class ActivityThread extends ClientTransactionHandler
     * Returns {@code true} if {@link Activity#onConfigurationChanged(Configuration)} should be
     * dispatched.
     *
     * @param publicDiff Usually computed by {@link Configuration#diffPublicOnly(Configuration)}.
     *                   This parameter is to prevent we compute it again.
     * @param currentConfig The current configuration cached in {@link Activity#mCurrentConfig}.
     *                      It is {@code null} before the first config update from the server side.
     * @param newConfig The updated {@link Configuration}
@@ -5935,9 +5932,10 @@ public final class ActivityThread extends ClientTransactionHandler
     * @return {@code true} if the config change should be reported to the Activity
     */
    @VisibleForTesting
    public static boolean shouldReportChange(int publicDiff, @Nullable Configuration currentConfig,
    public static boolean shouldReportChange(@Nullable Configuration currentConfig,
            @NonNull Configuration newConfig, @Nullable SizeConfigurationBuckets sizeBuckets,
            int handledConfigChanges) {
        final int publicDiff = currentConfig.diffPublicOnly(newConfig);
        // Don't report the change if there's no public diff between current and new config.
        if (publicDiff == 0) {
            return false;
+8 −0
Original line number Diff line number Diff line
@@ -265,6 +265,7 @@ public class ResolverListAdapter extends BaseAdapter {
            return mResolverListController.getResolversForIntent(
                            /* shouldGetResolvedFilter= */ true,
                            mResolverListCommunicator.shouldGetActivityMetadata(),
                            mResolverListCommunicator.shouldGetOnlyDefaultActivities(),
                            mIntents);
        }
    }
@@ -727,6 +728,7 @@ public class ResolverListAdapter extends BaseAdapter {
    protected List<ResolvedComponentInfo> getResolversForUser(UserHandle userHandle) {
        return mResolverListController.getResolversForIntentAsUser(true,
                mResolverListCommunicator.shouldGetActivityMetadata(),
                mResolverListCommunicator.shouldGetOnlyDefaultActivities(),
                mIntents, userHandle);
    }

@@ -820,6 +822,12 @@ public class ResolverListAdapter extends BaseAdapter {

        boolean shouldGetActivityMetadata();

        /**
         * @return true to filter only apps that can handle
         *     {@link android.content.Intent#CATEGORY_DEFAULT} intents
         */
        default boolean shouldGetOnlyDefaultActivities() { return true; };

        Intent getTargetIntent();

        void onHandlePackagesChanged(ResolverListAdapter listAdapter);
+4 −2
Original line number Diff line number Diff line
@@ -110,17 +110,19 @@ public class ResolverListController {
    public List<ResolverActivity.ResolvedComponentInfo> getResolversForIntent(
            boolean shouldGetResolvedFilter,
            boolean shouldGetActivityMetadata,
            boolean shouldGetOnlyDefaultActivities,
            List<Intent> intents) {
        return getResolversForIntentAsUser(shouldGetResolvedFilter, shouldGetActivityMetadata,
                intents, mUserHandle);
                shouldGetOnlyDefaultActivities, intents, mUserHandle);
    }

    public List<ResolverActivity.ResolvedComponentInfo> getResolversForIntentAsUser(
            boolean shouldGetResolvedFilter,
            boolean shouldGetActivityMetadata,
            boolean shouldGetOnlyDefaultActivities,
            List<Intent> intents,
            UserHandle userHandle) {
        int baseFlags = PackageManager.MATCH_DEFAULT_ONLY
        int baseFlags = (shouldGetOnlyDefaultActivities ? PackageManager.MATCH_DEFAULT_ONLY : 0)
                | PackageManager.MATCH_DIRECT_BOOT_AWARE
                | PackageManager.MATCH_DIRECT_BOOT_UNAWARE
                | (shouldGetResolvedFilter ? PackageManager.GET_RESOLVED_FILTER : 0)
+4 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.view.InsetsVisibilities;

import com.android.internal.statusbar.IAddTileResultCallback;
import com.android.internal.statusbar.IUndoMediaTransferCallback;
import com.android.internal.statusbar.LetterboxDetails;
import com.android.internal.statusbar.StatusBarIcon;
import com.android.internal.view.AppearanceRegion;

@@ -202,10 +203,12 @@ oneway interface IStatusBar
     * @param behavior the behavior of the focused window.
     * @param requestedVisibilities the collection of the requested visibilities of system insets.
     * @param packageName the package name of the focused app.
     * @param letterboxDetails a set of letterbox details of apps visible on the screen.
     */
    void onSystemBarAttributesChanged(int displayId, int appearance,
            in AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme,
            int behavior, in InsetsVisibilities requestedVisibilities, String packageName);
            int behavior, in InsetsVisibilities requestedVisibilities, String packageName,
            in LetterboxDetails[] letterboxDetails);

    /**
     * Notifies System UI to show transient bars. The transient bars are system bars, e.g., status
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.internal.statusbar;

parcelable LetterboxDetails;
Loading