Home
last modified time | relevance | path

Searched refs:printer (Results 1 – 25 of 37) sorted by relevance

12

/packages/services/BuiltInPrintService/src/com/android/bips/ipp/
DCapabilitiesCache.java140 public void request(DiscoveredPrinter printer, boolean highPriority, in request() argument
142 if (DEBUG) Log.d(TAG, "request() printer=" + printer + " high=" + highPriority); in request()
144 LocalPrinterCapabilities capabilities = get(printer); in request()
150 if (P2pUtils.isOnConnectedInterface(mService, printer)) { in request()
151 if (DEBUG) Log.d(TAG, "Adding to P2P evict list: " + printer); in request()
152 mToEvictP2p.add(printer.path); in request()
154 if (DEBUG) Log.d(TAG, "Adding to WLAN evict list: " + printer); in request()
155 mToEvict.add(printer.path); in request()
159 Request request = mRequests.computeIfAbsent(printer.path, uri -> in request()
160 new Request(printer, highPriority ? SECOND_PASS_TIMEOUT : FIRST_PASS_TIMEOUT)); in request()
[all …]
/packages/services/BuiltInPrintService/src/com/android/bips/discovery/
DDiscovery.java69 for (DiscoveredPrinter printer : new ArrayList<>(mPrinters.values())) { in start()
70 listener.onPrinterFound(printer); in start()
145 void printerFound(DiscoveredPrinter printer) { in printerFound() argument
146 DiscoveredPrinter current = mPrinters.get(printer.getUri()); in printerFound()
147 if (Objects.equals(current, printer)) { in printerFound()
151 mPrinters.put(printer.getUri(), printer); in printerFound() local
153 listener.onPrinterFound(printer); in printerFound()
161 DiscoveredPrinter printer = mPrinters.remove(printerUri); in printerLost() local
162 if (printer == null) { in printerLost()
166 listener.onPrinterLost(printer); in printerLost()
[all …]
DSavedDiscovery.java61 boolean addSavedPrinter(DiscoveredPrinter printer) { in addSavedPrinter() argument
62 Uri printerUri = printer.getUri(); in addSavedPrinter()
65 if (printer.equals(old)) { in addSavedPrinter()
71 mSavedPrinters.add(0, printer); in addSavedPrinter()
80 for (DiscoveredPrinter printer : mSavedPrinters) { in find()
81 if (printer.getUri().equals(printerUri)) { in find()
82 return printer; in find()
93 for (DiscoveredPrinter printer : mSavedPrinters) { in removeSavedPrinter()
94 if (printer.path.equals(printerPath)) { in removeSavedPrinter()
95 mSavedPrinters.remove(printer); in removeSavedPrinter()
[all …]
DP2pDiscovery.java96 DiscoveredPrinter printer = toPrinter(peer); in onPeerFound() local
97 if (DEBUG) Log.d(TAG, "onPeerFound " + printer); in onPeerFound()
101 if (saved.path.equals(printer.path)) { in onPeerFound()
109 DiscoveredPrinter printer = toPrinter(peer); in onPeerLost() local
110 if (DEBUG) Log.d(TAG, "onPeerLost " + printer); in onPeerLost()
111 printerLost(printer.getUri()); in onPeerLost()
115 public void addValidPrinter(DiscoveredPrinter printer) { in addValidPrinter() argument
116 if (addSavedPrinter(printer)) { in addValidPrinter()
117 printerFound(printer); in addValidPrinter()
DDelayedDiscovery.java54 public void onPrinterFound(DiscoveredPrinter printer) { in DelayedDiscovery()
56 printerFound(printer); in DelayedDiscovery()
60 DiscoveredPrinter old = mPending.put(printer.getUri(), printer); in DelayedDiscovery()
63 DiscoveredPrinter pending = mPending.remove(printer.getUri()); in DelayedDiscovery()
73 public void onPrinterLost(DiscoveredPrinter printer) { in DelayedDiscovery()
74 mPending.remove(printer.getUri()); in DelayedDiscovery()
75 printerLost(printer.getUri()); in DelayedDiscovery()
DMdnsDiscovery.java207 for (DiscoveredPrinter printer : getPrinters()) { in onServiceLost()
208 if (TextUtils.equals(printer.name, info.getServiceName())) { in onServiceLost()
209 printerLost(printer.getUri()); in onServiceLost()
239 DiscoveredPrinter printer = toNetworkPrinter(info); in onServiceResolved() local
240 if (DEBUG) Log.d(TAG, "Service " + info.getServiceName() + " resolved to " + printer); in onServiceResolved()
241 if (printer == null) { in onServiceResolved()
244 printerFound(printer); in onServiceResolved()
DMultiDiscovery.java46 public void onPrinterFound(DiscoveredPrinter printer) { in MultiDiscovery()
47 printerFound(merged(printer.getUri())); in MultiDiscovery()
51 public void onPrinterLost(DiscoveredPrinter printer) { in MultiDiscovery()
53 DiscoveredPrinter remaining = merged(printer.getUri()); in MultiDiscovery()
55 printerLost(printer.getUri()); in MultiDiscovery()
DManualDiscovery.java65 for (DiscoveredPrinter printer : getSavedPrinters()) { in onStart()
66 mCapabilitiesCache.request(printer, false, capabilities -> { in onStart()
68 printerFound(printer); in onStart()
146 void onFound(DiscoveredPrinter printer, boolean supported); in onFound() argument
DConnectionListener.java26 void onConnectionComplete(DiscoveredPrinter printer); in onConnectionComplete() argument
/packages/services/BuiltInPrintService/src/com/android/bips/p2p/
DP2pPrinterConnection.java70 public P2pPrinterConnection(BuiltInPrintService service, DiscoveredPrinter printer, in P2pPrinterConnection() argument
73 if (DEBUG) Log.d(TAG, "Connecting to " + printer); in P2pPrinterConnection()
74 if (P2pUtils.isOnConnectedInterface(service, printer)) { in P2pPrinterConnection()
80 mPrinter = printer; in P2pPrinterConnection()
159 public void onPrinterFound(DiscoveredPrinter printer) { in onPrinterFound() argument
160 if (DEBUG) Log.d(TAG, "onPrinterFound(" + printer + ")"); in onPrinterFound()
167 printerAddress = (Inet4Address) Inet4Address.getByName(printer.path.getHost()); in onPrinterFound()
176 mService.getCapabilitiesCache().request(printer, true, capabilities -> in onPrinterFound()
177 onCapabilities(printer, capabilities)); in onPrinterFound()
181 private void onCapabilities(DiscoveredPrinter printer, LocalPrinterCapabilities capabilities) { in onCapabilities() argument
[all …]
DP2pUtils.java77 public static boolean isP2p(DiscoveredPrinter printer) { in isP2p() argument
78 return printer.path.getScheme().equals(P2pDiscovery.SCHEME_P2P); in isP2p()
85 DiscoveredPrinter printer) { in isOnConnectedInterface() argument
88 && P2pUtils.isOnInterface(connectedInterface, printer.path); in isOnConnectedInterface()
/packages/services/BuiltInPrintService/src/com/android/bips/ui/
DPrinterPreference.java32 DiscoveredPrinter printer, boolean adding) { in PrinterPreference() argument
35 mPrinter = printer; in PrinterPreference()
37 updatePrinter(printer); in PrinterPreference()
40 void updatePrinter(DiscoveredPrinter printer) { in updatePrinter() argument
41 mPrinter = printer; in updatePrinter()
44 setTitle(getContext().getString(R.string.add_named, printer.name)); in updatePrinter()
46 setTitle(printer.name); in updatePrinter()
49 setSummary(mPrintService.getDescription(printer)); in updatePrinter()
DAddPrintersFragment.java189 for (DiscoveredPrinter printer : mPrintService.getDiscovery().getSavedPrinters()) { in updateSavedPrinters()
191 if (P2pUtils.isP2p(printer) && !p2pEnabled) { in updateSavedPrinters()
194 if (DEBUG) Log.d(TAG, "Adding saved printer " + printer); in updateSavedPrinters()
196 printer, false); in updateSavedPrinters()
199 showRemovalDialog(printer); in updateSavedPrinters()
207 private void showRemovalDialog(DiscoveredPrinter printer) { in showRemovalDialog() argument
209 if (P2pUtils.isP2p(printer)) { in showRemovalDialog()
212 message = mPrintService.getString(R.string.connects_via_network, printer.path); in showRemovalDialog()
215 .setTitle(printer.name) in showRemovalDialog()
219 mPrintService.getDiscovery().removeSavedPrinter(printer.path); in showRemovalDialog()
DFindP2pPrintersFragment.java109 DiscoveredPrinter printer = P2pDiscovery.toPrinter(peer); in onPeerFound() local
113 if (prior.path.equals(printer.path)) { in onPeerFound()
119 PrinterPreference pref = getPrinterPreference(printer.getUri()); in onPeerFound()
121 pref.updatePrinter(printer); in onPeerFound()
123 pref = new PrinterPreference(getContext(), mPrintService, printer, true); in onPeerFound()
141 DiscoveredPrinter printer = P2pDiscovery.toPrinter(peer); in onPeerLost() local
144 PrinterPreference pref = getPrinterPreference(printer.path); in onPeerLost()
DMoreOptionsActivity.java114 public void onPrinterFound(DiscoveredPrinter printer) { in onPrinterFound() argument
115 if (printer.getUri().toString().equals(mPrinterId.getLocalId())) { in onPrinterFound()
117 mPrinter = printer; in onPrinterFound()
134 public void onPrinterLost(DiscoveredPrinter printer) { in onPrinterLost() argument
DAddP2pPrinterDialog.java70 public void onConnectionComplete(DiscoveredPrinter printer) { in onConnectionComplete() argument
71 if (printer != null) { in onConnectionComplete()
75 mPrintService.getP2pDiscovery().addValidPrinter(printer); in onConnectionComplete()
DAddManualPrinterDialog.java149 public void onFound(DiscoveredPrinter printer, boolean supported) { in onFound() argument
/packages/services/BuiltInPrintService/src/com/android/bips/
DLocalPrintJob.java153 public void onPrinterFound(DiscoveredPrinter printer) { in onPrinterFound() argument
157 if (!printer.getId(mPrintService).equals(mPrintJob.getInfo().getPrinterId())) { in onPrinterFound()
161 if (DEBUG) Log.d(TAG, "onPrinterFound() " + printer.name + " state=" + mState); in onPrinterFound()
163 if (P2pUtils.isP2p(printer)) { in onPrinterFound()
165 mConnection = new P2pPrinterConnection(mPrintService, printer, this); in onPrinterFound()
169 if (P2pUtils.isOnConnectedInterface(mPrintService, printer) && mConnection == null) { in onPrinterFound()
171 mConnection = new P2pPrinterConnection(mPrintService, printer, this); in onPrinterFound()
177 mPath = printer.path; in onPrinterFound()
179 for (Uri path : printer.paths) { in onPrinterFound()
186 mPrintService.getCapabilitiesCache().request(printer, true, this); in onPrinterFound()
[all …]
DLocalDiscoverySession.java82 for (LocalPrinter printer : mPrinters.values()) { in onStartPrinterDiscovery()
83 printer.notFound(); in onStartPrinterDiscovery()
267 private boolean isHandledByOtherService(LocalPrinter printer) { in isHandledByOtherService() argument
268 InetAddress address = printer.getAddress(); in isHandledByOtherService()
273 ArrayList<String> printerServices = mPrintersOfOtherService.get(printer.getAddress()); in isHandledByOtherService()
294 for (LocalPrinter printer : mPrinters.values()) { in onPrintServicesStateUpdated()
295 boolean knownGood = mInfo.isKnownGood(printer.getPrinterId()); in onPrintServicesStateUpdated()
296 PrinterInfo info = printer.createPrinterInfo(knownGood); in onPrintServicesStateUpdated()
298 if (printer.getCapabilities() != null && printer.isFound() in onPrintServicesStateUpdated()
299 && !isHandledByOtherService(printer) && info != null) { in onPrintServicesStateUpdated()
[all …]
DLocalPrinter.java107 DiscoveredPrinter printer = mPrintService.getDiscovery() in createPrinterInfo() local
109 if (printer == null) { in createPrinterInfo()
115 mPrinterId, printer.name, in createPrinterInfo()
159 void found(DiscoveredPrinter printer) { in found() argument
160 mDiscoveredPrinter = printer; in found()
202 public void onConnectionComplete(DiscoveredPrinter printer) { in startTracking()
203 if (DEBUG) Log.d(TAG, "connection complete " + printer); in startTracking()
204 if (printer == null) { in startTracking()
DBuiltInPrintService.java263 public String getDescription(DiscoveredPrinter printer) { in getDescription() argument
264 if (P2pUtils.isP2p(printer) || P2pUtils.isOnConnectedInterface(this, printer)) { in getDescription()
268 String host = printer.getHost(); in getDescription()
269 if (!TextUtils.isEmpty(printer.location)) { in getDescription()
270 return getString(R.string.printer_description, host, printer.location); in getDescription()
/packages/apps/Settings/src/com/android/settings/print/
DPrintServiceSettingsFragment.java453 PrinterInfo printer = mPrinters.get(i); in getFilter()
454 String name = printer.getName(); in getFilter()
456 filteredPrinters.add(printer); in getFilter()
509 PrinterInfo printer = (PrinterInfo) getItem(position);
510 return printer.getStatus() != PrinterInfo.STATUS_UNAVAILABLE;
525 final PrinterInfo printer = (PrinterInfo) getItem(position);
526 CharSequence title = printer.getName();
527 CharSequence subtitle = printer.getDescription();
528 Drawable icon = printer.loadIcon(getActivity());
543 if (printer.getInfoIntent() != null) {
[all …]
/packages/apps/Gallery2/src/com/android/gallery3d/app/
DAbstractGalleryActivity.java361 PrintHelper printer = new PrintHelper(this); in printSelectedImage() local
363 printer.printBitmap(path, uri); in printSelectedImage()
/packages/services/BuiltInPrintService/jni/
DAndroid.bp42 "lib/printer.c",
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/
DFilterShowActivity.java1085 PrintHelper printer = new PrintHelper(this); in print() local
1086 printer.printBitmap("ImagePrint", bitmap); in print()

12