Philip P. Moltmann 98963260dc Prefer printers that have been used physically close to the current
location of the user.

Commonly the users prints on a printer that this near the user current
location. Hence if possible we want to show the user printers that he
used before and that are close to him.

Hence store the location of the previous uses of a printer and prefer
printer that are close to the user.

Unfortunately getLastLocation might not report a usable location and it
will take at least 5 seconds until the first usable location arrives. At
this time the user might have already opened the destionation spinner.
It would be unexpected for the printers to suddenly change under the
users finger. Hence it might be that we did first show the printer
without any location information and then once the location is known we
cannot update thedestination spinner anymore.

The select printer activity does not have this issue, hence in the worst
case the user has to enter this activity to select a printer and by then
the location is usually determined.

This is not ideal but better than before.

Bug: 24133609
Change-Id: Ie7d20cf3d9dd163e57903f8f6ecc0b3fd4f4374e
2015-12-22 19:00:39 -08:00

89 lines
3.6 KiB
XML

<?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">
<!-- 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"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.START_PRINT_SERVICE_CONFIG_ACTIVITY"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowClearUserData="true"
android:label="@string/app_label"
android:allowBackup= "false"
android:supportsRtl="true">
<service
android:name=".model.PrintSpoolerService"
android:exported="true"
android:permission="android.permission.BIND_PRINT_SPOOLER_SERVICE">
</service>
<service
android:name=".renderer.PdfManipulationService"
android:isolatedProcess="true"
android:process=":renderer">
</service>
<activity
android:name=".ui.PrintActivity"
android:configChanges="screenSize|smallestScreenSize|orientation"
android:permission="android.permission.BIND_PRINT_SPOOLER_SERVICE"
android:theme="@style/PrintActivity">
<intent-filter>
<action android:name="android.print.PRINT_DIALOG" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="printjob" android:pathPattern="*" />
</intent-filter>
</activity>
<activity
android:name=".ui.SelectPrinterActivity"
android:label="@string/all_printers_label"
android:theme="@android:style/Theme.Material.Settings"
android:exported="false">
</activity>
<receiver
android:name=".model.NotificationController$NotificationBroadcastReceiver"
android:exported="false" >
</receiver>
</application>
</manifest>