diff options
author | Svetoslav <svetoslavganov@google.com> | 2013-09-10 21:08:32 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2013-09-12 10:52:26 -0700 |
commit | c6066799ad130140159230d14451b429eb828755 (patch) | |
tree | 43145c16aae37124e167c1edde05c4376e0b69e2 /packages/PrintSpooler/src/com/android | |
parent | 16dae5997bb0ff7f03d5a0ccfdc4be94aa35ba51 (diff) | |
download | frameworks_base-c6066799ad130140159230d14451b429eb828755.zip frameworks_base-c6066799ad130140159230d14451b429eb828755.tar.gz frameworks_base-c6066799ad130140159230d14451b429eb828755.tar.bz2 |
Handle print serivce crashes.
1. Now after a print service crashes we are bringing it to the same
state of its lifecycle. For example, if a service does a discovery
and crashes we recreate the discovery session call the start
discovery method and so on.
2. Turned off debugging logs since we have fully fledged state dump.
bug:10697779
Change-Id: Id790537461428e96b197eef12258996bda2bd1ce
Diffstat (limited to 'packages/PrintSpooler/src/com/android')
3 files changed, 7 insertions, 22 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java b/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java index 7d6ca56..e47bf0c 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java +++ b/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java @@ -57,7 +57,7 @@ import java.util.Map; public class FusedPrintersProvider extends Loader<List<PrinterInfo>> { private static final String LOG_TAG = "FusedPrintersProvider"; - private static final boolean DEBUG = true && Build.IS_DEBUGGABLE; + private static final boolean DEBUG = false; private static final double WEIGHT_DECAY_COEFFICIENT = 0.95f; diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java b/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java index 7266af8..76e548a 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java +++ b/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java @@ -73,9 +73,9 @@ public final class PrintSpoolerService extends Service { private static final String LOG_TAG = "PrintSpoolerService"; - private static final boolean DEBUG_PRINT_JOB_LIFECYCLE = true; + private static final boolean DEBUG_PRINT_JOB_LIFECYCLE = false; - private static final boolean DEBUG_PERSISTENCE = true; + private static final boolean DEBUG_PERSISTENCE = false; private static final boolean PERSISTNECE_MANAGER_ENABLED = true; @@ -838,18 +838,8 @@ public final class PrintSpoolerService extends Service { resolution.getHorizontalDpi())); serializer.attribute(null, ATTR_VERTICAL_DPI, String.valueOf( resolution.getVerticalDpi())); - // We prefer to store only the package name and - // resource id and fallback to the label. - if (!TextUtils.isEmpty(mediaSize.mPackageName) - && resolution.mLabelResId > 0) { - serializer.attribute(null, ATTR_PACKAGE_NAME, - resolution.mPackageName); - serializer.attribute(null, ATTR_LABEL_RES_ID, - String.valueOf(resolution.mLabelResId)); - } else { - serializer.attribute(null, ATTR_LABEL, - resolution.getLabel(getPackageManager())); - } + serializer.attribute(null, ATTR_LABEL, + resolution.getLabel(getPackageManager())); serializer.endTag(null, TAG_RESOLUTION); } @@ -1047,11 +1037,7 @@ public final class PrintSpoolerService extends Service { ATTR_HORIZONTAL_DPI)); final int verticalDpi = Integer.parseInt(parser.getAttributeValue(null, ATTR_VERTICAL_DPI)); - String packageName = parser.getAttributeValue(null, ATTR_PACKAGE_NAME); - final int labelResId = Integer.parseInt( - parser.getAttributeValue(null, ATTR_LABEL_RES_ID)); - Resolution resolution = new Resolution(id, label, packageName, labelResId, - horizontalDpi, verticalDpi); + Resolution resolution = new Resolution(id, label, horizontalDpi, verticalDpi); builder.setResolution(resolution); parser.next(); skipEmptyTextTags(parser); diff --git a/packages/PrintSpooler/src/com/android/printspooler/RemotePrintDocumentAdapter.java b/packages/PrintSpooler/src/com/android/printspooler/RemotePrintDocumentAdapter.java index 4006a5a..fd14af9 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/RemotePrintDocumentAdapter.java +++ b/packages/PrintSpooler/src/com/android/printspooler/RemotePrintDocumentAdapter.java @@ -17,7 +17,6 @@ package com.android.printspooler; import android.os.AsyncTask; -import android.os.Build; import android.os.Bundle; import android.os.ParcelFileDescriptor; import android.os.RemoteException; @@ -43,7 +42,7 @@ import java.io.OutputStream; final class RemotePrintDocumentAdapter { private static final String LOG_TAG = "RemotePrintDocumentAdapter"; - private static final boolean DEBUG = true && Build.IS_DEBUGGABLE; + private static final boolean DEBUG = false; private final IPrintDocumentAdapter mRemoteInterface; |