Fix crash when pasting on a root in the sidebar
When the right click menu "Paste into folder" is clicked from a root in the sidebar, it causes a crash. This is due to the DocumentStack being artificially created and the root and stack containing the same information. When the paste happens a new DocumentInfo is attempted to be merged with the existing one and these are identical which is what causes the crash. Fortunately this is not a truly necessary operation and is causing an extra copy of the DocumentStack to be created. Let's optimise and avoid recreating if we don't truly have to. Furthermore this adds a test that fails without the patch and succeeds with the patch. Fix: 403641008 Test: atest com.android.documentsui.SidebarUiTest Flag: EXEMPT bug fix Change-Id: If4e49b4dd1e118b9e3a1fdaa590e663f41b05941
Loading
Please register or sign in to comment