Loading core/java/android/app/IUriGrantsManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -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); } core/java/android/view/inputmethod/RemoteInputConnectionImpl.java +21 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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 } Loading core/jni/com_android_internal_os_Zygote.cpp +4 −9 Original line number Diff line number Diff line Loading @@ -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); Loading libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java +1 −5 Original line number Diff line number Diff line Loading @@ -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)) { Loading libs/WindowManager/Jetpack/src/androidx/window/sidecar/SampleSidecarImpl.java +1 −3 Original line number Diff line number Diff line Loading @@ -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 Loading
core/java/android/app/IUriGrantsManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -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); }
core/java/android/view/inputmethod/RemoteInputConnectionImpl.java +21 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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 } Loading
core/jni/com_android_internal_os_Zygote.cpp +4 −9 Original line number Diff line number Diff line Loading @@ -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); Loading
libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java +1 −5 Original line number Diff line number Diff line Loading @@ -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)) { Loading
libs/WindowManager/Jetpack/src/androidx/window/sidecar/SampleSidecarImpl.java +1 −3 Original line number Diff line number Diff line Loading @@ -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