summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherProvider.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-11-24 13:12:32 -0800
committerSunny Goyal <sunnygoyal@google.com>2015-11-24 13:12:32 -0800
commit0c34443406cd441566dd1d51d05a431a974f8edd (patch)
tree6b34fa89c9c5b2f105ecb84b2e11dc1e0371efb6 /src/com/android/launcher3/LauncherProvider.java
parented3563a279ea270ae70d3be115b676e0363eb052 (diff)
parent7bce5f7988d63e6f64db4b8482f781cc63820246 (diff)
downloadandroid_packages_apps_Trebuchet-0c34443406cd441566dd1d51d05a431a974f8edd.tar.gz
android_packages_apps_Trebuchet-0c34443406cd441566dd1d51d05a431a974f8edd.tar.bz2
android_packages_apps_Trebuchet-0c34443406cd441566dd1d51d05a431a974f8edd.zip
resolve merge conflicts of 7bce5f7988 to ub-launcher3-master.
Change-Id: Id352ce219bed7701956bb462ea2dd0a5aebe7317
Diffstat (limited to 'src/com/android/launcher3/LauncherProvider.java')
-rw-r--r--src/com/android/launcher3/LauncherProvider.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index 17e282048..6598644a8 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -83,6 +83,10 @@ public class LauncherProvider extends ContentProvider {
@Override
public boolean onCreate() {
final Context context = getContext();
+ // The content provider exists for the entire duration of the launcher main process and
+ // is the first component to get created. Initializing application context here ensures
+ // that LauncherAppState always exists in the main process.
+ LauncherAppState.setApplicationContext(context.getApplicationContext());
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
mOpenHelper = new DatabaseHelper(context);
StrictMode.setThreadPolicy(oldPolicy);