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

Commit ee0fb4e6 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge branch '3862-t-december' into 'v3.3-t'

Integrate december security patch

See merge request e/os/android_frameworks_base!314
parents ea5fbe24 1fdb5429
Loading
Loading
Loading
Loading
+21 −7
Original line number Diff line number Diff line
@@ -1398,22 +1398,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
@@ -167,7 +167,6 @@ interface INotificationManager
    void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim);
    void setInterruptionFilter(String pkg, int interruptionFilter);

    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);
+9 −0
Original line number Diff line number Diff line
@@ -147,6 +147,15 @@ public class KeyguardManager {
     */
    public static final String EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS = "check_dpm";

    /**
     * When switching to a secure user, system server will expect a callback when the UI has
     * completed the switch.
     *
     * @hide
     */
    public static final String LOCK_ON_USER_SWITCH_CALLBACK = "onSwitchCallback";


    /**
     *
     * Password lock type, see {@link #setLock}
+25 −4
Original line number Diff line number Diff line
@@ -477,13 +477,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_DATABASE, "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 {
@@ -498,13 +499,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_DATABASE, "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 {
@@ -666,6 +668,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) {
+30 −2
Original line number Diff line number Diff line
@@ -6868,12 +6868,20 @@ public abstract class PackageManager {
     * Intent.resolveActivity(PackageManager)} do.
     * </p>
     *
     * Use {@link #resolveActivityAsUser(Intent, String, ResolveInfoFlags, int)}
     * when long flags are needed.
     *
     * @param intent An intent containing all of the desired specification
     *            (action, data, type, category, and/or component).
     * @param resolvedType A nullable resolved type for the intent's data.
     *            Specified explicitly when the data type contained in the
     *            intent cannot be trusted. If null is provided, the type will
     *            be obtained from the intent using
     *            {@link Intent#resolveTypeIfNeeded}.
     * @param flags Additional option flags to modify the data returned. The
     *            most important is {@link #MATCH_DEFAULT_ONLY}, to limit the
     *            resolution to only those activities that support the
     *            {@link android.content.Intent#CATEGORY_DEFAULT}.
     *            {@link Intent#CATEGORY_DEFAULT}.
     * @param userId The user id.
     * @return Returns a ResolveInfo object containing the final activity intent
     *         that was determined to be the best action. Returns null if no
@@ -6883,6 +6891,26 @@ public abstract class PackageManager {
     * @hide
     * @deprecated Use {@link #resolveActivityAsUser(Intent, ResolveInfoFlags, int)} instead.
     */
    @Nullable
    public ResolveInfo resolveActivityAsUser(@NonNull Intent intent,
            @Nullable String resolvedType, int flags, @UserIdInt int userId) {
        return resolveActivityAsUser(intent, resolvedType, ResolveInfoFlags.of(flags), userId);
    }

    /**
     * See {@link #resolveActivityAsUser(Intent, String, int, int)}.
     * @hide
     */
    @Nullable
    public ResolveInfo resolveActivityAsUser(@NonNull Intent intent,
            @Nullable String resolvedType, @NonNull ResolveInfoFlags flags, @UserIdInt int userId) {
        throw new UnsupportedOperationException(
                "resolveActivityAsUser not implemented in subclass");
    }
     /**
     * See {@link #resolveActivityAsUser(Intent, String, int, int)}.
     * @hide
     */
    @Deprecated
    @SuppressWarnings("HiddenAbstractMethod")
    @Nullable
@@ -6891,7 +6919,7 @@ public abstract class PackageManager {
            int flags, @UserIdInt int userId);

    /**
     * See {@link #resolveActivityAsUser(Intent, int, int)}.
     * See {@link #resolveActivityAsUser(Intent, String, int, int)}.
     * @hide
     */
    @Nullable
Loading