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

Commit d1b1f6fc authored by Julius D'souza's avatar Julius D'souza Committed by Android (Google) Code Review
Browse files

Merge "Add SYNCHRONOUS to EnabledFlags for PackageManager"

parents 765719a2 92dbd38d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11908,6 +11908,7 @@ package android.content.pm {
    field public static final int SIGNATURE_NO_MATCH = -3; // 0xfffffffd
    field public static final int SIGNATURE_SECOND_NOT_SIGNED = -2; // 0xfffffffe
    field public static final int SIGNATURE_UNKNOWN_PACKAGE = -4; // 0xfffffffc
    field public static final int SYNCHRONOUS = 2; // 0x2
    field public static final int VERIFICATION_ALLOW = 1; // 0x1
    field public static final int VERIFICATION_REJECT = -1; // 0xffffffff
    field public static final int VERSION_CODE_HIGHEST = -1; // 0xffffffff
+11 −2
Original line number Diff line number Diff line
@@ -917,8 +917,9 @@ public abstract class PackageManager {
    public static final int INSTALL_DRY_RUN = 0x00800000;

    /** @hide */
    @IntDef(flag = true, prefix = { "DONT_KILL_APP" }, value = {
            DONT_KILL_APP
    @IntDef(flag = true, value = {
            DONT_KILL_APP,
            SYNCHRONOUS
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface EnabledFlags {}
@@ -931,6 +932,14 @@ public abstract class PackageManager {
     */
    public static final int DONT_KILL_APP = 0x00000001;

    /**
     * Flag parameter for
     * {@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate
     * that the given user's package restrictions state will be serialised to disk after the
     * component state has been updated.
     */
    public static final int SYNCHRONOUS = 0x00000002;

    /** @hide */
    @IntDef(prefix = { "INSTALL_REASON_" }, value = {
            INSTALL_REASON_UNKNOWN,
+15 −6
Original line number Diff line number Diff line
@@ -19980,7 +19980,11 @@ public class PackageManagerService extends IPackageManager.Stub
            }
        }
        synchronized (mLock) {
            if ((flags & PackageManager.SYNCHRONOUS) != 0) {
                flushPackageRestrictionsAsUserInternalLocked(userId);
            } else {
                scheduleWritePackageRestrictionsLocked(userId);
            }
            updateSequenceNumberLP(pkgSetting, new int[] { userId });
            final long callingId = Binder.clearCallingIdentity();
            try {
@@ -20041,13 +20045,18 @@ public class PackageManagerService extends IPackageManager.Stub
        mPermissionManager.enforceCrossUserPermission(Binder.getCallingUid(), userId, false /* requireFullPermission*/,
                false /* checkShell */, "flushPackageRestrictions");
        synchronized (mLock) {
            flushPackageRestrictionsAsUserInternalLocked(userId);
        }
    }
    @GuardedBy("mLock")
    private void flushPackageRestrictionsAsUserInternalLocked(int userId) {
        mSettings.writePackageRestrictionsLPr(userId);
        mDirtyUsers.remove(userId);
        if (mDirtyUsers.isEmpty()) {
            mHandler.removeMessages(WRITE_PACKAGE_RESTRICTIONS);
        }
    }
    }
    private void sendPackageChangedBroadcast(String packageName,
            boolean killFlag, ArrayList<String> componentNames, int packageUid) {