Closed Bug 1369638 Opened 7 years ago Closed 4 years ago

Fix lint: NewApi issues in PrintHelper.java

Categories

(Firefox for Android Graveyard :: General, defect, P5)

55 Branch
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: tyu, Unassigned)

References

Details

11 occurrences: ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:66: Call requires API level 19 (current min is 15): new android.print.PrintDocumentAdapter 63 64 // The adapter methods are all called on the UI thread by the PrintManager. Put the heavyweight code 65 // in onWrite on the background thread. 66 PrintDocumentAdapter pda = new PrintDocumentAdapter() { 67 @Override 68 public void onWrite(final PageRange[] pages, final ParcelFileDescriptor destination, final CancellationSignal cancellationSignal, final WriteResultCallback callback) { Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:66: Class requires API level 19 (current min is 15): android.print.PrintDocumentAdapter 63 64 // The adapter methods are all called on the UI thread by the PrintManager. Put the heavyweight code 65 // in onWrite on the background thread. 66 PrintDocumentAdapter pda = new PrintDocumentAdapter() { 67 @Override 68 public void onWrite(final PageRange[] pages, final ParcelFileDescriptor destination, final CancellationSignal cancellationSignal, final WriteResultCallback callback) { Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:86: Call requires API level 19 (current min is 15): android.print.PrintDocumentAdapter.WriteResultCallback#onWriteFinished 83 output.write(buf, 0, bytesRead); 84 } 85 86 callback.onWriteFinished(new PageRange[] { PageRange.ALL_PAGES }); 87 } catch (FileNotFoundException ee) { 88 Log.d(LOGTAG, "Unable to find the temporary PDF file."); Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:86: Field requires API level 19 (current min is 15): android.print.PageRange#ALL_PAGES 83 output.write(buf, 0, bytesRead); 84 } 85 86 callback.onWriteFinished(new PageRange[] { PageRange.ALL_PAGES }); 87 } catch (FileNotFoundException ee) { 88 Log.d(LOGTAG, "Unable to find the temporary PDF file."); Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:101: Call requires API level 16 (current min is 15): android.os.CancellationSignal#isCanceled 98 99 @Override 100 public void onLayout(PrintAttributes oldAttributes, PrintAttributes newAttributes, CancellationSignal cancellationSignal, LayoutResultCallback callback, Bundle extras) { 101 if (cancellationSignal.isCanceled()) { 102 callback.onLayoutCancelled(); 103 return; Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:102: Call requires API level 19 (current min is 15): android.print.PrintDocumentAdapter.LayoutResultCallback#onLayoutCancelled 99 @Override 100 public void onLayout(PrintAttributes oldAttributes, PrintAttributes newAttributes, CancellationSignal cancellationSignal, LayoutResultCallback callback, Bundle extras) { 101 if (cancellationSignal.isCanceled()) { 102 callback.onLayoutCancelled(); 103 return; 104 } Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:106: Call requires API level 19 (current min is 15): android.print.PrintDocumentInfo.Builder#build 103 return; 104 } 105 106 PrintDocumentInfo pdi = new PrintDocumentInfo.Builder(filePath).setContentType(PrintDocumentInfo.CONTENT_TYPE_DOCUMENT).build(); 107 callback.onLayoutFinished(pdi, true); 108 } Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:106: Call requires API level 19 (current min is 15): android.print.PrintDocumentInfo.Builder#setContentType 103 return; 104 } 105 106 PrintDocumentInfo pdi = new PrintDocumentInfo.Builder(filePath).setContentType(PrintDocumentInfo.CONTENT_TYPE_DOCUMENT).build(); 107 callback.onLayoutFinished(pdi, true); 108 } Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:106: Call requires API level 19 (current min is 15): new android.print.PrintDocumentInfo.Builder 103 return; 104 } 105 106 PrintDocumentInfo pdi = new PrintDocumentInfo.Builder(filePath).setContentType(PrintDocumentInfo.CONTENT_TYPE_DOCUMENT).build(); 107 callback.onLayoutFinished(pdi, true); 108 } Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:107: Call requires API level 19 (current min is 15): android.print.PrintDocumentAdapter.LayoutResultCallback#onLayoutFinished 104 } 105 106 PrintDocumentInfo pdi = new PrintDocumentInfo.Builder(filePath).setContentType(PrintDocumentInfo.CONTENT_TYPE_DOCUMENT).build(); 107 callback.onLayoutFinished(pdi, true); 108 } 109 Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease ../../../../../../../mobile/android/base/java/org/mozilla/gecko/PrintHelper.java:123: Call requires API level 19 (current min is 15): android.print.PrintManager#print 120 } 121 }; 122 123 printManager.print(jobName, pda, null); 124 } 125 } Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease
Blocks: lint-newapi
[triage] Bulk edit from title: this is a non-critical issue or [meta] bug.
Priority: -- → P3
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195 Needinfo :susheel if you think this bug should be re-triaged.
Priority: P3 → P5
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.