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

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

Snap for 13547578 from e5145845 to 25Q3-release

Change-Id: If3df2a5428d6f8ba60ec6f4a8bd24ad16daf70c9
parents 42fd7245 e5145845
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -280,7 +280,6 @@ android.app.ActivityThread$5
android.app.ActivityThread$6
android.app.ActivityThread$ActivityClientRecord$1
android.app.ActivityThread$ActivityClientRecord
android.app.ActivityThread$AndroidOs
android.app.ActivityThread$AppBindData
android.app.ActivityThread$ApplicationThread$$ExternalSyntheticLambda2
android.app.ActivityThread$ApplicationThread$1
@@ -319,6 +318,7 @@ android.app.AlarmManager$OnAlarmListener
android.app.AlarmManager
android.app.AlertDialog$Builder
android.app.AlertDialog
android.app.AndroidForwardingOs
android.app.AppCompatCallbacks
android.app.AppCompatTaskInfo$1
android.app.AppCompatTaskInfo
+9 −0
Original line number Diff line number Diff line
@@ -20714,6 +20714,8 @@ package android.hardware.camera2.params {
    method @NonNull public static java.util.List<android.hardware.camera2.params.OutputConfiguration> createInstancesForMultiResolutionOutput(@NonNull java.util.Collection<android.hardware.camera2.params.MultiResolutionStreamInfo>, int);
    method public int describeContents();
    method public void enableSurfaceSharing();
    method @FlaggedApi("com.android.internal.camera.flags.output_configuration_getter") public int getConfiguredFormat();
    method @FlaggedApi("com.android.internal.camera.flags.output_configuration_getter") @NonNull public android.util.Size getConfiguredSize();
    method public long getDynamicRangeProfile();
    method public int getMaxSharedSurfaceCount();
    method public int getMirrorMode();
@@ -56339,6 +56341,7 @@ package android.view.accessibility {
    field public static final int CONTENT_CHANGE_TYPE_PANE_APPEARED = 16; // 0x10
    field public static final int CONTENT_CHANGE_TYPE_PANE_DISAPPEARED = 32; // 0x20
    field public static final int CONTENT_CHANGE_TYPE_PANE_TITLE = 8; // 0x8
    field @FlaggedApi("android.view.accessibility.a11y_sort_direction_api") public static final int CONTENT_CHANGE_TYPE_SORT_DIRECTION = 65536; // 0x10000
    field public static final int CONTENT_CHANGE_TYPE_STATE_DESCRIPTION = 64; // 0x40
    field public static final int CONTENT_CHANGE_TYPE_SUBTREE = 1; // 0x1
    field @FlaggedApi("android.view.accessibility.supplemental_description") public static final int CONTENT_CHANGE_TYPE_SUPPLEMENTAL_DESCRIPTION = 32768; // 0x8000
@@ -56791,10 +56794,15 @@ package android.view.accessibility {
    method public int getRowIndex();
    method public int getRowSpan();
    method @Nullable public String getRowTitle();
    method @FlaggedApi("android.view.accessibility.a11y_sort_direction_api") public int getSortDirection();
    method @Deprecated public boolean isHeading();
    method public boolean isSelected();
    method @Deprecated public static android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo obtain(int, int, int, int, boolean);
    method @Deprecated public static android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo obtain(int, int, int, int, boolean, boolean);
    field @FlaggedApi("android.view.accessibility.a11y_sort_direction_api") public static final int SORT_DIRECTION_ASCENDING = 1; // 0x1
    field @FlaggedApi("android.view.accessibility.a11y_sort_direction_api") public static final int SORT_DIRECTION_DESCENDING = 2; // 0x2
    field @FlaggedApi("android.view.accessibility.a11y_sort_direction_api") public static final int SORT_DIRECTION_NONE = 0; // 0x0
    field @FlaggedApi("android.view.accessibility.a11y_sort_direction_api") public static final int SORT_DIRECTION_OTHER = 3; // 0x3
  }
  public static final class AccessibilityNodeInfo.CollectionItemInfo.Builder {
@@ -56808,6 +56816,7 @@ package android.view.accessibility {
    method @NonNull public android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo.Builder setRowSpan(int);
    method @NonNull public android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo.Builder setRowTitle(@Nullable String);
    method @NonNull public android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo.Builder setSelected(boolean);
    method @FlaggedApi("android.view.accessibility.a11y_sort_direction_api") @NonNull public android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo.Builder setSortDirection(int);
  }
  public static final class AccessibilityNodeInfo.ExtraRenderingInfo {
+1 −148
Original line number Diff line number Diff line
@@ -28,8 +28,6 @@ import static android.app.servertransaction.ActivityLifecycleItem.ON_RESUME;
import static android.app.servertransaction.ActivityLifecycleItem.ON_START;
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;
@@ -138,7 +136,6 @@ import android.os.DdmSyncStageUpdater;
import android.os.DdmSyncState.Stage;
import android.os.Debug;
import android.os.Environment;
import android.os.FileUtils;
import android.os.GraphicsEnvironment;
import android.os.Handler;
import android.os.HandlerExecutor;
@@ -188,8 +185,6 @@ import android.se.omapi.SeServiceManager;
import android.security.NetworkSecurityPolicy;
import android.security.net.config.NetworkSecurityConfigProvider;
import android.system.ErrnoException;
import android.system.OsConstants;
import android.system.StructStat;
import android.telephony.TelephonyFrameworkInitializer;
import android.util.AndroidRuntimeException;
import android.util.ArrayMap;
@@ -264,9 +259,7 @@ import dalvik.system.VMDebug;
import dalvik.system.VMRuntime;
import dalvik.system.ZipPathValidator;

import libcore.io.ForwardingOs;
import libcore.io.IoUtils;
import libcore.io.Os;
import libcore.net.event.NetworkEventDispatcher;
import libcore.util.NativeAllocationRegistry;

@@ -274,7 +267,6 @@ import org.apache.harmony.dalvik.ddmc.DdmVmInternal;

import java.io.File;
import java.io.FileDescriptor;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
@@ -285,7 +277,6 @@ import java.net.InetAddress;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -9010,149 +9001,11 @@ public final class ActivityThread extends ClientTransactionHandler
        return mCoreSettings;
    }

    private static class AndroidOs extends ForwardingOs {
        /**
         * Install selective syscall interception. For example, this is used to
         * implement special filesystem paths that will be redirected to
         * {@link ContentResolver#openFileDescriptor(Uri, String)}.
         */
        public static void install() {
            // If feature is disabled, we don't need to install
            if (!DEPRECATE_DATA_COLUMNS) return;

            // Install interception and make sure it sticks!
            Os def;
            do {
                def = Os.getDefault();
            } while (!Os.compareAndSetDefault(def, new AndroidOs(def)));
        }

        private AndroidOs(Os os) {
            super(os);
        }

        private FileDescriptor openDeprecatedDataPath(String path, int mode) throws ErrnoException {
            final Uri uri = ContentResolver.translateDeprecatedDataPath(path);
            Log.v(TAG, "Redirecting " + path + " to " + uri);

            final ContentResolver cr = currentActivityThread().getApplication()
                    .getContentResolver();
            try {
                final FileDescriptor fd = new FileDescriptor();
                fd.setInt$(cr.openFileDescriptor(uri,
                        FileUtils.translateModePosixToString(mode)).detachFd());
                return fd;
            } catch (SecurityException e) {
                throw new ErrnoException(e.getMessage(), OsConstants.EACCES);
            } catch (FileNotFoundException e) {
                throw new ErrnoException(e.getMessage(), OsConstants.ENOENT);
            }
        }

        private void deleteDeprecatedDataPath(String path) throws ErrnoException {
            final Uri uri = ContentResolver.translateDeprecatedDataPath(path);
            Log.v(TAG, "Redirecting " + path + " to " + uri);

            final ContentResolver cr = currentActivityThread().getApplication()
                    .getContentResolver();
            try {
                if (cr.delete(uri, null, null) == 0) {
                    throw new FileNotFoundException();
                }
            } catch (SecurityException e) {
                throw new ErrnoException(e.getMessage(), OsConstants.EACCES);
            } catch (FileNotFoundException e) {
                throw new ErrnoException(e.getMessage(), OsConstants.ENOENT);
            }
        }

        @Override
        public boolean access(String path, int mode) throws ErrnoException {
            if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
                // If we opened it okay, then access check succeeded
                IoUtils.closeQuietly(
                        openDeprecatedDataPath(path, FileUtils.translateModeAccessToPosix(mode)));
                return true;
            } else {
                return super.access(path, mode);
            }
        }

        @Override
        public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
            if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
                return openDeprecatedDataPath(path, mode);
            } else {
                return super.open(path, flags, mode);
            }
        }

        @Override
        public StructStat stat(String path) throws ErrnoException {
            if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
                final FileDescriptor fd = openDeprecatedDataPath(path, OsConstants.O_RDONLY);
                try {
                    return android.system.Os.fstat(fd);
                } finally {
                    IoUtils.closeQuietly(fd);
                }
            } else {
                return super.stat(path);
            }
        }

        @Override
        public void unlink(String path) throws ErrnoException {
            if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
                deleteDeprecatedDataPath(path);
            } else {
                super.unlink(path);
            }
        }

        @Override
        public void remove(String path) throws ErrnoException {
            if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
                deleteDeprecatedDataPath(path);
            } else {
                super.remove(path);
            }
        }

        @Override
        public void rename(String oldPath, String newPath) throws ErrnoException {
            try {
                super.rename(oldPath, newPath);
            } catch (ErrnoException e) {
                // On emulated volumes, we have bind mounts for /Android/data and
                // /Android/obb, which prevents move from working across those directories
                // and other directories on the filesystem. To work around that, try to
                // recover by doing a copy instead.
                // Note that we only do this for "/storage/emulated", because public volumes
                // don't have these bind mounts, neither do private volumes that are not
                // the primary storage.
                if (e.errno == OsConstants.EXDEV && oldPath.startsWith("/storage/emulated")
                        && newPath.startsWith("/storage/emulated")) {
                    Log.v(TAG, "Recovering failed rename " + oldPath + " to " + newPath);
                    try {
                        Files.move(new File(oldPath).toPath(), new File(newPath).toPath(),
                                StandardCopyOption.REPLACE_EXISTING);
                    } catch (IOException e2) {
                        Log.e(TAG, "Rename recovery failed ", e2);
                        throw e;
                    }
                } else {
                    throw e;
                }
            }
        }
    }

    public static void main(String[] args) {
        Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "ActivityThreadMain");

        // Install selective syscall interception
        AndroidOs.install();
        AndroidForwardingOs.install();

        // CloseGuard defaults to true and can be quite spammy.  We
        // disable it here, but selectively enable it later (via
