summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Shvadskiy <ashvadskiy@cyngn.com>2015-12-10 00:04:48 (GMT)
committerArtem Shvadskiy <ashvadskiy@cyngn.com>2015-12-10 00:31:27 (GMT)
commit174345ec50101d61f9b1950d4c30afcb962de7e2 (patch)
treea5b9109c79bc162eb809901f99cef0ab3695f4e0
parent57f0a5ecd4afd88659a36fdb698942b0c0cfda9e (diff)
downloadandroid_packages_apps_Trebuchet-174345ec50101d61f9b1950d4c30afcb962de7e2.zip
android_packages_apps_Trebuchet-174345ec50101d61f9b1950d4c30afcb962de7e2.tar.gz
android_packages_apps_Trebuchet-174345ec50101d61f9b1950d4c30afcb962de7e2.tar.bz2
Prevent remote folder from accepting or removing items by user.
Patch 2: Rebase and use isRemote() instead of checking subType manually. Change-Id: If3954cfea1e26fc92de8818e68d732d2a5aeaa7b issue-id: CYNGNOS-1410
-rw-r--r--src/com/android/launcher3/FolderIcon.java4
-rw-r--r--src/com/android/launcher3/RemoteFolder.java6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java
index c414856..33787ab 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -373,10 +373,14 @@ public class FolderIcon extends FrameLayout implements FolderListener {
}
private boolean willAcceptItem(ItemInfo item) {
+ if (mInfo.isRemote()) return false;
+
final int itemType = item.itemType;
boolean hidden = false;
if (item instanceof FolderInfo){
+ if (((FolderInfo) item).isRemote()) return false;
+
hidden = ((FolderInfo) item).hidden;
}
return ((itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
diff --git a/src/com/android/launcher3/RemoteFolder.java b/src/com/android/launcher3/RemoteFolder.java
index 9478ea6..1364894 100644
--- a/src/com/android/launcher3/RemoteFolder.java
+++ b/src/com/android/launcher3/RemoteFolder.java
@@ -173,6 +173,12 @@ public class RemoteFolder extends Folder {
}
}
+ @Override
+ public boolean onLongClick(View v) {
+ // Eat the event without doing anything. We do not allow users to remove items.
+ return true;
+ }
+
private void toggleInfoPane() {
if (mFolderHelpText.getVisibility() == VISIBLE) {
// info ImageView becomes a close "X" when the help text is showing, handle accordingly