More preventing recursive folders

Change-Id: I0a7cb210b5e15962c06eaf0ebc83b1120c91e2a6
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java
index 3d579a9..b8fe45e 100644
--- a/src/com/android/browser/AddBookmarkPage.java
+++ b/src/com/android/browser/AddBookmarkPage.java
@@ -405,7 +405,12 @@
                 mCurrentFolder = info.parentId;
                 onCurrentFolderFound();
             }
-            if (info.lastUsedId != -1 && info.lastUsedId != info.id) {
+            // TODO: Detect if lastUsedId is a subfolder of info.id in the
+            // editing folder case. For now, just don't show the last used
+            // folder at all to prevent any chance of the user adding a parent
+            // folder to a child folder
+            if (info.lastUsedId != -1 && info.lastUsedId != info.id
+                    && !mEditingFolder) {
                 if (setAccount && info.lastUsedId != mRootFolder
                         && TextUtils.equals(info.lastUsedAccountName, info.accountName)
                         && TextUtils.equals(info.lastUsedAccountType, info.accountType)) {