summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherModel.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2014-01-10 23:40:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-01-10 23:40:40 +0000
commit234b506f4625b23172d437a2ba0b47d63cc2e3dd (patch)
tree9d521b162214586b1c3ce917ad9f8678fede55b5 /src/com/android/launcher3/LauncherModel.java
parent8b5b05b7f3c8c5d705116c425bd5dbff2b75d56a (diff)
parenta694524047fda0a51dede4eefb1201a598d2d3a7 (diff)
downloadandroid_packages_apps_Trebuchet-234b506f4625b23172d437a2ba0b47d63cc2e3dd.tar.gz
android_packages_apps_Trebuchet-234b506f4625b23172d437a2ba0b47d63cc2e3dd.tar.bz2
android_packages_apps_Trebuchet-234b506f4625b23172d437a2ba0b47d63cc2e3dd.zip
Merge "Adding migration Clings. (Bug 11973614)" into jb-ub-now-kermit
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r--src/com/android/launcher3/LauncherModel.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 2559d3db0..d271976a7 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -81,7 +81,9 @@ public class LauncherModel extends BroadcastReceiver {
private static final int ITEMS_CHUNK = 6; // batch size for the workspace icons
private static final long INVALID_SCREEN_ID = -1L;
+
private final boolean mAppsCanBeOnRemoveableStorage;
+ private final boolean mOldContentProviderExists;
private final LauncherAppState mApp;
private final Object mLock = new Object();
@@ -185,9 +187,12 @@ public class LauncherModel extends BroadcastReceiver {
}
LauncherModel(LauncherAppState app, IconCache iconCache, AppFilter appFilter) {
- final Context context = app.getContext();
+ Context context = app.getContext();
+ ContentResolver contentResolver = context.getContentResolver();
mAppsCanBeOnRemoveableStorage = Environment.isExternalStorageRemovable();
+ mOldContentProviderExists = (contentResolver.acquireContentProviderClient(
+ LauncherSettings.Favorites.OLD_CONTENT_URI) != null);
mApp = app;
mBgAllAppsList = new AllAppsList(iconCache, appFilter);
mIconCache = iconCache;
@@ -222,6 +227,10 @@ public class LauncherModel extends BroadcastReceiver {
}
}
+ boolean canMigrateFromOldLauncherDb() {
+ return mOldContentProviderExists;
+ }
+
static boolean findNextAvailableIconSpaceInScreen(ArrayList<ItemInfo> items, int[] xy,
long screen) {
LauncherAppState app = LauncherAppState.getInstance();