Loading core/java/android/app/PropertyInvalidatedCache.java +6 −1 Original line number Diff line number Diff line Loading @@ -953,7 +953,12 @@ public class PropertyInvalidatedCache<Query, Result> { public static void setTestMode(boolean mode) { synchronized (sGlobalLock) { if (sTestMode == mode) { throw new IllegalStateException("cannot set test mode redundantly: mode=" + mode); final String msg = "cannot set test mode redundantly: mode=" + mode; if (Flags.enforcePicTestmodeProtocol()) { throw new IllegalStateException(msg); } else { Log.e(TAG, msg); } } sTestMode = mode; if (mode) { Loading core/java/android/app/performance.aconfig +9 −0 Original line number Diff line number Diff line Loading @@ -9,3 +9,12 @@ flag { description: "PropertyInvalidatedCache uses shared memory for nonces." bug: "366552454" } flag { namespace: "system_performance" name: "enforce_pic_testmode_protocol" is_exported: true is_fixed_read_only: true description: "Enforce PropertyInvalidatedCache.setTestMode() protocol" bug: "366552454" } core/tests/coretests/src/android/app/PropertyInvalidatedCacheTests.java +3 −1 Original line number Diff line number Diff line Loading @@ -425,7 +425,9 @@ public class PropertyInvalidatedCacheTests { PropertyInvalidatedCache.setTestMode(false); try { PropertyInvalidatedCache.setTestMode(false); if (Flags.enforcePicTestmodeProtocol()) { fail("expected an IllegalStateException"); } } catch (IllegalStateException e) { // The expected exception. } Loading core/tests/coretests/src/android/os/IpcDataCacheTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -489,7 +489,9 @@ public class IpcDataCacheTest { IpcDataCache.setTestMode(false); try { IpcDataCache.setTestMode(false); if (android.app.Flags.enforcePicTestmodeProtocol()) { fail("expected an IllegalStateException"); } } catch (IllegalStateException e) { // The expected exception. } Loading Loading
core/java/android/app/PropertyInvalidatedCache.java +6 −1 Original line number Diff line number Diff line Loading @@ -953,7 +953,12 @@ public class PropertyInvalidatedCache<Query, Result> { public static void setTestMode(boolean mode) { synchronized (sGlobalLock) { if (sTestMode == mode) { throw new IllegalStateException("cannot set test mode redundantly: mode=" + mode); final String msg = "cannot set test mode redundantly: mode=" + mode; if (Flags.enforcePicTestmodeProtocol()) { throw new IllegalStateException(msg); } else { Log.e(TAG, msg); } } sTestMode = mode; if (mode) { Loading
core/java/android/app/performance.aconfig +9 −0 Original line number Diff line number Diff line Loading @@ -9,3 +9,12 @@ flag { description: "PropertyInvalidatedCache uses shared memory for nonces." bug: "366552454" } flag { namespace: "system_performance" name: "enforce_pic_testmode_protocol" is_exported: true is_fixed_read_only: true description: "Enforce PropertyInvalidatedCache.setTestMode() protocol" bug: "366552454" }
core/tests/coretests/src/android/app/PropertyInvalidatedCacheTests.java +3 −1 Original line number Diff line number Diff line Loading @@ -425,7 +425,9 @@ public class PropertyInvalidatedCacheTests { PropertyInvalidatedCache.setTestMode(false); try { PropertyInvalidatedCache.setTestMode(false); if (Flags.enforcePicTestmodeProtocol()) { fail("expected an IllegalStateException"); } } catch (IllegalStateException e) { // The expected exception. } Loading
core/tests/coretests/src/android/os/IpcDataCacheTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -489,7 +489,9 @@ public class IpcDataCacheTest { IpcDataCache.setTestMode(false); try { IpcDataCache.setTestMode(false); if (android.app.Flags.enforcePicTestmodeProtocol()) { fail("expected an IllegalStateException"); } } catch (IllegalStateException e) { // The expected exception. } Loading