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

Commit 8ed575cd authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12085179 from dbe4e366 to 24Q4-release

Change-Id: Ib434c2d64fa757b01ce996613645307d34dffe76
parents 4818ac1a dbe4e366
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -12047,6 +12047,7 @@ package android.content.pm {
    field public static final int COLOR_MODE_DEFAULT = 0; // 0x0
    field public static final int COLOR_MODE_HDR = 2; // 0x2
    field public static final int COLOR_MODE_WIDE_COLOR_GAMUT = 1; // 0x1
    field @FlaggedApi("android.content.res.handle_all_config_changes") public static final int CONFIG_ASSETS_PATHS = -2147483648; // 0x80000000
    field public static final int CONFIG_COLOR_MODE = 16384; // 0x4000
    field public static final int CONFIG_DENSITY = 4096; // 0x1000
    field public static final int CONFIG_FONT_SCALE = 1073741824; // 0x40000000
@@ -12060,6 +12061,7 @@ package android.content.pm {
    field public static final int CONFIG_MNC = 2; // 0x2
    field public static final int CONFIG_NAVIGATION = 64; // 0x40
    field public static final int CONFIG_ORIENTATION = 128; // 0x80
    field @FlaggedApi("android.content.res.handle_all_config_changes") public static final int CONFIG_RESOURCES_UNUSED = 134217728; // 0x8000000
    field public static final int CONFIG_SCREEN_LAYOUT = 256; // 0x100
    field public static final int CONFIG_SCREEN_SIZE = 1024; // 0x400
    field public static final int CONFIG_SMALLEST_SCREEN_SIZE = 2048; // 0x800
+8 −4
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import static android.app.servertransaction.ActivityLifecycleItem.ON_STOP;
import static android.app.servertransaction.ActivityLifecycleItem.PRE_ON_CREATE;
import static android.content.ContentResolver.DEPRECATE_DATA_COLUMNS;
import static android.content.ContentResolver.DEPRECATE_DATA_PREFIX;
import static android.content.pm.ActivityInfo.CONFIG_RESOURCES_UNUSED;
import static android.content.res.Configuration.UI_MODE_TYPE_DESK;
import static android.content.res.Configuration.UI_MODE_TYPE_MASK;
import static android.view.Display.DEFAULT_DISPLAY;
@@ -41,7 +42,6 @@ import static android.window.ConfigurationHelper.shouldUpdateResources;
import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
import static com.android.internal.os.SafeZipPathValidatorCallback.VALIDATE_ZIP_PATH_FOR_PATH_TRAVERSAL;
import static com.android.sdksandbox.flags.Flags.sandboxActivitySdkBasedContext;
import static com.android.window.flags.Flags.activityWindowInfoFlag;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -6520,6 +6520,13 @@ public final class ActivityThread extends ClientTransactionHandler
            return true;
        }

        if (android.content.res.Flags.handleAllConfigChanges()) {
            if ((handledConfigChanges & CONFIG_RESOURCES_UNUSED) != 0) {
                // Report the change if activities claim they do not use resources at all.
                return true;
            }
        }

        final int diffWithBucket = SizeConfigurationBuckets.filterDiff(publicDiff, currentConfig,
                newConfig, sizeBuckets);
        // Compare to the diff which filter the change without crossing size buckets with
@@ -6846,9 +6853,6 @@ public final class ActivityThread extends ClientTransactionHandler
    }

    private void handleActivityWindowInfoChanged(@NonNull ActivityClientRecord r) {
        if (!activityWindowInfoFlag()) {
            return;
        }
        if (r.mActivityWindowInfo.equals(r.mLastReportedActivityWindowInfo)) {
            return;
        }
+0 −11
Original line number Diff line number Diff line
@@ -19,8 +19,6 @@ package android.app.servertransaction;
import static android.app.WindowConfiguration.areConfigurationsEqualForDisplay;
import static android.view.Display.INVALID_DISPLAY;

import static com.android.window.flags.Flags.activityWindowInfoFlag;

import static java.util.Objects.requireNonNull;

import android.annotation.NonNull;
@@ -102,9 +100,6 @@ public class ClientTransactionListenerController {
     */
    public void registerActivityWindowInfoChangedListener(
            @NonNull BiConsumer<IBinder, ActivityWindowInfo> listener) {
        if (!activityWindowInfoFlag()) {
            return;
        }
        synchronized (mLock) {
            mActivityWindowInfoChangedListeners.add(listener);
        }
@@ -116,9 +111,6 @@ public class ClientTransactionListenerController {
     */
    public void unregisterActivityWindowInfoChangedListener(
            @NonNull BiConsumer<IBinder, ActivityWindowInfo> listener) {
        if (!activityWindowInfoFlag()) {
            return;
        }
        synchronized (mLock) {
            mActivityWindowInfoChangedListeners.remove(listener);
        }
@@ -130,9 +122,6 @@ public class ClientTransactionListenerController {
     */
    public void onActivityWindowInfoChanged(@NonNull IBinder activityToken,
            @NonNull ActivityWindowInfo activityWindowInfo) {
        if (!activityWindowInfoFlag()) {
            return;
        }
        final Object[] activityWindowInfoChangedListeners;
        synchronized (mLock) {
            if (mActivityWindowInfoChangedListeners.isEmpty()) {
+7 −2
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ import android.os.storage.StorageManager;
import android.permission.PermissionCheckerManager;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.util.ArraySet;
import android.util.Log;
import android.util.SparseBooleanArray;

@@ -486,6 +487,8 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall
            validateIncomingAuthority(authority);
            int numOperations = operations.size();
            final int[] userIds = new int[numOperations];
            final ArraySet<String> readPermissions = new ArraySet<String>();
            final ArraySet<String> writePermissions = new ArraySet<String>();
            for (int i = 0; i < numOperations; i++) {
                ContentProviderOperation operation = operations.get(i);
                Uri uri = operation.getUri();
@@ -499,17 +502,19 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall
                }
                final AttributionSource accessAttributionSource =
                        attributionSource;
                if (operation.isReadOperation()) {
                if (operation.isReadOperation() && !readPermissions.contains(uri.toString())) {
                    if (enforceReadPermission(accessAttributionSource, uri)
                            != PermissionChecker.PERMISSION_GRANTED) {
                        throw new OperationApplicationException("App op not allowed", 0);
                    }
                    readPermissions.add(uri.toString());
                }
                if (operation.isWriteOperation()) {
                if (operation.isWriteOperation() && !writePermissions.contains(uri.toString())) {
                    if (enforceWritePermission(accessAttributionSource, uri)
                            != PermissionChecker.PERMISSION_GRANTED) {
                        throw new OperationApplicationException("App op not allowed", 0);
                    }
                    writePermissions.add(uri.toString());
                }
            }
            traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "applyBatch: ", authority);
+29 −2
Original line number Diff line number Diff line
@@ -941,6 +941,8 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
            CONFIG_COLOR_MODE,
            CONFIG_FONT_SCALE,
            CONFIG_GRAMMATICAL_GENDER,
            CONFIG_ASSETS_PATHS,
            CONFIG_RESOURCES_UNUSED,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface Config {}
@@ -1060,8 +1062,8 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
     * can itself handle asset path changes.  Set from the {@link android.R.attr#configChanges}
     * attribute. This is not a core resource configuration, but a higher-level value, so its
     * constant starts at the high bits.
     * @hide We do not want apps handling this yet, but we do need some kind of bit for diffs.
     */
    @FlaggedApi(android.content.res.Flags.FLAG_HANDLE_ALL_CONFIG_CHANGES)
    public static final int CONFIG_ASSETS_PATHS = 0x80000000;
    /**
     * Bit in {@link #configChanges} that indicates that the activity
@@ -1088,6 +1090,30 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
     */
    public static final int CONFIG_FONT_WEIGHT_ADJUSTMENT = 0x10000000;

    /**
     * <p>This is probably not the constant you want, the resources compiler supports a less
     * dangerous version of it, 'allKnown', that only suppresses all currently existing
     * configuration change restarts depending on your target SDK rather than whatever the latest
     * SDK supports, allowing the application to work with resources on future Platform versions.
     *
     * <p>Bit in {@link #configChanges} that indicates that the activity doesn't use Android
     * Resources at all and doesn't need to be restarted on any configuration changes. This bit
     * disables all restarts for configuration dimensions available in the current target SDK as
     * well as dimensions introduced in future SDKs. Use it only if the activity doesn't need
     * anything from its resources, and doesn't depend on any libraries that may provide resources
     * and need to respond to configuration changes. When set,
     * {@link Activity#onConfigurationChanged(Configuration)} will be called instead of a restart,
     * and it’s up to the implementation to ensure that no stale resource values remain loaded
     * anywhere in the code.
     *
     * <p>This overrides all other bits, and this is recommended to be used individually.
     *
     * <p>This is not a core resource configuration, but a higher-level value, so its constant
     * starts at the high bits.
     */
    @FlaggedApi(android.content.res.Flags.FLAG_HANDLE_ALL_CONFIG_CHANGES)
    public static final int CONFIG_RESOURCES_UNUSED = 0x8000000;

    /** @hide
     * Unfortunately the constants for config changes in native code are
     * different from ActivityInfo. :(  Here are the values we should use for the
@@ -1657,7 +1683,8 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
     * {@link #CONFIG_KEYBOARD}, {@link #CONFIG_NAVIGATION},
     * {@link #CONFIG_ORIENTATION}, {@link #CONFIG_SCREEN_LAYOUT},
     * {@link #CONFIG_DENSITY}, {@link #CONFIG_LAYOUT_DIRECTION},
     * {@link #CONFIG_COLOR_MODE}, and {link #CONFIG_GRAMMATICAL_GENDER}.
     * {@link #CONFIG_COLOR_MODE}, {@link #CONFIG_GRAMMATICAL_GENDER},
     * {@link #CONFIG_ASSETS_PATHS}, and {@link #CONFIG_RESOURCES_UNUSED}.
     * Set from the {@link android.R.attr#configChanges} attribute.
     */
    public int configChanges;
Loading