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

Commit 564560e4 authored by Svetoslav's avatar Svetoslav
Browse files

Installed and enabled print services not working after boot.

Due to system server changes the print manager services did not
receive the expected callbacks in correct order. This lead to
installed and enabled print services not working until toggled
from settings.

bug:16018217

Change-Id: I8d53d8d8f06507ee135cebe5201f00910a4cb364
parent b6efe90b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@ public final class PrintManagerService extends SystemService {
                    final UserState userState;
                    synchronized (mLock) {
                        userState = getCurrentUserStateLocked();
                        userState.updateIfNeededLocked();
                    }
                    // This is the first time we switch to this user after boot, so
                    // now is the time to remove obsolete print jobs since they
+4 −2
Original line number Diff line number Diff line
@@ -126,7 +126,8 @@ final class UserState implements PrintSpoolerCallbacks, PrintServiceCallbacks {
        mSpooler = new RemotePrintSpooler(context, userId, this);
        mHandler = new UserStateHandler(context.getMainLooper());
        synchronized (mLock) {
            enableSystemPrintServicesOnFirstBootLocked();
            enableSystemPrintServicesLocked();
            onConfigurationChangedLocked();
        }
    }

@@ -727,7 +728,7 @@ final class UserState implements PrintSpoolerCallbacks, PrintServiceCallbacks {
        }
    }

    private void enableSystemPrintServicesOnFirstBootLocked() {
    private void enableSystemPrintServicesLocked() {
        // Load enabled and installed services.
        readEnabledPrintServicesLocked();
        readInstalledPrintServicesLocked();
@@ -1159,6 +1160,7 @@ final class UserState implements PrintSpoolerCallbacks, PrintServiceCallbacks {
                Log.w(LOG_TAG, "Not destroying - session destroyed");
                return;
            }
            mIsDestroyed = true;
            // Make sure printer tracking is stopped.
            final int printerCount = mStateTrackedPrinters.size();
            for (int i = 0; i < printerCount; i++) {