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

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

Merge cherrypicks of ['googleplex-android-review.googlesource.com/33583801',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/33583801', 'googleplex-android-review.googlesource.com/34037672', 'googleplex-android-review.googlesource.com/33962044', 'googleplex-android-review.googlesource.com/34410822', 'googleplex-android-review.googlesource.com/34405089', 'googleplex-android-review.googlesource.com/34599705', 'googleplex-android-review.googlesource.com/34430312', 'googleplex-android-review.googlesource.com/34614081', 'googleplex-android-review.googlesource.com/34391057', 'googleplex-android-review.googlesource.com/34815122', 'googleplex-android-review.googlesource.com/34943963', 'googleplex-android-review.googlesource.com/34442170', 'googleplex-android-review.googlesource.com/34994250', 'googleplex-android-review.googlesource.com/34957282', 'googleplex-android-review.googlesource.com/35157052', 'googleplex-android-review.googlesource.com/35443701', 'googleplex-android-review.googlesource.com/35076364', 'googleplex-android-review.googlesource.com/35085332', 'googleplex-android-review.googlesource.com/35310069', 'googleplex-android-review.googlesource.com/35440064', 'googleplex-android-review.googlesource.com/35464055', 'googleplex-android-review.googlesource.com/35602275', 'googleplex-android-review.googlesource.com/35740896', 'googleplex-android-review.googlesource.com/35499581', 'googleplex-android-review.googlesource.com/35742356', 'googleplex-android-review.googlesource.com/35479488', 'googleplex-android-review.googlesource.com/35746851', 'googleplex-android-review.googlesource.com/35844780', 'googleplex-android-review.googlesource.com/35973688', 'googleplex-android-review.googlesource.com/35236442', 'googleplex-android-review.googlesource.com/35901983', 'googleplex-android-review.googlesource.com/35609625', 'googleplex-android-review.googlesource.com/35930588', 'googleplex-android-review.googlesource.com/36021324', 'googleplex-android-review.googlesource.com/35478450', 'googleplex-android-review.googlesource.com/35434752', 'googleplex-android-review.googlesource.com/36101687'] into 25Q2-release.

Change-Id: I007b6e6de61848c16c422dbd54bde71b32ed0bab
parents d682c904 de27b16b
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -8367,13 +8367,13 @@ public class AppOpsManager {
        } else {
            opCodes = null;
        }
        final List<AppOpsManager.PackageOps> result;
        try {
            result = mService.getPackagesForOpsForDevice(opCodes, persistentDeviceId);
            ParceledListSlice<PackageOps> packageOps = mService.getPackagesForOpsForDevice(opCodes,
                    persistentDeviceId);
            return packageOps == null ? Collections.emptyList() : packageOps.getList();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
        return (result != null) ? result : Collections.emptyList();
    }

    /**
@@ -8392,8 +8392,9 @@ public class AppOpsManager {
    @UnsupportedAppUsage
    public List<AppOpsManager.PackageOps> getPackagesForOps(int[] ops) {
        try {
            return mService.getPackagesForOpsForDevice(ops,
            ParceledListSlice<PackageOps> packageOps = mService.getPackagesForOpsForDevice(ops,
                    VirtualDeviceManager.PERSISTENT_DEVICE_ID_DEFAULT);
            return packageOps == null ? null : packageOps.getList();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+21 −7
Original line number Diff line number Diff line
@@ -1496,22 +1496,36 @@ public class ApplicationPackageManager extends PackageManager {

    @Override
    public ResolveInfo resolveActivity(Intent intent, ResolveInfoFlags flags) {
        return resolveActivityAsUser(intent, flags, getUserId());
        return resolveActivityAsUser(intent, /* resolvedType= */ null, flags, getUserId());
    }

    @Override
    public ResolveInfo resolveActivityAsUser(Intent intent, int flags, int userId) {
        return resolveActivityAsUser(intent, ResolveInfoFlags.of(flags), userId);
        return resolveActivityAsUser(intent, /* resolvedType= */ null, ResolveInfoFlags.of(flags),
                userId);
    }

    @Override
    public ResolveInfo resolveActivityAsUser(Intent intent, ResolveInfoFlags flags, int userId) {
        return resolveActivityAsUser(intent, /* resolvedType= */ null, flags, userId);
    }

    @Override
    public ResolveInfo resolveActivityAsUser(Intent intent, String resolvedType,
            int flags, int userId) {
        return resolveActivityAsUser(intent, resolvedType,
                ResolveInfoFlags.of(flags), userId);
    }

    @Override
    public ResolveInfo resolveActivityAsUser(Intent intent, String resolvedType,
            ResolveInfoFlags flags, int userId) {
        try {
            return mPM.resolveIntent(
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                updateFlagsForComponent(flags.getValue(), userId, intent),
                userId);
            return mPM.resolveIntent(intent,
                    resolvedType == null
                        ? intent.resolveTypeIfNeeded(mContext.getContentResolver())
                        : resolvedType,
                    updateFlagsForComponent(flags.getValue(), userId, intent), userId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+0 −1
Original line number Diff line number Diff line
@@ -178,7 +178,6 @@ interface INotificationManager
    void setInterruptionFilter(String pkg, int interruptionFilter, boolean fromUser);

    NotificationChannel createConversationNotificationChannelForPackageFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, String parentChannelId, String conversationId);
    void updateNotificationChannelGroupFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannelGroup group);
    void updateNotificationChannelFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannel channel);
    ParceledListSlice getNotificationChannelsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user);
    ParceledListSlice getNotificationChannelGroupsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user);
