summaryrefslogtreecommitdiff
path: root/src/com/android/launcher3/LauncherAppState.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2021-08-27 21:22:17 +0000
committerAlex Chau <alexchau@google.com>2021-08-31 10:51:52 +0000
commit777d49062ff241ad2d0cfa7d1b0cf01368d32b51 (patch)
tree5f6e1d84e61b438202402228dd6e6bfa7545716a /src/com/android/launcher3/LauncherAppState.java
parentee3814de1acbdc994e4d0862969019d5ee4f632f (diff)
Revert "Revert "Migrating all model tests to Instrumentation tests""
This reverts commit 7a4a30d86d471e6c45adc2a9907efb27e9b1799b. Test: Presubmit Reason for revert: Fixing original bug Bug: 196825541 Change-Id: Id4b1eb24a89564d264266d305aebea52917dfcd9
Diffstat (limited to 'src/com/android/launcher3/LauncherAppState.java')
-rw-r--r--src/com/android/launcher3/LauncherAppState.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 702b73afba..50808244ad 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -50,7 +50,7 @@ import com.android.launcher3.util.SimpleBroadcastReceiver;
import com.android.launcher3.util.Themes;
import com.android.launcher3.widget.custom.CustomWidgetManager;
-public class LauncherAppState {
+public class LauncherAppState implements SafeCloseable {
public static final String ACTION_FORCE_ROLOAD = "force-reload-launcher";
private static final String KEY_ICON_STATE = "pref_icon_shape_path";
@@ -158,7 +158,8 @@ public class LauncherAppState {
/**
* Call from Application.onTerminate(), which is not guaranteed to ever be called.
*/
- public void onTerminate() {
+ @Override
+ public void close() {
mModel.destroy();
mContext.getSystemService(LauncherApps.class).unregisterCallback(mModel);
CustomWidgetManager.INSTANCE.get(mContext).setWidgetRefreshCallback(null);