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

Commit d2f840df authored by Ayush Sharma's avatar Ayush Sharma Committed by Android (Google) Code Review
Browse files

Merge "Reset call/sms cross profile intent filters"

parents f34fe47c 33e0aff4
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -3285,6 +3285,20 @@ public class ApplicationPackageManager extends PackageManager {
        }
        }
    }
    }


    /**
     * @hide
     */
    @Override
    public boolean removeCrossProfileIntentFilter(IntentFilter filter, int sourceUserId,
            int targetUserId, int flags) {
        try {
            return mPM.removeCrossProfileIntentFilter(filter, mContext.getOpPackageName(),
                    sourceUserId, targetUserId, flags);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
    /**
     * @hide
     * @hide
     */
     */
+3 −0
Original line number Original line Diff line number Diff line
@@ -281,6 +281,9 @@ interface IPackageManager {
    void addCrossProfileIntentFilter(in IntentFilter intentFilter, String ownerPackage,
    void addCrossProfileIntentFilter(in IntentFilter intentFilter, String ownerPackage,
            int sourceUserId, int targetUserId, int flags);
            int sourceUserId, int targetUserId, int flags);


    boolean removeCrossProfileIntentFilter(in IntentFilter intentFilter, String ownerPackage,
                int sourceUserId, int targetUserId, int flags);

    void clearCrossProfileIntentFilters(int sourceUserId, String ownerPackage);
    void clearCrossProfileIntentFilters(int sourceUserId, String ownerPackage);


    String[] setDistractingPackageRestrictionsAsUser(in String[] packageNames, int restrictionFlags,
    String[] setDistractingPackageRestrictionsAsUser(in String[] packageNames, int restrictionFlags,
+17 −0
Original line number Original line Diff line number Diff line
@@ -9632,6 +9632,23 @@ public abstract class PackageManager {
    public abstract void addCrossProfileIntentFilter(@NonNull IntentFilter filter,
    public abstract void addCrossProfileIntentFilter(@NonNull IntentFilter filter,
            @UserIdInt int sourceUserId, @UserIdInt int targetUserId, int flags);
            @UserIdInt int sourceUserId, @UserIdInt int targetUserId, int flags);


    /**
     * Removes all {@code CrossProfileIntentFilter}s which matches the specified intent filer,
     * source, target and flag.
     *
     * @param filter       The {@link IntentFilter} the intent has to match
     * @param sourceUserId The source user id.
     * @param targetUserId The target user id.
     * @param flags        The possible values are {@link #SKIP_CURRENT_PROFILE} and
     *                     {@link #ONLY_IF_NO_MATCH_FOUND}.
     * @hide
     */
    public boolean removeCrossProfileIntentFilter(@NonNull IntentFilter filter,
            @UserIdInt int sourceUserId, @UserIdInt int targetUserId, int flags) {
        throw new UnsupportedOperationException(
                "removeCrossProfileIntentFilter not implemented in subclass");
    }

    /**
    /**
     * Clearing {@code CrossProfileIntentFilter}s which have the specified user
     * Clearing {@code CrossProfileIntentFilter}s which have the specified user
     * as their source, and have been set by the app calling this method.
     * as their source, and have been set by the app calling this method.
+1 −1
Original line number Original line Diff line number Diff line
@@ -30,7 +30,7 @@ import java.lang.annotation.RetentionPolicy;
 * Representation of an immutable default cross-profile intent filter.
 * Representation of an immutable default cross-profile intent filter.
 */
 */
@Immutable
@Immutable
final class DefaultCrossProfileIntentFilter {
public final class DefaultCrossProfileIntentFilter {


    @IntDef({
    @IntDef({
            Direction.TO_PARENT,
            Direction.TO_PARENT,
+9 −0
Original line number Original line Diff line number Diff line
@@ -320,6 +320,15 @@ public class DefaultCrossProfileIntentFiltersUtils {
                MOBILE_NETWORK_SETTINGS);
                MOBILE_NETWORK_SETTINGS);
    }
    }


    /**
     * Returns default telephony related intent filters for managed profile.
     */
    public static List<DefaultCrossProfileIntentFilter> getDefaultManagedProfileTelephonyFilters() {
        return Arrays.asList(
                DIAL_DATA,
                SMS_MMS);
    }

    /**
    /**
     * Clone profile's DefaultCrossProfileIntentFilter
     * Clone profile's DefaultCrossProfileIntentFilter
     */
     */
Loading