summaryrefslogtreecommitdiffstats
path: root/core/java/android/printservice/PrintServiceInfo.java
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2013-06-25 14:59:53 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2013-07-16 12:59:59 -0700
commita00271533f639c8ed36429c663889ac9f654bc72 (patch)
tree7f0c8045126bc0493c1fa018a114f803d34fa7ef /core/java/android/printservice/PrintServiceInfo.java
parent15ecbdd2e373195ef920faefa349a6e62200d1f1 (diff)
downloadframeworks_base-a00271533f639c8ed36429c663889ac9f654bc72.zip
frameworks_base-a00271533f639c8ed36429c663889ac9f654bc72.tar.gz
frameworks_base-a00271533f639c8ed36429c663889ac9f654bc72.tar.bz2
Refactoring of the print sub-system and API clean up.
1. Now a user state has ins own spooler since the spooler app is running per user. The user state registers an observer for the state of the spooler to get information needed to orchestrate unbinding from print serivces that have no work and eventually unbinding from the spooler when all no service has any work. 2. Abstracted a remote print service from the perspective of the system in a class that is transparently managing binding and unbinding to the remote instance. 3. Abstracted the remote print spooler to transparently manage binding and unbinding to the remote instance when there is work and when there is no work, respectively. 4. Cleaned up the print document adapter (ex-PrintAdapter) APIs to enable implementing the all callbacks on a thread of choice. If the document is really small, using the main thread makes sense. Now if an app that does not need the UI state to layout the printed content, it can schedule all the work for allocating resources, laying out, writing, and releasing resources on a dedicated thread. 5. Added info class for the printed document that is now propagated the the print services. A print service gets an instance of a new document class that encapsulates the document info and a method to access the document's data. 6. Added APIs for describing the type of a document to the new document info class. This allows a print service to do smarts based on the doc type. For now we have only photo and document types. 7. Renamed the systemReady method for system services that implement it with different semantics to systemRunning. Such methods assume the the service can run third-party code which is not the same as systemReady. 8. Cleaned up the print job configuration activity. 9. Sigh... code clean up here and there. Factoring out classes to improve readability. Change-Id: I637ba28412793166cbf519273fdf022241159a92
Diffstat (limited to 'core/java/android/printservice/PrintServiceInfo.java')
-rw-r--r--core/java/android/printservice/PrintServiceInfo.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/core/java/android/printservice/PrintServiceInfo.java b/core/java/android/printservice/PrintServiceInfo.java
index 0370a25..43dd1b6 100644
--- a/core/java/android/printservice/PrintServiceInfo.java
+++ b/core/java/android/printservice/PrintServiceInfo.java
@@ -48,8 +48,6 @@ import java.io.IOException;
*/
public final class PrintServiceInfo implements Parcelable {
- private static final boolean DEBUG = false;
-
private static final String LOG_TAG = PrintServiceInfo.class.getSimpleName();
private static final String TAG_PRINT_SERVICE = "print-service";
@@ -97,7 +95,6 @@ public final class PrintServiceInfo implements Parcelable {
* @param context Context for accessing resources.
* @throws XmlPullParserException If a XML parsing error occurs.
* @throws IOException If a I/O error occurs.
- * @hide
*/
public static PrintServiceInfo create(ResolveInfo resolveInfo, Context context) {
String settingsActivityName = null;
@@ -117,7 +114,7 @@ public final class PrintServiceInfo implements Parcelable {
String nodeName = parser.getName();
if (!TAG_PRINT_SERVICE.equals(nodeName)) {
throw new XmlPullParserException(
- "Meta-data does not start with" + TAG_PRINT_SERVICE + " tag");
+ "Meta-data does not start with " + TAG_PRINT_SERVICE + " tag");
}
Resources resources = packageManager.getResourcesForApplication(
@@ -213,7 +210,7 @@ public final class PrintServiceInfo implements Parcelable {
@Override
public int hashCode() {
- return 31 * 1 + ((mId == null) ? 0 : mId.hashCode());
+ return 31 + ((mId == null) ? 0 : mId.hashCode());
}
@Override
@@ -244,12 +241,8 @@ public final class PrintServiceInfo implements Parcelable {
builder.append("PrintServiceInfo{");
builder.append("id:").append(mId).append(", ");
builder.append("resolveInfo:").append(mResolveInfo).append(", ");
- if (DEBUG) {
- builder.append("settingsActivityName:").append(mSettingsActivityName);
- builder.append("addPrintersActivityName:").append(mAddPrintersActivityName);
- } else if (mSettingsActivityName != null || mAddPrintersActivityName != null) {
- builder.append("<has meta-data>");
- }
+ builder.append("settingsActivityName:").append(mSettingsActivityName);
+ builder.append("addPrintersActivityName:").append(mAddPrintersActivityName);
builder.append("}");
return builder.toString();
}