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

Commit 940fa80c authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Handle all configuration changes in PrintActivity as it cannot be

destroyed synchronously.

Also: Always destroy print spooler provider when it was initialized to
      avoid service leakage if print activity was finished after
      onCreate but before onPrinterRegistryReady.

Bug: 27814338
Change-Id: I8401dc6e447cbd726b1a8f7c361b4ddf42e7e11d
parent 0997bc8a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@

        <activity
            android:name=".ui.PrintActivity"
            android:configChanges="screenSize|smallestScreenSize|orientation"
            android:configChanges="screenSize|smallestScreenSize|orientation|locale|keyboard|keyboardHidden|fontScale|uiMode|layoutDirection"
            android:permission="android.permission.BIND_PRINT_SPOOLER_SERVICE"
            android:theme="@style/Theme.PrintActivity">
            <intent-filter>
+4 −1
Original line number Diff line number Diff line
@@ -2051,9 +2051,12 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
            mDestinationSpinnerAdapter.unregisterDataSetObserver(mPrintersObserver);
        }

        if (mSpoolerProvider != null) {
            mSpoolerProvider.destroy();
        }

        if (mState != STATE_INITIALIZING) {
            mProgressMessageController.cancel();
            mSpoolerProvider.destroy();
            mPrintedDocument.finish();
            mPrintedDocument.destroy();
            mPrintPreviewController.destroy(new Runnable() {