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

Commit e41ce995 authored by Alexandra Gherghina's avatar Alexandra Gherghina
Browse files

Add hidden API for removing cross-profile package filters

Bug: 16646591
Change-Id: Iaf6837fe4390ac1018c49df366ea434776ed7244
parent fc4a648f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1613,6 +1613,18 @@ final class ApplicationPackageManager extends PackageManager {
        }
    }

    /**
     * @hide
     */
    public void removeCrossProfileIntentsForPackage(String packageName,
            int sourceUserId, int targetUserId) {
        try {
            mPM.removeCrossProfileIntentsForPackage(packageName, sourceUserId, targetUserId);
        } catch (RemoteException e) {
            // Should never happen!
        }
    }

    /**
     * @hide
     */
+3 −0
Original line number Diff line number Diff line
@@ -250,6 +250,9 @@ interface IPackageManager {
    void addCrossProfileIntentsForPackage(in String packageName, int sourceUserId,
            int targetUserId);

    void removeCrossProfileIntentsForPackage(String packageName, int sourceUserId,
            int targetUserId);

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

    /**
+9 −0
Original line number Diff line number Diff line
@@ -3770,6 +3770,15 @@ public abstract class PackageManager {
     */
    public abstract void addCrossProfileIntentsForPackage(String packageName,
            int sourceUserId, int targetUserId);

    /**
     * Removes all intents for {@link packageName} for user {@link sourceUserId} to user
     * {@link targetUserId}.
     * @hide
     */
    public abstract void removeCrossProfileIntentsForPackage(String packageName,
            int sourceUserId, int targetUserId);

    /**
     * @hide
     */
+1 −0
Original line number Diff line number Diff line
@@ -11669,6 +11669,7 @@ public class PackageManagerService extends IPackageManager.Stub {
        mSettings.writePackageRestrictionsLPr(sourceUserId);
    }
    @Override
    public void removeCrossProfileIntentsForPackage(String packageName,
            int sourceUserId, int targetUserId) {
        mContext.enforceCallingOrSelfPermission(
+9 −0
Original line number Diff line number Diff line
@@ -769,6 +769,15 @@ public class MockPackageManager extends PackageManager {
        throw new UnsupportedOperationException();
    }

    /**
     * @hide
     */
    @Override
    public void removeCrossProfileIntentsForPackage(String packageName, int sourceUserId,
            int targetUserId) {
        throw new UnsupportedOperationException();
    }

    /**
     * @hide
     */