summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/model
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-01-14 15:05:14 -0800
committerSunny Goyal <sunnygoyal@google.com>2017-01-24 22:55:36 -0800
commit81e44914500c7cc6204d25390f5999fa53559044 (patch)
tree47351a4711844daac366e2190b2c7b68e2237fef /src/com/android/launcher3/model
parentab45ec0c23a3e4b9d42f7fa93c83dcbdb02a726a (diff)
downloadandroid_packages_apps_Trebuchet-81e44914500c7cc6204d25390f5999fa53559044.tar.gz
android_packages_apps_Trebuchet-81e44914500c7cc6204d25390f5999fa53559044.tar.bz2
android_packages_apps_Trebuchet-81e44914500c7cc6204d25390f5999fa53559044.zip
Fixing loadWorkspace
> Adding checks on legacy shortcuts > Checking restore status based on package and not componentName Bug: 34123342 Change-Id: I442699e4ebb34ae66aa25c512bfcdc1b4fd5ae2a
Diffstat (limited to 'src/com/android/launcher3/model')
-rw-r--r--src/com/android/launcher3/model/LoaderCursor.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java
index 711be37b4..36f60b94b 100644
--- a/src/com/android/launcher3/model/LoaderCursor.java
+++ b/src/com/android/launcher3/model/LoaderCursor.java
@@ -50,6 +50,7 @@ import com.android.launcher3.util.GridOccupancy;
import com.android.launcher3.util.LongArrayMap;
import com.android.launcher3.util.PackageManagerHelper;
+import java.net.URISyntaxException;
import java.security.InvalidParameterException;
import java.util.ArrayList;
@@ -84,6 +85,7 @@ public class LoaderCursor extends CursorWrapper {
private final int cellYIndex;
private final int profileIdIndex;
private final int restoredIndex;
+ private final int intentIndex;
// Properties loaded per iteration
public long serialNumber;
@@ -114,6 +116,7 @@ public class LoaderCursor extends CursorWrapper {
cellYIndex = getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY);
profileIdIndex = getColumnIndexOrThrow(LauncherSettings.Favorites.PROFILE_ID);
restoredIndex = getColumnIndexOrThrow(LauncherSettings.Favorites.RESTORED);
+ intentIndex = getColumnIndexOrThrow(LauncherSettings.Favorites.INTENT);
}
@Override
@@ -131,6 +134,17 @@ public class LoaderCursor extends CursorWrapper {
return result;
}
+ public Intent parseIntent() {
+ String intentDescription = getString(intentIndex);
+ try {
+ return TextUtils.isEmpty(intentDescription) ?
+ null : Intent.parseUri(intentDescription, 0);
+ } catch (URISyntaxException e) {
+ Log.e(TAG, "Error parsing Intent");
+ return null;
+ }
+ }
+
public ShortcutInfo loadSimpleShortcut() {
final ShortcutInfo info = new ShortcutInfo();
// Non-app shortcuts are only supported for current user.