Loading src/com/android/documentsui/BaseActivity.java +1 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,7 @@ public abstract class BaseActivity state.sortModel = SortModel.createModel(); state.localOnly = intent.getBooleanExtra(Intent.EXTRA_LOCAL_ONLY, false); state.excludedAuthorities = getExcludedAuthorities(); state.restrictScopeStorage = Shared.shouldRestrictStorageAccessFramework(this); includeState(state); Loading src/com/android/documentsui/base/State.java +4 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class State implements android.os.Parcelable { public boolean localOnly; public boolean openableOnly; public boolean restrictScopeStorage; /** * Represents whether the intent is a cross-profile intent Loading Loading @@ -171,6 +172,7 @@ public class State implements android.os.Parcelable { out.writeMap(dirConfigs); out.writeList(excludedAuthorities); out.writeInt(openableOnly ? 1 : 0); out.writeInt(restrictScopeStorage ? 1 : 0); out.writeParcelable(sortModel, 0); } Loading @@ -185,6 +187,7 @@ public class State implements android.os.Parcelable { + ", dirConfigs=" + dirConfigs + ", excludedAuthorities=" + excludedAuthorities + ", openableOnly=" + openableOnly + ", restrictScopeStorage=" + restrictScopeStorage + ", sortModel=" + sortModel + "}"; } Loading @@ -206,6 +209,7 @@ public class State implements android.os.Parcelable { in.readMap(state.dirConfigs, loader); in.readList(state.excludedAuthorities, loader); state.openableOnly = in.readInt() != 0; state.restrictScopeStorage = in.readInt() != 0; state.sortModel = in.readParcelable(loader); return state; } Loading src/com/android/documentsui/dirlist/Message.java +2 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,8 @@ abstract class Message { update(null, mEnv.getModel().info, null, mEnv.getContext().getDrawable(R.drawable.ic_dialog_info)); } else if (mEnv.getDisplayState().action == State.ACTION_OPEN_TREE && mEnv.getDisplayState().stack.peek().isBlockedFromTree()) { && mEnv.getDisplayState().stack.peek().isBlockedFromTree() && mEnv.getDisplayState().restrictScopeStorage) { updateBlockFromTreeMessage(); } } Loading src/com/android/documentsui/picker/PickActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -355,7 +355,8 @@ public class PickActivity extends BaseActivity implements ActionHandler.Addons { mState.action == ACTION_PICK_COPY_DESTINATION) { final PickFragment pick = PickFragment.get(fm); if (pick != null) { pick.setPickTarget(mState.action, mState.copyOperationSubType, cwd); pick.setPickTarget(mState.action, mState.copyOperationSubType, mState.restrictScopeStorage, cwd); } } } Loading src/com/android/documentsui/picker/PickFragment.java +5 −3 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ public class PickFragment extends Fragment { private Injector<ActionHandler<PickActivity>> mInjector; private int mAction; private boolean mRestrictScopeStorage; // Only legal values are OPERATION_COPY, OPERATION_COMPRESS, OPERATION_EXTRACT, // OPERATION_MOVE, and unset (OPERATION_UNKNOWN). private @OpType int mCopyOperationSubType = OPERATION_UNKNOWN; Loading Loading @@ -136,12 +137,13 @@ public class PickFragment extends Fragment { /** * @param action Which action defined in State is the picker shown for. */ public void setPickTarget( int action, @OpType int copyOperationSubType, DocumentInfo pickTarget) { public void setPickTarget(int action, @OpType int copyOperationSubType, boolean restrictScopeStorage, DocumentInfo pickTarget) { assert(copyOperationSubType != OPERATION_DELETE); mAction = action; mCopyOperationSubType = copyOperationSubType; mRestrictScopeStorage = restrictScopeStorage; mPickTarget = pickTarget; if (mContainer != null) { updateView(); Loading @@ -166,7 +168,7 @@ public class PickFragment extends Fragment { mPick.setText(getString(R.string.open_tree_button)); mPick.setWidth(Integer.MAX_VALUE); mCancel.setVisibility(View.GONE); mPick.setEnabled(!mPickTarget.isBlockedFromTree()); mPick.setEnabled(!(mPickTarget.isBlockedFromTree() && mRestrictScopeStorage)); break; case State.ACTION_PICK_COPY_DESTINATION: int titleId; Loading Loading
src/com/android/documentsui/BaseActivity.java +1 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,7 @@ public abstract class BaseActivity state.sortModel = SortModel.createModel(); state.localOnly = intent.getBooleanExtra(Intent.EXTRA_LOCAL_ONLY, false); state.excludedAuthorities = getExcludedAuthorities(); state.restrictScopeStorage = Shared.shouldRestrictStorageAccessFramework(this); includeState(state); Loading
src/com/android/documentsui/base/State.java +4 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class State implements android.os.Parcelable { public boolean localOnly; public boolean openableOnly; public boolean restrictScopeStorage; /** * Represents whether the intent is a cross-profile intent Loading Loading @@ -171,6 +172,7 @@ public class State implements android.os.Parcelable { out.writeMap(dirConfigs); out.writeList(excludedAuthorities); out.writeInt(openableOnly ? 1 : 0); out.writeInt(restrictScopeStorage ? 1 : 0); out.writeParcelable(sortModel, 0); } Loading @@ -185,6 +187,7 @@ public class State implements android.os.Parcelable { + ", dirConfigs=" + dirConfigs + ", excludedAuthorities=" + excludedAuthorities + ", openableOnly=" + openableOnly + ", restrictScopeStorage=" + restrictScopeStorage + ", sortModel=" + sortModel + "}"; } Loading @@ -206,6 +209,7 @@ public class State implements android.os.Parcelable { in.readMap(state.dirConfigs, loader); in.readList(state.excludedAuthorities, loader); state.openableOnly = in.readInt() != 0; state.restrictScopeStorage = in.readInt() != 0; state.sortModel = in.readParcelable(loader); return state; } Loading
src/com/android/documentsui/dirlist/Message.java +2 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,8 @@ abstract class Message { update(null, mEnv.getModel().info, null, mEnv.getContext().getDrawable(R.drawable.ic_dialog_info)); } else if (mEnv.getDisplayState().action == State.ACTION_OPEN_TREE && mEnv.getDisplayState().stack.peek().isBlockedFromTree()) { && mEnv.getDisplayState().stack.peek().isBlockedFromTree() && mEnv.getDisplayState().restrictScopeStorage) { updateBlockFromTreeMessage(); } } Loading
src/com/android/documentsui/picker/PickActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -355,7 +355,8 @@ public class PickActivity extends BaseActivity implements ActionHandler.Addons { mState.action == ACTION_PICK_COPY_DESTINATION) { final PickFragment pick = PickFragment.get(fm); if (pick != null) { pick.setPickTarget(mState.action, mState.copyOperationSubType, cwd); pick.setPickTarget(mState.action, mState.copyOperationSubType, mState.restrictScopeStorage, cwd); } } } Loading
src/com/android/documentsui/picker/PickFragment.java +5 −3 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ public class PickFragment extends Fragment { private Injector<ActionHandler<PickActivity>> mInjector; private int mAction; private boolean mRestrictScopeStorage; // Only legal values are OPERATION_COPY, OPERATION_COMPRESS, OPERATION_EXTRACT, // OPERATION_MOVE, and unset (OPERATION_UNKNOWN). private @OpType int mCopyOperationSubType = OPERATION_UNKNOWN; Loading Loading @@ -136,12 +137,13 @@ public class PickFragment extends Fragment { /** * @param action Which action defined in State is the picker shown for. */ public void setPickTarget( int action, @OpType int copyOperationSubType, DocumentInfo pickTarget) { public void setPickTarget(int action, @OpType int copyOperationSubType, boolean restrictScopeStorage, DocumentInfo pickTarget) { assert(copyOperationSubType != OPERATION_DELETE); mAction = action; mCopyOperationSubType = copyOperationSubType; mRestrictScopeStorage = restrictScopeStorage; mPickTarget = pickTarget; if (mContainer != null) { updateView(); Loading @@ -166,7 +168,7 @@ public class PickFragment extends Fragment { mPick.setText(getString(R.string.open_tree_button)); mPick.setWidth(Integer.MAX_VALUE); mCancel.setVisibility(View.GONE); mPick.setEnabled(!mPickTarget.isBlockedFromTree()); mPick.setEnabled(!(mPickTarget.isBlockedFromTree() && mRestrictScopeStorage)); break; case State.ACTION_PICK_COPY_DESTINATION: int titleId; Loading