* commit 'fddc4bfed524df4f6245721c3ebc82ba2afbcf89': Fail print jobs targeted to unavailable services.
This commit is contained in:
@@ -4451,6 +4451,9 @@
|
|||||||
<!-- Print fail reason: unknown. [CHAR LIMIT=25] -->
|
<!-- Print fail reason: unknown. [CHAR LIMIT=25] -->
|
||||||
<string name="reason_unknown">unknown</string>
|
<string name="reason_unknown">unknown</string>
|
||||||
|
|
||||||
|
<!-- Print fail reason: the print service that has to process the print job is not available. [CHAR LIMIT=none] -->
|
||||||
|
<string name="reason_service_unavailable">Print service not enabled</string>
|
||||||
|
|
||||||
<!-- Title for the notification that a print service was installed. [CHAR LIMIT=50] -->
|
<!-- Title for the notification that a print service was installed. [CHAR LIMIT=50] -->
|
||||||
<string name="print_service_installed_title"><xliff:g id="name" example="Cloud Print">%s</xliff:g> service installed</string>
|
<string name="print_service_installed_title"><xliff:g id="name" example="Cloud Print">%s</xliff:g> service installed</string>
|
||||||
<!-- Message for the notification that a print service was installed. [CHAR LIMIT=50] -->
|
<!-- Message for the notification that a print service was installed. [CHAR LIMIT=50] -->
|
||||||
|
|||||||
@@ -928,6 +928,7 @@
|
|||||||
<java-symbol type="string" name="mediasize_japanese_kahu" />
|
<java-symbol type="string" name="mediasize_japanese_kahu" />
|
||||||
<java-symbol type="string" name="mediasize_japanese_kaku2" />
|
<java-symbol type="string" name="mediasize_japanese_kaku2" />
|
||||||
<java-symbol type="string" name="mediasize_japanese_you4" />
|
<java-symbol type="string" name="mediasize_japanese_you4" />
|
||||||
|
<java-symbol type="string" name="reason_service_unavailable" />
|
||||||
<java-symbol type="string" name="reason_unknown" />
|
<java-symbol type="string" name="reason_unknown" />
|
||||||
<java-symbol type="string" name="restr_pin_enter_admin_pin" />
|
<java-symbol type="string" name="restr_pin_enter_admin_pin" />
|
||||||
<java-symbol type="string" name="restr_pin_enter_pin" />
|
<java-symbol type="string" name="restr_pin_enter_pin" />
|
||||||
|
|||||||
@@ -134,6 +134,11 @@ final class UserState implements PrintSpoolerCallbacks, PrintServiceCallbacks {
|
|||||||
}
|
}
|
||||||
if (service != null) {
|
if (service != null) {
|
||||||
service.onPrintJobQueued(printJob);
|
service.onPrintJobQueued(printJob);
|
||||||
|
} else {
|
||||||
|
// The service for the job is no longer enabled, so just
|
||||||
|
// fail the job with the appropriate message.
|
||||||
|
mSpooler.setPrintJobState(printJob.getId(), PrintJobInfo.STATE_FAILED,
|
||||||
|
mContext.getString(R.string.reason_service_unavailable));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -779,7 +784,7 @@ final class UserState implements PrintSpoolerCallbacks, PrintServiceCallbacks {
|
|||||||
for (int i = 0; i < printJobCount; i++) {
|
for (int i = 0; i < printJobCount; i++) {
|
||||||
PrintJobInfo printJob = printJobs.get(i);
|
PrintJobInfo printJob = printJobs.get(i);
|
||||||
mSpooler.setPrintJobState(printJob.getId(), PrintJobInfo.STATE_FAILED,
|
mSpooler.setPrintJobState(printJob.getId(), PrintJobInfo.STATE_FAILED,
|
||||||
mContext.getString(R.string.reason_unknown));
|
mContext.getString(R.string.reason_service_unavailable));
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
Binder.restoreCallingIdentity(identity);
|
Binder.restoreCallingIdentity(identity);
|
||||||
|
|||||||
Reference in New Issue
Block a user