+10 −5
Original line number Diff line number Diff line
@@ -311,6 +311,7 @@ public final class AssociationRequest implements Parcelable {
            boolean forceConfirmation,
            boolean skipRoleGrant,
            @Nullable Icon deviceIcon) {
        validateDisplayName(displayName);
        mSingleDevice = singleDevice;
        mDeviceFilters = requireNonNull(deviceFilters);
        mDeviceProfile = deviceProfile;
@@ -418,6 +419,7 @@ public final class AssociationRequest implements Parcelable {

    /** @hide */
    public void setDisplayName(CharSequence displayName) {
        validateDisplayName(displayName);
        mDisplayName = displayName;
    }

@@ -503,11 +505,7 @@ public final class AssociationRequest implements Parcelable {
        public Builder setDisplayName(@NonNull CharSequence displayName) {
            checkNotUsed();
            mDisplayName = requireNonNull(displayName);
            if (displayName.length() > DISPLAY_NAME_LENGTH_LIMIT) {
                throw new IllegalArgumentException("Length of the display name must be at most "
                        + DISPLAY_NAME_LENGTH_LIMIT + " characters");
            }

            validateDisplayName(displayName);
            return this;
        }

@@ -815,4 +813,11 @@ public final class AssociationRequest implements Parcelable {
            return new AssociationRequest(in);
        }
    };

    private static void validateDisplayName(@Nullable CharSequence displayName) {
        if (displayName != null && displayName.length() > DISPLAY_NAME_LENGTH_LIMIT) {
            throw new IllegalArgumentException("Length of the display name must be at most "
                    + DISPLAY_NAME_LENGTH_LIMIT + " characters");
        }
    }
}
+25 −4
Original line number Diff line number Diff line
@@ -590,13 +590,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall
                throws FileNotFoundException {
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            enforceFilePermission(attributionSource, uri, mode);
            final String updatedMode = validateFileMode(mode);
            enforceFilePermission(attributionSource, uri, updatedMode);
            traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "openFile: ", uri.getAuthority());
            final AttributionSource original = setCallingAttributionSource(
                    attributionSource);
            try {
                return mInterface.openFile(
                        uri, mode, CancellationSignal.fromTransport(cancellationSignal));
                        uri, updatedMode, CancellationSignal.fromTransport(cancellationSignal));
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
            } finally {
@@ -611,13 +612,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall
                throws FileNotFoundException {
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            enforceFilePermission(attributionSource, uri, mode);
            final String updatedMode = validateFileMode(mode);
            enforceFilePermission(attributionSource, uri, updatedMode);
            traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "openAssetFile: ", uri.getAuthority());
            final AttributionSource original = setCallingAttributionSource(
                    attributionSource);
            try {
                return mInterface.openAssetFile(
                        uri, mode, CancellationSignal.fromTransport(cancellationSignal));
                        uri, updatedMode, CancellationSignal.fromTransport(cancellationSignal));
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
            } finally {
@@ -782,6 +784,25 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall
            }
        }

        private String validateFileMode(String mode) {
            // We currently only support the following modes: r, w, wt, wa, rw, rwt
            // Note: ideally, we should check against the allowed modes and throw a
            // SecurityException if the mode doesn't match any of them but to avoid app compat
            // issues, we're silently dropping bits which allow modifying files when the write bit
            // is not specified.
            if (mode != null && mode.indexOf('w') == -1) {
                // Don't allow truncation without write
                if (mode.indexOf('t') != -1) {
                    mode = mode.replace("t", "");
                }
                // Don't allow appending without write
                if (mode.indexOf('a') != -1) {
                    mode = mode.replace("a", "");
                }
            }
            return mode;
        }

        @Override
        public int checkUriPermission(@NonNull AttributionSource attributionSource, Uri uri,
                int uid, int modeFlags) {
Loading