Loading packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +2 −2 Original line number Diff line number Diff line Loading @@ -295,14 +295,14 @@ public class DocumentsActivity extends Activity { .query(RecentsProvider.buildResume(packageName), null, null, null, null); try { if (cursor.moveToFirst()) { mExternal = cursor.getInt(cursor.getColumnIndex(ResumeColumns.EXTERNAL)) != 0; final byte[] rawStack = cursor.getBlob( cursor.getColumnIndex(ResumeColumns.STACK)); DurableUtils.readFromArray(rawStack, mState.stack); mRestoredStack = true; mExternal = cursor.getInt(cursor.getColumnIndex(ResumeColumns.EXTERNAL)) != 0; } } catch (IOException e) { Log.w(TAG, "Failed to resume", e); Log.w(TAG, "Failed to resume: " + e); } finally { IoUtils.closeQuietly(cursor); } Loading packages/DocumentsUI/src/com/android/documentsui/RecentsCreateFragment.java +2 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.widget.TextView; import com.android.documentsui.DocumentsActivity.State; import com.android.documentsui.RecentsProvider.RecentColumns; import com.android.documentsui.model.DocumentStack; import com.android.documentsui.model.DurableUtils; import com.android.documentsui.model.RootInfo; import com.google.android.collect.Lists; Loading Loading @@ -160,7 +161,7 @@ public class RecentsCreateFragment extends Fragment { cursor.getColumnIndex(RecentColumns.STACK)); try { final DocumentStack stack = new DocumentStack(); stack.read(new DataInputStream(new ByteArrayInputStream(rawStack))); DurableUtils.readFromArray(rawStack, stack); // Only update root here to avoid spinning up all // providers; we update the stack during the actual Loading packages/DocumentsUI/src/com/android/documentsui/model/DurableUtils.java +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ public class DurableUtils { } public static <D extends Durable> D readFromArray(byte[] data, D d) throws IOException { if (data == null) throw new IOException("Missing data"); final ByteArrayInputStream in = new ByteArrayInputStream(data); d.reset(); try { Loading Loading
packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +2 −2 Original line number Diff line number Diff line Loading @@ -295,14 +295,14 @@ public class DocumentsActivity extends Activity { .query(RecentsProvider.buildResume(packageName), null, null, null, null); try { if (cursor.moveToFirst()) { mExternal = cursor.getInt(cursor.getColumnIndex(ResumeColumns.EXTERNAL)) != 0; final byte[] rawStack = cursor.getBlob( cursor.getColumnIndex(ResumeColumns.STACK)); DurableUtils.readFromArray(rawStack, mState.stack); mRestoredStack = true; mExternal = cursor.getInt(cursor.getColumnIndex(ResumeColumns.EXTERNAL)) != 0; } } catch (IOException e) { Log.w(TAG, "Failed to resume", e); Log.w(TAG, "Failed to resume: " + e); } finally { IoUtils.closeQuietly(cursor); } Loading
packages/DocumentsUI/src/com/android/documentsui/RecentsCreateFragment.java +2 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.widget.TextView; import com.android.documentsui.DocumentsActivity.State; import com.android.documentsui.RecentsProvider.RecentColumns; import com.android.documentsui.model.DocumentStack; import com.android.documentsui.model.DurableUtils; import com.android.documentsui.model.RootInfo; import com.google.android.collect.Lists; Loading Loading @@ -160,7 +161,7 @@ public class RecentsCreateFragment extends Fragment { cursor.getColumnIndex(RecentColumns.STACK)); try { final DocumentStack stack = new DocumentStack(); stack.read(new DataInputStream(new ByteArrayInputStream(rawStack))); DurableUtils.readFromArray(rawStack, stack); // Only update root here to avoid spinning up all // providers; we update the stack during the actual Loading
packages/DocumentsUI/src/com/android/documentsui/model/DurableUtils.java +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ public class DurableUtils { } public static <D extends Durable> D readFromArray(byte[] data, D d) throws IOException { if (data == null) throw new IOException("Missing data"); final ByteArrayInputStream in = new ByteArrayInputStream(data); d.reset(); try { Loading