Use the right ClassLoader when restoring.

If we're restoring after a background process death, the Parcelable
creator cache is cold, and since we're handing in a null ClassLoader
the best the platform can do is try the default ClassLoader which
knows nothing about the running app.

That's why ClassLoaderCreator exists, so use it to snag the relevant
ClassLoader and pass it along.

Bug: 26075620
Change-Id: I6fd977d6178dd0f5f9c465597f5806a08097ac7c
diff --git a/packages/DocumentsUI/src/com/android/documentsui/State.java b/packages/DocumentsUI/src/com/android/documentsui/State.java
index 28f7432..d141de6 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/State.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/State.java
@@ -158,9 +158,14 @@
         out.writeInt(mStackTouched ? 1 : 0);
     }
 
-    public static final Creator<State> CREATOR = new Creator<State>() {
+    public static final ClassLoaderCreator<State> CREATOR = new ClassLoaderCreator<State>() {
         @Override
         public State createFromParcel(Parcel in) {
+            return createFromParcel(in, null);
+        }
+
+        @Override
+        public State createFromParcel(Parcel in, ClassLoader loader) {
             final State state = new State();
             state.action = in.readInt();
             state.acceptMimes = in.readStringArray();
@@ -174,9 +179,9 @@
             state.restored = in.readInt() != 0;
             DurableUtils.readFromParcel(in, state.stack);
             state.currentSearch = in.readString();
-            in.readMap(state.dirState, null);
-            in.readList(state.selectedDocumentsForCopy, null);
-            in.readList(state.excludedAuthorities, null);
+            in.readMap(state.dirState, loader);
+            in.readList(state.selectedDocumentsForCopy, loader);
+            in.readList(state.excludedAuthorities, loader);
             state.openableOnly = in.readInt() != 0;
             state.mStackTouched = in.readInt() != 0;
             return state;