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

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

Snap for 10804332 from d674a06b to udc-qpr1-release

Change-Id: Ia2a0f3737c045b0b1f95865c2533e0a969d4f7a9
parents 81b9b3aa d674a06b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -39,4 +39,7 @@ interface IUriGrantsManager {
    void clearGrantedUriPermissions(in String packageName, int userId);
    ParceledListSlice getUriPermissions(in String packageName, boolean incoming,
            boolean persistedOnly);

    int checkGrantUriPermission_ignoreNonSystem(
            int sourceUid, String targetPkg, in Uri uri, int modeFlags, int userId);
}
+21 −0
Original line number Diff line number Diff line
@@ -28,7 +28,12 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
import android.annotation.AnyThread;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.UriGrantsManager;
import android.content.ContentProvider;
import android.content.Intent;
import android.graphics.RectF;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.CancellationSignalBeamer;
@@ -37,6 +42,7 @@ import android.os.IBinder;
import android.os.Looper;
import android.os.ResultReceiver;
import android.os.Trace;
import android.os.UserHandle;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
import android.view.KeyEvent;
@@ -1193,7 +1199,22 @@ final class RemoteInputConnectionImpl extends IRemoteInputConnection.Stub {
    public void commitContent(InputConnectionCommandHeader header,
            InputContentInfo inputContentInfo, int flags, Bundle opts,
            AndroidFuture future /* T=Boolean */) {
        final int imeUid = Binder.getCallingUid();
        dispatchWithTracing("commitContent", future, () -> {
            // Check if the originator IME has the right permissions
            try {
                final int contentUriOwnerUserId = ContentProvider.getUserIdFromUri(
                        inputContentInfo.getContentUri(), UserHandle.getUserId(imeUid));
                final Uri contentUriWithoutUserId = ContentProvider.getUriWithoutUserId(
                        inputContentInfo.getContentUri());
                UriGrantsManager.getService().checkGrantUriPermission_ignoreNonSystem(imeUid, null,
                        contentUriWithoutUserId, Intent.FLAG_GRANT_READ_URI_PERMISSION,
                        contentUriOwnerUserId);
            } catch (Exception e) {
                Log.w(TAG, "commitContent with invalid Uri permission from IME:", e);
                return false;
            }

            if (header.mSessionId != mCurrentSessionId.get()) {
                return false;  // cancelled
            }
+4 −9
Original line number Diff line number Diff line
@@ -1806,17 +1806,12 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids,
    if (!is_system_server && getuid() == 0) {
        const int rc = createProcessGroup(uid, getpid());
        if (rc != 0) {
            if (rc == -ESRCH) {
                // If process is dead, treat this as a non-fatal error
                ALOGE("createProcessGroup(%d, %d) failed: %s", uid, /* pid= */ 0, strerror(-rc));
            } else {
            fail_fn(rc == -EROFS ? CREATE_ERROR("createProcessGroup failed, kernel missing "
                                                "CONFIG_CGROUP_CPUACCT?")
                                 : CREATE_ERROR("createProcessGroup(%d, %d) failed: %s", uid,
                                                /* pid= */ 0, strerror(-rc)));
        }
    }
    }

    SetGids(env, gids, is_child_zygote, fail_fn);
    SetRLimits(env, rlimits, fail_fn);
+1 −5
Original line number Diff line number Diff line
@@ -327,17 +327,13 @@ public class WindowLayoutComponentImpl implements WindowLayoutComponent {
            return features;
        }

        // We will transform the feature bounds to the Activity window, so using the rotation
        // from the same source (WindowConfiguration) to make sure they are synchronized.
        final int rotation = windowConfiguration.getDisplayRotation();

        for (CommonFoldingFeature baseFeature : storedFeatures) {
            Integer state = convertToExtensionState(baseFeature.getState());
            if (state == null) {
                continue;
            }
            Rect featureRect = baseFeature.getRect();
            rotateRectToDisplayRotation(displayId, rotation, featureRect);
            rotateRectToDisplayRotation(displayId, featureRect);
            transformToWindowSpaceRect(windowConfiguration, featureRect);

            if (isZero(featureRect)) {
+1 −3
Original line number Diff line number Diff line
@@ -120,12 +120,10 @@ class SampleSidecarImpl extends StubSidecar {
        }

        List<SidecarDisplayFeature> features = new ArrayList<>();
        final int rotation = activity.getResources().getConfiguration().windowConfiguration
                .getDisplayRotation();
        for (CommonFoldingFeature baseFeature : mStoredFeatures) {
            SidecarDisplayFeature feature = new SidecarDisplayFeature();
            Rect featureRect = baseFeature.getRect();
            rotateRectToDisplayRotation(displayId, rotation, featureRect);
            rotateRectToDisplayRotation(displayId, featureRect);
            transformToWindowSpaceRect(activity, featureRect);
            feature.setRect(featureRect);
            feature.setType(baseFeature.getType());
Loading