Removing static Context access using LauncherAppState
> This ensures that LauncherAppState is only accessed in the presence of
a valid context
Bug: 33032833
Change-Id: I955e5cb022f8bd6374681ae6c0720a2666d5b750
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index d6c8cfb..8322f66 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -356,7 +356,7 @@
super.onCreate(savedInstanceState);
- LauncherAppState app = LauncherAppState.getInstance();
+ LauncherAppState app = LauncherAppState.getInstance(this);
// Load configuration-specific DeviceProfile
mDeviceProfile =
@@ -1815,7 +1815,7 @@
// been created. In this case, don't interfere with the new Launcher.
if (mModel.isCurrentCallbacks(this)) {
mModel.stopLoader();
- LauncherAppState.getInstance().setLauncher(null);
+ LauncherAppState.getInstance(this).setLauncher(null);
}
if (mRotationPrefChangeHandler != null) {