Loading core/java/android/content/pm/PackageManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -983,7 +983,8 @@ public abstract class PackageManager { * 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. * component state has been updated. Note that this is synchronous disk access, so calls using * this flag should be run on a background thread. */ public static final int SYNCHRONOUS = 0x00000002; Loading services/core/java/android/content/pm/PackageManagerInternal.java +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.annotation.WorkerThread; import android.content.ComponentName; import android.content.ContentResolver; import android.content.Intent; Loading Loading @@ -261,6 +262,7 @@ public abstract class PackageManagerInternal { /** * Flushes package restrictions for the given user immediately to disk. */ @WorkerThread public abstract void flushPackageRestrictions(int userId); /** Loading services/core/java/com/android/server/pm/PackageManagerService.java +4 −1 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.annotation.WorkerThread; import android.app.ActivityManager; import android.app.AppOpsManager; import android.app.ApplicationPackageManager; Loading Loading @@ -213,7 +214,6 @@ import android.content.pm.dex.ArtManager; import android.content.pm.dex.DexMetadataHelper; import android.content.pm.dex.IArtManager; import android.content.pm.parsing.PackageInfoWithoutStateUtils; import android.content.pm.parsing.ParsingPackageRead; import android.content.pm.parsing.ParsingPackageUtils; import android.content.pm.parsing.component.ParsedActivity; import android.content.pm.parsing.component.ParsedInstrumentation; Loading Loading @@ -20180,6 +20180,7 @@ public class PackageManagerService extends IPackageManager.Stub } } @WorkerThread @Override public void flushPackageRestrictionsAsUser(int userId) { if (getInstantAppPackageName(Binder.getCallingUid()) != null) { Loading @@ -20197,6 +20198,8 @@ public class PackageManagerService extends IPackageManager.Stub @GuardedBy("mLock") private void flushPackageRestrictionsAsUserInternalLocked(int userId) { // NOTE: this invokes synchronous disk access, so callers using this // method should consider running on a background thread mSettings.writePackageRestrictionsLPr(userId); mDirtyUsers.remove(userId); if (mDirtyUsers.isEmpty()) { Loading
core/java/android/content/pm/PackageManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -983,7 +983,8 @@ public abstract class PackageManager { * 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. * component state has been updated. Note that this is synchronous disk access, so calls using * this flag should be run on a background thread. */ public static final int SYNCHRONOUS = 0x00000002; Loading
services/core/java/android/content/pm/PackageManagerInternal.java +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.annotation.WorkerThread; import android.content.ComponentName; import android.content.ContentResolver; import android.content.Intent; Loading Loading @@ -261,6 +262,7 @@ public abstract class PackageManagerInternal { /** * Flushes package restrictions for the given user immediately to disk. */ @WorkerThread public abstract void flushPackageRestrictions(int userId); /** Loading
services/core/java/com/android/server/pm/PackageManagerService.java +4 −1 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.annotation.WorkerThread; import android.app.ActivityManager; import android.app.AppOpsManager; import android.app.ApplicationPackageManager; Loading Loading @@ -213,7 +214,6 @@ import android.content.pm.dex.ArtManager; import android.content.pm.dex.DexMetadataHelper; import android.content.pm.dex.IArtManager; import android.content.pm.parsing.PackageInfoWithoutStateUtils; import android.content.pm.parsing.ParsingPackageRead; import android.content.pm.parsing.ParsingPackageUtils; import android.content.pm.parsing.component.ParsedActivity; import android.content.pm.parsing.component.ParsedInstrumentation; Loading Loading @@ -20180,6 +20180,7 @@ public class PackageManagerService extends IPackageManager.Stub } } @WorkerThread @Override public void flushPackageRestrictionsAsUser(int userId) { if (getInstantAppPackageName(Binder.getCallingUid()) != null) { Loading @@ -20197,6 +20198,8 @@ public class PackageManagerService extends IPackageManager.Stub @GuardedBy("mLock") private void flushPackageRestrictionsAsUserInternalLocked(int userId) { // NOTE: this invokes synchronous disk access, so callers using this // method should consider running on a background thread mSettings.writePackageRestrictionsLPr(userId); mDirtyUsers.remove(userId); if (mDirtyUsers.isEmpty()) {