Rename to ObjectSandbox.
Flag: TEST_ONLY
Bug: 369504330
Test: go/testedequals
Change-Id: Iacfdc62270aa6f23e7c9b79205d967272e0a7a66
diff --git a/src/com/android/launcher3/util/MainThreadInitializedObject.java b/src/com/android/launcher3/util/MainThreadInitializedObject.java
index a7d5c13..9a70298 100644
--- a/src/com/android/launcher3/util/MainThreadInitializedObject.java
+++ b/src/com/android/launcher3/util/MainThreadInitializedObject.java
@@ -50,7 +50,7 @@
public T get(Context context) {
Context app = context.getApplicationContext();
- if (app instanceof SandboxApplication sc) {
+ if (app instanceof ObjectSandbox sc) {
return sc.getObject(this);
}
@@ -100,7 +100,8 @@
T get(Context context);
}
- public interface SandboxApplication {
+ /** Sandbox for isolating {@link MainThreadInitializedObject} instances from Launcher. */
+ public interface ObjectSandbox {
/**
* Find a cached object from mObjectMap if we have already created one. If not, generate
@@ -116,7 +117,7 @@
<T extends SafeCloseable> void putObject(MainThreadInitializedObject<T> object, T value);
/**
- * Returns whether this context should cleanup all objects when its destroyed or leave it
+ * Returns whether this sandbox should cleanup all objects when its destroyed or leave it
* to the GC.
* These objects can have listeners attached to the system server and mey not be able to get
* GCed themselves when running on a device.
@@ -137,7 +138,7 @@
* Abstract Context which allows custom implementations for
* {@link MainThreadInitializedObject} providers
*/
- public static class SandboxContext extends LauncherApplication implements SandboxApplication {
+ public static class SandboxContext extends LauncherApplication implements ObjectSandbox {
private static final String TAG = "SandboxContext";
@@ -159,8 +160,8 @@
@Override
public boolean shouldCleanUpOnDestroy() {
- return (getBaseContext().getApplicationContext() instanceof SandboxApplication sa)
- ? sa.shouldCleanUpOnDestroy() : true;
+ return (getBaseContext().getApplicationContext() instanceof ObjectSandbox os)
+ ? os.shouldCleanUpOnDestroy() : true;
}
public void onDestroy() {