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

Commit 4b6ec46c authored by François Degros's avatar François Degros
Browse files

Simplify CopyJob.getProgressNotification()

Remove duplicated code. This will make our task simpler when modifying
some of the progress messages.

Bug: 439976731
Flag: EXEMPT simplification without any functional change
Test: DocumentsUIGoogleTests:com.android.documentsui.services
Change-Id: I4ffbd6c903a42239ddf22a6b5140bfb8fb654ea4
parent 9cd44a81
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -81,11 +81,6 @@ final class CompressJob extends CopyJob {
        return getSetupNotification(service.getString(getRes(R.string.compress_preparing)));
        return getSetupNotification(service.getString(getRes(R.string.compress_preparing)));
    }
    }


    @Override
    public Notification getProgressNotification() {
        return getProgressNotification(getRes(R.string.copy_remaining));
    }

    @Override
    @Override
    public Notification getFailureNotification() {
    public Notification getFailureNotification() {
        return getFailureNotification(
        return getFailureNotification(
+3 −6
Original line number Original line Diff line number Diff line
@@ -150,17 +150,14 @@ class CopyJob extends ResolvedResourcesJob {
        return getSetupNotification(service.getString(getRes(R.string.copy_preparing)));
        return getSetupNotification(service.getString(getRes(R.string.copy_preparing)));
    }
    }


    Notification getProgressNotification(@StringRes int msgId) {
    @Override
    public Notification getProgressNotification() {
        final @StringRes int msgId = getRes(R.string.copy_remaining);
        mProgressTracker.update(mProgressBuilder, (remainingTime) -> service.getString(msgId,
        mProgressTracker.update(mProgressBuilder, (remainingTime) -> service.getString(msgId,
                FormatUtils.formatDuration(remainingTime)));
                FormatUtils.formatDuration(remainingTime)));
        return mProgressBuilder.build();
        return mProgressBuilder.build();
    }
    }


    @Override
    public Notification getProgressNotification() {
        return getProgressNotification(getRes(R.string.copy_remaining));
    }

    @Override
    @Override
    void finish() {
    void finish() {
        try {
        try {
+0 −5
Original line number Original line Diff line number Diff line
@@ -87,11 +87,6 @@ final class MoveJob extends CopyJob {
        return getSetupNotification(service.getString(getRes(R.string.move_preparing)));
        return getSetupNotification(service.getString(getRes(R.string.move_preparing)));
    }
    }


    @Override
    public Notification getProgressNotification() {
        return getProgressNotification(getRes(R.string.copy_remaining));
    }

    @Override
    @Override
    public Notification getFailureNotification() {
    public Notification getFailureNotification() {
        return getFailureNotification(
        return getFailureNotification(