am bececbfa: Merge "Printed document size not persisted." into klp-dev

* commit 'bececbfae675055aa60ea21c5b8bd3dbb8acdbac':
  Printed document size not persisted.
This commit is contained in:
Svetoslav Ganov
2013-10-12 17:34:47 -07:00
committed by Android Git Automerger
2 changed files with 7 additions and 1 deletions

View File

@ -193,7 +193,7 @@ public final class PrintDocumentInfo implements Parcelable {
builder.append("name=").append(mName);
builder.append(", pageCount=").append(mPageCount);
builder.append(", contentType=").append(contentTyepToString(mContentType));
builder.append(", size=").append(mDataSize);
builder.append(", dataSize=").append(mDataSize);
builder.append("}");
return builder.toString();
}

View File

@ -730,6 +730,7 @@ public final class PrintSpoolerService extends Service {
private static final String ATTR_NAME = "name";
private static final String ATTR_PAGE_COUNT = "pageCount";
private static final String ATTR_CONTENT_TYPE = "contentType";
private static final String ATTR_DATA_SIZE = "dataSize";
private final AtomicFile mStatePersistFile;
@ -893,6 +894,8 @@ public final class PrintSpoolerService extends Service {
documentInfo.getContentType()));
serializer.attribute(null, ATTR_PAGE_COUNT, String.valueOf(
documentInfo.getPageCount()));
serializer.attribute(null, ATTR_DATA_SIZE, String.valueOf(
documentInfo.getDataSize()));
serializer.endTag(null, TAG_DOCUMENT_INFO);
}
@ -1111,10 +1114,13 @@ public final class PrintSpoolerService extends Service {
ATTR_PAGE_COUNT));
final int contentType = Integer.parseInt(parser.getAttributeValue(null,
ATTR_CONTENT_TYPE));
final int dataSize = Integer.parseInt(parser.getAttributeValue(null,
ATTR_DATA_SIZE));
PrintDocumentInfo info = new PrintDocumentInfo.Builder(name)
.setPageCount(pageCount)
.setContentType(contentType).build();
printJob.setDocumentInfo(info);
info.setDataSize(dataSize);
parser.next();
skipEmptyTextTags(parser);
expect(parser, XmlPullParser.END_TAG, TAG_DOCUMENT_INFO);