+183 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2006 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 android.app;

import static android.content.ContentResolver.DEPRECATE_DATA_COLUMNS;
import static android.content.ContentResolver.DEPRECATE_DATA_PREFIX;

import android.content.ContentResolver;
import android.net.Uri;
import android.os.FileUtils;
import android.system.ErrnoException;
import android.system.OsConstants;
import android.system.StructStat;
import android.util.Log;

import libcore.io.ForwardingOs;
import libcore.io.IoUtils;
import libcore.io.Os;

import java.io.File;
import java.io.FileDescriptor;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;


/**
 * Installs selective syscall interception.
 *
 * <p>For example, this is used to implement special filesystem paths that will be redirected to
 * {@link ContentResolver#openFileDescriptor(Uri, String)}.
 *
 * @hide
 */
class AndroidForwardingOs extends ForwardingOs {
    private static final String TAG = "AndroidForwardingOs";

    public static void install() {
        // If feature is disabled, we don't need to install
        if (!DEPRECATE_DATA_COLUMNS) return;

        // Install interception and make sure it sticks!
        Os def;
        do {
            def = Os.getDefault();
        } while (!Os.compareAndSetDefault(def, new AndroidForwardingOs(def)));
    }

    private AndroidForwardingOs(Os os) {
        super(os);
    }

