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

Commit 7b4bb2f7 authored by Svetoslav's avatar Svetoslav Committed by Android Git Automerger
Browse files

am 4379bd75: am eccfe65f: am 6ce161d1: Merge "Cancel current work in...

am 4379bd75: am eccfe65f: am 6ce161d1: Merge "Cancel current work in PrintDocumentAdatper if printing is cancelled." into klp-dev

* commit '4379bd75':
  Cancel current work in PrintDocumentAdatper if printing is cancelled.
parents 9f30380d 4379bd75
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,4 +37,5 @@ oneway interface IPrintDocumentAdapter {
    void write(in PageRange[] pages, in ParcelFileDescriptor fd,
            IWriteResultCallback callback, int sequence);
    void finish();
    void cancel();
}
+12 −0
Original line number Diff line number Diff line
@@ -615,6 +615,18 @@ public final class PrintManager {
            }
        }

        @Override
        public void cancel() {
            // Start not called or finish called or destroyed - nothing to do.
            if (!mStartReqeusted || mFinishRequested || mDestroyed) {
                return;
            }
            // Request cancellation of pending work if needed.
            synchronized (mLock) {
                cancelPreviousCancellableOperationLocked();
            }
        }

        @Override
        public void onActivityPaused(Activity activity) {
            /* do nothing */
+3 −0
Original line number Diff line number Diff line
@@ -357,6 +357,9 @@ public class PrintJobConfigActivity extends Activity {
        }

        public void cancel() {
            if (isWorking()) {
                mRemotePrintAdapter.cancel();
            }
            mControllerState = CONTROLLER_STATE_CANCELLED;
        }

+11 −0
Original line number Diff line number Diff line
@@ -137,4 +137,15 @@ final class RemotePrintDocumentAdapter {
            Log.e(LOG_TAG, "Error calling finish()", re);
        }
    }

    public void cancel() {
        if (DEBUG) {
            Log.i(LOG_TAG, "cancel()");
        }
        try {
            mRemoteInterface.cancel();
        } catch (RemoteException re) {
            Log.e(LOG_TAG, "Error calling cancel()", re);
        }
    }
}