Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40be122b authored by Ben Lin's avatar Ben Lin Committed by Android (Google) Code Review
Browse files

Merge "Follow up changes from ag/1190582." into nyc-andromeda-dev

parents 07a30707 821727a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@
        android:duplicateParentState="true">

        <ImageView
            android:id="@+id/unmount_icon"
            android:id="@+id/eject_icon"
            android:layout_width="@dimen/root_icon_size"
            android:layout_height="match_parent"
            android:scaleType="centerInside"
+0 −1
Original line number Diff line number Diff line
@@ -103,7 +103,6 @@ public abstract class BaseActivity extends Activity

    abstract void onTaskFinished(Uri... uris);
    abstract void refreshDirectory(int anim);
    abstract void openRootSettings(RootInfo root);
    /** Allows sub-classes to include information in a newly created State instance. */
    abstract void includeState(State initialState);

+1 −6
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ public class DocumentsActivity extends BaseActivity {
                   mState.action == ACTION_CREATE ||
                   mState.action == ACTION_OPEN_TREE ||
                   mState.action == ACTION_PICK_COPY_DESTINATION) {
            RootsFragment.show(getFragmentManager(), null);
            RootsFragment.show(getFragmentManager(), (Intent) null);
        }

        if (mState.restored) {
@@ -232,11 +232,6 @@ public class DocumentsActivity extends BaseActivity {
        return true;
    }

    @Override
    void openRootSettings(RootInfo root) {
        throw new UnsupportedOperationException();
    }

    @Override
    void refreshDirectory(int anim) {
        final FragmentManager fm = getFragmentManager();
+14 −9
Original line number Diff line number Diff line
@@ -23,25 +23,30 @@ import android.net.Uri;
import android.provider.DocumentsContract;
import android.util.Log;

import java.util.function.BooleanSupplier;
import java.util.function.Consumer;

final class EjectRootTask
        extends CheckedTask<Void, Boolean> {
final class EjectRootTask extends CheckedTask<Void, Boolean> {
    private final String mAuthority;
    private final String mRootId;
    private final Consumer<Boolean> mListener;
    private final Consumer<Boolean> mCallback;
    private Context mContext;

    public EjectRootTask(Check check,
    /**
     * @param ejectCanceledCheck The method reference we use to see whether eject should be stopped
     * at any point
     * @param finishCallback The end callback necessary when the eject task finishes
     */
    public EjectRootTask(Context context,
            String authority,
            String rootId,
            Context context,
            Consumer<Boolean> listener) {
        super(check);
            BooleanSupplier ejectCanceledCheck,
            Consumer<Boolean> finishCallback) {
        super(ejectCanceledCheck::getAsBoolean);
        mAuthority = authority;
        mRootId = rootId;
        mContext = context;
        mListener = listener;
        mCallback = finishCallback;
    }

    @Override
@@ -65,6 +70,6 @@ final class EjectRootTask

    @Override
    protected void finish(Boolean ejected) {
        mListener.accept(ejected);
        mCallback.accept(ejected);
    }
}
 No newline at end of file
+1 −2
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ public class FilesActivity extends BaseActivity {
            }
        };

        RootsFragment.show(getFragmentManager(), null);
        RootsFragment.show(getFragmentManager(), this::openRootSettings);

        final Intent intent = getIntent();
        final Uri uri = intent.getData();
@@ -241,7 +241,6 @@ public class FilesActivity extends BaseActivity {
        return true;
    }

    @Override
    void openRootSettings(RootInfo root) {
        Metrics.logUserAction(this, Metrics.USER_ACTION_SETTINGS);
        final Intent intent = new Intent(DocumentsContract.ACTION_DOCUMENT_ROOT_SETTINGS);
Loading