    private FileDescriptor openDeprecatedDataPath(String path, int mode) throws ErrnoException {
        final Uri uri = ContentResolver.translateDeprecatedDataPath(path);
        Log.v(TAG, "Redirecting " + path + " to " + uri);

        final ContentResolver cr = ActivityThread.currentActivityThread().getApplication()
                .getContentResolver();
        try {
            final FileDescriptor fd = new FileDescriptor();
            fd.setInt$(cr.openFileDescriptor(uri,
                    FileUtils.translateModePosixToString(mode)).detachFd());
            return fd;
        } catch (SecurityException e) {
            throw new ErrnoException(e.getMessage(), OsConstants.EACCES);
        } catch (FileNotFoundException e) {
            throw new ErrnoException(e.getMessage(), OsConstants.ENOENT);
        }
    }

    private void deleteDeprecatedDataPath(String path) throws ErrnoException {
        final Uri uri = ContentResolver.translateDeprecatedDataPath(path);
        Log.v(TAG, "Redirecting " + path + " to " + uri);

        final ContentResolver cr = ActivityThread.currentActivityThread().getApplication()
                .getContentResolver();
        try {
            if (cr.delete(uri, null, null) == 0) {
                throw new FileNotFoundException();
            }
        } catch (SecurityException e) {
            throw new ErrnoException(e.getMessage(), OsConstants.EACCES);
        } catch (FileNotFoundException e) {
            throw new ErrnoException(e.getMessage(), OsConstants.ENOENT);
        }
    }

