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

Commit c9137615 authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'AddPrinters'

* changes:
  Create PrintDiscoverySession for future print services
  Update printer availability when printSpooler is paused. This makes the window update syncronously when in multi-window mode.
parents abef6d6f e3ce0a40
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -336,8 +336,8 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
    }

    @Override
    public void onResume() {
        super.onResume();
    public void onStart() {
        super.onStart();
        if (mState != STATE_INITIALIZING && mCurrentPrinter != null) {
            mPrinterRegistry.setTrackedPrinter(mCurrentPrinter.getId());
        }
@@ -379,10 +379,15 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
            }
        }

        super.onPause();
    }

    @Override
    protected void onStop() {
        mPrinterAvailabilityDetector.cancel();
        mPrinterRegistry.setTrackedPrinter(null);

        super.onPause();
        super.onStop();
    }

    @Override
+1 −3
Original line number Diff line number Diff line
@@ -343,9 +343,7 @@ final class UserState implements PrintSpoolerCallbacks, PrintServiceCallbacks {
    public void createPrinterDiscoverySession(IPrinterDiscoveryObserver observer) {
        synchronized (mLock) {
            throwIfDestroyedLocked();
            if (mActiveServices.isEmpty()) {
                return;
            }

            if (mPrinterDiscoverySession == null) {
                // If we do not have a session, tell all service to create one.
                mPrinterDiscoverySession = new PrinterDiscoverySessionMediator(mContext) {