Loading src/com/android/documentsui/AbstractActionHandler.java +9 −0 Original line number Diff line number Diff line Loading @@ -508,6 +508,14 @@ public abstract class AbstractActionHandler<T extends Activity & CommonAddons> protected abstract void launchToDefaultLocation(); protected void restoreRootAndDirectory() { if (!mState.stack.getRoot().isRecents() && mState.stack.isEmpty()) { mActivity.onRootPicked(mState.stack.getRoot()); } else { mActivity.restoreRootAndDirectory(); } } protected final void loadHomeDir() { loadRoot(Shared.getDefaultRootUri(mActivity)); } Loading Loading @@ -588,6 +596,7 @@ public abstract class AbstractActionHandler<T extends Activity & CommonAddons> * from our concrete activity implementations. */ public interface CommonAddons { void restoreRootAndDirectory(); void refreshCurrentRootAndDirectory(@AnimationType int anim); void onRootPicked(RootInfo root); // TODO: Move this to PickAddons as multi-document picking is exclusive to that activity. Loading src/com/android/documentsui/BaseActivity.java +11 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,17 @@ public abstract class BaseActivity mNavigator.update(); } @Override public void restoreRootAndDirectory() { // We're trying to restore stuff in document stack from saved instance. If we didn't have a // chance to spawn a fragment before we need to do it now. However if we spawned a fragment // already, system will automatically restore the fragment for us so we don't need to do // that manually this time. if (DirectoryFragment.get(getFragmentManager()) == null) { refreshCurrentRootAndDirectory(AnimationView.ANIM_NONE); } } /** * Refreshes the content of the director and the menu/action bar. * The current directory name and selection will get updated. Loading src/com/android/documentsui/files/ActionHandler.java +1 −0 Original line number Diff line number Diff line Loading @@ -398,6 +398,7 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa // previously stored state. if (mState.stack.isInitialized()) { if (DEBUG) Log.d(TAG, "Stack already resolved for uri: " + intent.getData()); restoreRootAndDirectory(); return; } Loading src/com/android/documentsui/picker/ActionHandler.java +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ class ActionHandler<T extends Activity & Addons> extends AbstractActionHandler<T // previously stored state. if (mState.stack.isInitialized()) { if (DEBUG) Log.d(TAG, "Stack already resolved for uri: " + intent.getData()); restoreRootAndDirectory(); return; } Loading tests/common/com/android/documentsui/TestActivity.java +7 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public abstract class TestActivity extends AbstractBase { public TestEventListener<Intent> startService; public TestEventListener<Pair<IntentSender, Integer>> startIntentSender; public TestEventListener<RootInfo> rootPicked; public TestEventListener<Void> restoreRootAndDirectory; public TestEventListener<Integer> refreshCurrentRootAndDirectory; public TestEventListener<Boolean> setRootsDrawerOpen; public TestEventListener<Uri> notifyDirectoryNavigated; Loading @@ -83,6 +84,7 @@ public abstract class TestActivity extends AbstractBase { startService = new TestEventListener<>(); startIntentSender = new TestEventListener<>(); rootPicked = new TestEventListener<>(); restoreRootAndDirectory = new TestEventListener<>(); refreshCurrentRootAndDirectory = new TestEventListener<>(); setRootsDrawerOpen = new TestEventListener<>(); notifyDirectoryNavigated = new TestEventListener<>(); Loading Loading @@ -152,6 +154,11 @@ public abstract class TestActivity extends AbstractBase { notifyDirectoryNavigated.accept(uri); } @Override public final void restoreRootAndDirectory() { restoreRootAndDirectory.accept(null); } @Override public final void refreshCurrentRootAndDirectory(int anim) { refreshCurrentRootAndDirectory.accept(anim); Loading Loading
src/com/android/documentsui/AbstractActionHandler.java +9 −0 Original line number Diff line number Diff line Loading @@ -508,6 +508,14 @@ public abstract class AbstractActionHandler<T extends Activity & CommonAddons> protected abstract void launchToDefaultLocation(); protected void restoreRootAndDirectory() { if (!mState.stack.getRoot().isRecents() && mState.stack.isEmpty()) { mActivity.onRootPicked(mState.stack.getRoot()); } else { mActivity.restoreRootAndDirectory(); } } protected final void loadHomeDir() { loadRoot(Shared.getDefaultRootUri(mActivity)); } Loading Loading @@ -588,6 +596,7 @@ public abstract class AbstractActionHandler<T extends Activity & CommonAddons> * from our concrete activity implementations. */ public interface CommonAddons { void restoreRootAndDirectory(); void refreshCurrentRootAndDirectory(@AnimationType int anim); void onRootPicked(RootInfo root); // TODO: Move this to PickAddons as multi-document picking is exclusive to that activity. Loading
src/com/android/documentsui/BaseActivity.java +11 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,17 @@ public abstract class BaseActivity mNavigator.update(); } @Override public void restoreRootAndDirectory() { // We're trying to restore stuff in document stack from saved instance. If we didn't have a // chance to spawn a fragment before we need to do it now. However if we spawned a fragment // already, system will automatically restore the fragment for us so we don't need to do // that manually this time. if (DirectoryFragment.get(getFragmentManager()) == null) { refreshCurrentRootAndDirectory(AnimationView.ANIM_NONE); } } /** * Refreshes the content of the director and the menu/action bar. * The current directory name and selection will get updated. Loading
src/com/android/documentsui/files/ActionHandler.java +1 −0 Original line number Diff line number Diff line Loading @@ -398,6 +398,7 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa // previously stored state. if (mState.stack.isInitialized()) { if (DEBUG) Log.d(TAG, "Stack already resolved for uri: " + intent.getData()); restoreRootAndDirectory(); return; } Loading
src/com/android/documentsui/picker/ActionHandler.java +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ class ActionHandler<T extends Activity & Addons> extends AbstractActionHandler<T // previously stored state. if (mState.stack.isInitialized()) { if (DEBUG) Log.d(TAG, "Stack already resolved for uri: " + intent.getData()); restoreRootAndDirectory(); return; } Loading
tests/common/com/android/documentsui/TestActivity.java +7 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public abstract class TestActivity extends AbstractBase { public TestEventListener<Intent> startService; public TestEventListener<Pair<IntentSender, Integer>> startIntentSender; public TestEventListener<RootInfo> rootPicked; public TestEventListener<Void> restoreRootAndDirectory; public TestEventListener<Integer> refreshCurrentRootAndDirectory; public TestEventListener<Boolean> setRootsDrawerOpen; public TestEventListener<Uri> notifyDirectoryNavigated; Loading @@ -83,6 +84,7 @@ public abstract class TestActivity extends AbstractBase { startService = new TestEventListener<>(); startIntentSender = new TestEventListener<>(); rootPicked = new TestEventListener<>(); restoreRootAndDirectory = new TestEventListener<>(); refreshCurrentRootAndDirectory = new TestEventListener<>(); setRootsDrawerOpen = new TestEventListener<>(); notifyDirectoryNavigated = new TestEventListener<>(); Loading Loading @@ -152,6 +154,11 @@ public abstract class TestActivity extends AbstractBase { notifyDirectoryNavigated.accept(uri); } @Override public final void restoreRootAndDirectory() { restoreRootAndDirectory.accept(null); } @Override public final void refreshCurrentRootAndDirectory(int anim) { refreshCurrentRootAndDirectory.accept(anim); Loading