    @Override
    public boolean access(String path, int mode) throws ErrnoException {
        if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
            // If we opened it okay, then access check succeeded
            IoUtils.closeQuietly(
                    openDeprecatedDataPath(path, FileUtils.translateModeAccessToPosix(mode)));
            return true;
        } else {
            return super.access(path, mode);
        }
    }

    @Override
    public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
        if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
            return openDeprecatedDataPath(path, mode);
        } else {
            return super.open(path, flags, mode);
        }
    }

    @Override
    public StructStat stat(String path) throws ErrnoException {
        if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
            final FileDescriptor fd = openDeprecatedDataPath(path, OsConstants.O_RDONLY);
            try {
                return android.system.Os.fstat(fd);
            } finally {
                IoUtils.closeQuietly(fd);
            }
        } else {
            return super.stat(path);
        }
    }

    @Override
    public void unlink(String path) throws ErrnoException {
        if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
            deleteDeprecatedDataPath(path);
        } else {
            super.unlink(path);
        }
    }

    @Override
    public void remove(String path) throws ErrnoException {
        if (path != null && path.startsWith(DEPRECATE_DATA_PREFIX)) {
            deleteDeprecatedDataPath(path);
        } else {
            super.remove(path);
        }
    }

    @Override
    public void rename(String oldPath, String newPath) throws ErrnoException {
        try {
            super.rename(oldPath, newPath);
        } catch (ErrnoException e) {
            // On emulated volumes, we have bind mounts for /Android/data and
            // /Android/obb, which prevents move from working across those directories
            // and other directories on the filesystem. To work around that, try to
            // recover by doing a copy instead.
            // Note that we only do this for "/storage/emulated", because public volumes
            // don't have these bind mounts, neither do private volumes that are not
            // the primary storage.
            if (e.errno == OsConstants.EXDEV && oldPath.startsWith("/storage/emulated")
                    && newPath.startsWith("/storage/emulated")) {
                Log.v(TAG, "Recovering failed rename " + oldPath + " to " + newPath);
                try {
                    Files.move(new File(oldPath).toPath(), new File(newPath).toPath(),
                            StandardCopyOption.REPLACE_EXISTING);
                } catch (IOException e2) {
                    Log.e(TAG, "Rename recovery failed ", e2);
                    throw e;
                }
            } else {
                throw e;
            }
        }
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ per-file ActivityThread.java = file:RESOURCES_OWNERS
# Alarm
per-file *Alarm* = file:/apex/jobscheduler/ALARM_OWNERS

# AndroidForwardingOs
per-file AndroidForwardingOs.java = file:/ACTIVITY_MANAGER_OWNERS
per-file AndroidForwardingOS.java = file:RESOURCES_OWNERS

# AppOps
per-file *AppOp* = file:/core/java/android/permission/OWNERS

Loading