summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherModel.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2014-01-08 14:04:34 -0800
committerDanesh M <daneshm90@gmail.com>2014-06-06 22:54:24 -0700
commit8dbb0433f18d9c92ba0bd410e38fdcca6793d3c7 (patch)
tree6900bd045ea536f90f9263777c495055ad73c4d3 /src/com/android/launcher3/LauncherModel.java
parent086a90198f35c2ce09eed8409306fceed49fe58e (diff)
downloadandroid_packages_apps_Trebuchet-8dbb0433f18d9c92ba0bd410e38fdcca6793d3c7.tar.gz
android_packages_apps_Trebuchet-8dbb0433f18d9c92ba0bd410e38fdcca6793d3c7.tar.bz2
android_packages_apps_Trebuchet-8dbb0433f18d9c92ba0bd410e38fdcca6793d3c7.zip
Adding migration Clings. (Bug 11973614)
- Refactoring Launcher cling code out to LauncherClings. Change-Id: Iff4f84f5b8bfeb69b1be0b4802022c3eb20b6f2c
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 8164fde6c..7ac564e60 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -90,7 +90,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();
@@ -193,9 +195,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;
@@ -230,6 +235,10 @@ public class LauncherModel extends BroadcastReceiver {
}
}
+ boolean canMigrateFromOldLauncherDb() {
+ return mOldContentProviderExists;
+ }
+
static boolean findNextAvailableIconSpaceInScreen(ArrayList<ItemInfo> items, int[] xy,
long screen) {
LauncherAppState app = LauncherAppState.getInstance();