84 lines
3.4 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright (c) 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.printspooler"
android:versionName="1"
android:versionCode="1">
<!-- Allows an application to call APIs that give it access to all print jobs
on the device. Usually an app can access only the print jobs it created. -->
<permission
android:name="com.android.printspooler.permission.ACCESS_ALL_PRINT_JOBS"
android:label="@string/permlab_accessAllPrintJobs"
android:description="@string/permdesc_accessAllPrintJobs"
android:protectionLevel="signature" />
<!-- May be required by the settings and add printer activities of a
print service if the developer wants only trusted system code to
be able to launch these activities. -->
<permission android:name="android.permission.START_PRINT_SERVICE_CONFIG_ACTIVITY"
android:label="@string/permlab_startPrintServiceConfigActivity"
android:description="@string/permdesc_startPrintServiceConfigActivity"
android:protectionLevel="signature" />
<uses-permission android:name="com.android.printspooler.permission.ACCESS_ALL_PRINT_JOBS"/>
First cut of the print notifications. 1. Added notifications for a queued print job, for a started print job, for ongoing canceling a print job, and for a failed print job. The notifications for queued and started state have a cancel action. The notification for failed print job has a cancel and a restart action. 2. Propagating failure message from the print service to the notifications. 3. PrintJobConfigActivity was not setting the initial value for the print job copies and was not updating the UI immediately after creation. 4. Refactored PrintJobConfigActivity to avoid using the hack to avoid reaction for item selection change in a spinner for an event that happened before the callback was registered. 5. Removed the label attribute from PrinterInfo and now PrinterId is composed of the printer name and the service component name. This is nice since for restarting print jobs we do not need to store information about the printer except the printer id which is already part of the PrintJobInfo's data. Also the printer name is not expected to change anyway. 6. Allowing cancellation of a queued print job. Also no print job is cancelled without asking the managing print service to do that. Before we were immediately canceling print jobs in queued state but it was possible for a buggy print service to not set the print job state to started before starting to do expensive work that will not be canceled. 7. PrintServiceInfo was throwing an exception the the meta-data XML for the print service was not well-formed which would crash the system process. Now we just ignore not well-formed meta-data. 8. Removed unused permissions from the PrintSpooler's manifest. Change-Id: Iba2dd14b487f56e137b90d1da17c3033422ab5e6
2013-08-02 14:22:19 -07:00
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.START_PRINT_SERVICE_CONFIG_ACTIVITY"/>
<application
App UI freezes when printing. API clean up. 1. The UI of a printing app was freezing a little when calling the print method since the print manager service was waiting for it to bind to the print spooler which generated the print job id (and the initial print job info really). Now the print manager service is responsible for job id generation and does not not wait for the print spooler to spin. Hence, the app UI is not blocked at all. Note that the print manager initiates the binding to the spooler and as soon as it completes the spooler shows the print UI which is hosted in its process. It is not possible to show the print UI before the system is bound to the spooler since during this binding the system passes a callback to the spooler so the latter can talk to the system. 2. Changed the print job id to be an opaque class allowing us to vary the way we generate print job ids in the future. 3. The queued print job state was hidden but the print job returned by the print method of the print manager is in that state. Now now hidden. 4. We were incorrecly removing print job infos if they are completed or cancelled. Doing that is problematic since the print job returned by the print method allows the app to query for the job info after the job has been say completed. Hence, an app can initiate printing and get a print job whose state is "created" and hold onto it until after the job is completed, now if the app asks for the print job info it will get an info in "created" state even though the job is "completed" since the spooler was not retaining the completed jobs. Now the spooler removes the PDF files for the completed and cancelled print jobs but keeps around the infos (also persisting them to disc) so it can answer questions about them. On first boot or switch to a user we purge the persisted print jobs in completed/cancelled state since they are obsolete - no app can have a handle to them. 5. Removed the print method that takes a file since we have a public PrintDocumentAdapter implementation for printing files. Once can instantiate a PrintFileDocumentAdapter and pass it to the print method. This class also allows overriding of the finish method to know when the data is spooled and deleted the file if desired, etc. 6. Replaced the wrong code to slice a large list of parcelables to use ParceledListSlice class. bug:10748093 Change-Id: I1ebeeb47576e88fce550851cdd3e401fcede6e2b
2013-09-16 17:53:51 -07:00
android:allowClearUserData="true"
android:label="@string/app_label"
Print UI bug fixing and printer discovery refactoring. 1. Added support for selecting a printer from the all printers activity that is not in the initial printer selection drop down. The user initially sees a sub set of the printers in the drop down and the last option is to see all printers in a separate activity. Some of the printers in the all printers activity are not shown in the initial drop down. 2. Refactored printer discovery by adding (private for now) printer discovery app facing APIs. These APIs are needed to support multiple printer selection activities (print dialog and all printers activities) and also the settings for showing all printers for a service. Now multiple apps can request observing for printers and there is a centralized mediator that ensures the same printer discovery session is used. The mediator dispatches printer discovery specific requests to print services. It also aggregates discovered printers and delivers them to the interested apps. The mediator minimizes printer discovery session creation and starting and stopping discovery by sharing the same discovery session and discovery window with multiple apps. Lastly, the mediator takes care of print services enabled during discovery by bringing them up to the current discovery state (create discovery session and start discovery if needed). The mediator also reports disappearing of the printers of a service removed during discovery and notifies a newly registered observers for the currnet printers if the observers are added during an active printer discovery session. 3. Fixed bugs in the print UI and implemented some UX tweaks. Change-Id: I4d0b0c5a6c6f1809b2ba5dbc8e9d63ab3d48f1ef
2013-08-20 16:32:53 -07:00
android:allowBackup= "false"
android:supportsRtl="true"
android:icon="@*android:drawable/ic_print">
<service
android:name=".PrintSpoolerService"
android:exported="true"
android:permission="android.permission.BIND_PRINT_SPOOLER_SERVICE">
</service>
<activity
android:name=".PrintJobConfigActivity"
Print UI bug fixing and printer discovery refactoring. 1. Added support for selecting a printer from the all printers activity that is not in the initial printer selection drop down. The user initially sees a sub set of the printers in the drop down and the last option is to see all printers in a separate activity. Some of the printers in the all printers activity are not shown in the initial drop down. 2. Refactored printer discovery by adding (private for now) printer discovery app facing APIs. These APIs are needed to support multiple printer selection activities (print dialog and all printers activities) and also the settings for showing all printers for a service. Now multiple apps can request observing for printers and there is a centralized mediator that ensures the same printer discovery session is used. The mediator dispatches printer discovery specific requests to print services. It also aggregates discovered printers and delivers them to the interested apps. The mediator minimizes printer discovery session creation and starting and stopping discovery by sharing the same discovery session and discovery window with multiple apps. Lastly, the mediator takes care of print services enabled during discovery by bringing them up to the current discovery state (create discovery session and start discovery if needed). The mediator also reports disappearing of the printers of a service removed during discovery and notifies a newly registered observers for the currnet printers if the observers are added during an active printer discovery session. 3. Fixed bugs in the print UI and implemented some UX tweaks. Change-Id: I4d0b0c5a6c6f1809b2ba5dbc8e9d63ab3d48f1ef
2013-08-20 16:32:53 -07:00
android:configChanges="orientation|screenSize"
Refactor how the print dialog activity is started. 1. Before the print job activity was started asyncronously with respect to the print call on to the print manager. This was creating a situation where the starting activity may finish before the print dialog appears which may lead to an orphaned print document adapter with no data to print (as the UI is is gone), or strange behaviors where the print dialog starts on as a separate task. To address this the pending intent for starting the print dialog is not started by the print spooler since we cannot call into it synchronously as we have to start its process and bind to the spooler service which leads to jankyness in the client app. Now the pending intent is created by the print manager service in the synchronous print call so from an app's perspective calling print starts the activity. The side effect of this design is that the print dialog activity may start before the system is bound to the spooler service. In such a case the print activity cannot start poking the print spooler state as the system registers callback to observe the spooler state. To address this the print spooler activity disables the UI and also binds to the spooler service which happenes immediately after it is started. As soon as the print dialog binds to the service it starts the UI. 2. Fixed an bug in the printer adapter of the print dialog that was leading to a crash if the only item in the adater is the all pritners option and it is selected. 3. Piping the package name that started the printing so we can pass it to the storage UI as a hint to open the last location the app used. bug:11127269 Change-Id: Ia93820bdae0b0e7600a0930b1f10d9708bd86b68
2013-10-10 13:36:23 -07:00
android:permission="android.permission.BIND_PRINT_SPOOLER_SERVICE"
android:theme="@style/PrintJobConfigActivityTheme">
Refactor how the print dialog activity is started. 1. Before the print job activity was started asyncronously with respect to the print call on to the print manager. This was creating a situation where the starting activity may finish before the print dialog appears which may lead to an orphaned print document adapter with no data to print (as the UI is is gone), or strange behaviors where the print dialog starts on as a separate task. To address this the pending intent for starting the print dialog is not started by the print spooler since we cannot call into it synchronously as we have to start its process and bind to the spooler service which leads to jankyness in the client app. Now the pending intent is created by the print manager service in the synchronous print call so from an app's perspective calling print starts the activity. The side effect of this design is that the print dialog activity may start before the system is bound to the spooler service. In such a case the print activity cannot start poking the print spooler state as the system registers callback to observe the spooler state. To address this the print spooler activity disables the UI and also binds to the spooler service which happenes immediately after it is started. As soon as the print dialog binds to the service it starts the UI. 2. Fixed an bug in the printer adapter of the print dialog that was leading to a crash if the only item in the adater is the all pritners option and it is selected. 3. Piping the package name that started the printing so we can pass it to the storage UI as a hint to open the last location the app used. bug:11127269 Change-Id: Ia93820bdae0b0e7600a0930b1f10d9708bd86b68
2013-10-10 13:36:23 -07:00
<intent-filter>
<action android:name="android.print.PRINT_DIALOG" />
Refactor how the print dialog activity is started. 1. Before the print job activity was started asyncronously with respect to the print call on to the print manager. This was creating a situation where the starting activity may finish before the print dialog appears which may lead to an orphaned print document adapter with no data to print (as the UI is is gone), or strange behaviors where the print dialog starts on as a separate task. To address this the pending intent for starting the print dialog is not started by the print spooler since we cannot call into it synchronously as we have to start its process and bind to the spooler service which leads to jankyness in the client app. Now the pending intent is created by the print manager service in the synchronous print call so from an app's perspective calling print starts the activity. The side effect of this design is that the print dialog activity may start before the system is bound to the spooler service. In such a case the print activity cannot start poking the print spooler state as the system registers callback to observe the spooler state. To address this the print spooler activity disables the UI and also binds to the spooler service which happenes immediately after it is started. As soon as the print dialog binds to the service it starts the UI. 2. Fixed an bug in the printer adapter of the print dialog that was leading to a crash if the only item in the adater is the all pritners option and it is selected. 3. Piping the package name that started the printing so we can pass it to the storage UI as a hint to open the last location the app used. bug:11127269 Change-Id: Ia93820bdae0b0e7600a0930b1f10d9708bd86b68
2013-10-10 13:36:23 -07:00
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="printjob" android:pathPattern="*" />
</intent-filter>
</activity>
<activity
android:name=".SelectPrinterActivity"
android:label="@string/all_printers_label"
android:theme="@style/SelectPrinterActivityTheme"
android:exported="false">
</activity>
First cut of the print notifications. 1. Added notifications for a queued print job, for a started print job, for ongoing canceling a print job, and for a failed print job. The notifications for queued and started state have a cancel action. The notification for failed print job has a cancel and a restart action. 2. Propagating failure message from the print service to the notifications. 3. PrintJobConfigActivity was not setting the initial value for the print job copies and was not updating the UI immediately after creation. 4. Refactored PrintJobConfigActivity to avoid using the hack to avoid reaction for item selection change in a spinner for an event that happened before the callback was registered. 5. Removed the label attribute from PrinterInfo and now PrinterId is composed of the printer name and the service component name. This is nice since for restarting print jobs we do not need to store information about the printer except the printer id which is already part of the PrintJobInfo's data. Also the printer name is not expected to change anyway. 6. Allowing cancellation of a queued print job. Also no print job is cancelled without asking the managing print service to do that. Before we were immediately canceling print jobs in queued state but it was possible for a buggy print service to not set the print job state to started before starting to do expensive work that will not be canceled. 7. PrintServiceInfo was throwing an exception the the meta-data XML for the print service was not well-formed which would crash the system process. Now we just ignore not well-formed meta-data. 8. Removed unused permissions from the PrintSpooler's manifest. Change-Id: Iba2dd14b487f56e137b90d1da17c3033422ab5e6
2013-08-02 14:22:19 -07:00
<receiver
android:name=".NotificationController$NotificationBroadcastReceiver"
android:exported="false" >
</receiver>
</application>
</manifest>