Introduced AppRestrictionsLock
It is used to serialize access to app restrictions state and reduce
contention on PM lock.
Bug: 65096648
Test: com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testApplicationRestrictions
Change-Id: I87c364e641e511f6cbe1e55f4fa3aa12c453c08f
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceTest.java
index 9f77297..d136614 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceTest.java
@@ -55,11 +55,11 @@
public void testWriteReadApplicationRestrictions() throws IOException {
AtomicFile atomicFile = new AtomicFile(restrictionsFile);
Bundle bundle = createBundle();
- UserManagerService.writeApplicationRestrictionsLP(bundle, atomicFile);
+ UserManagerService.writeApplicationRestrictionsLAr(bundle, atomicFile);
assertTrue(atomicFile.getBaseFile().exists());
String s = FileUtils.readTextFile(restrictionsFile, 10000, "");
System.out.println("restrictionsFile: " + s);
- bundle = UserManagerService.readApplicationRestrictionsLP(atomicFile);
+ bundle = UserManagerService.readApplicationRestrictionsLAr(atomicFile);
System.out.println("readApplicationRestrictionsLocked bundle: " + bundle);
assertBundle(bundle);
}