From 231f9c5dd22d99013a1d6fb8072f6aa05a9f3416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Katzer?= Date: Fri, 23 Dec 2016 18:08:59 +0100 Subject: [PATCH] Fix code smells --- src/android/Printer.java | 5 ++--- src/android/ext/PrinterDiscoverySession.java | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/android/Printer.java b/src/android/Printer.java index 51fb747..e393a77 100644 --- a/src/android/Printer.java +++ b/src/android/Printer.java @@ -79,7 +79,7 @@ public class Printer extends CordovaPlugin { /** * Invokes the callback once the job has reached a final state. */ - OnPrintJobStateChangeListener listener = new OnPrintJobStateChangeListener() { + private OnPrintJobStateChangeListener listener = new OnPrintJobStateChangeListener() { /** * Callback notifying that a print job state changed. * @@ -278,6 +278,7 @@ public class Printer extends CordovaPlugin { } pm.getInstance().print(docName, adapter, builder.build()); + view = null; } }); } @@ -299,8 +300,6 @@ public class Printer extends CordovaPlugin { PluginResult.Status.OK, job.isCompleted()); command.sendPluginResult(res); - - view = null; } /** diff --git a/src/android/ext/PrinterDiscoverySession.java b/src/android/ext/PrinterDiscoverySession.java index d30f700..7763e1d 100644 --- a/src/android/ext/PrinterDiscoverySession.java +++ b/src/android/ext/PrinterDiscoverySession.java @@ -72,7 +72,7 @@ public final class PrinterDiscoverySession { * @param session An instance of type * android.print.PrinterDiscoverySession */ - public PrinterDiscoverySession (Object session) { + PrinterDiscoverySession(Object session) { this.session = session; } @@ -89,7 +89,7 @@ public final class PrinterDiscoverySession { /** * Stop discovering printers. */ - public final void stopPrinterDiscovery() { + private void stopPrinterDiscovery() { Meta.invokeMethod(session, "stopPrinterDiscovery"); } @@ -151,7 +151,7 @@ public final class PrinterDiscoverySession { * @return List of their basic infos */ @SuppressWarnings("unchecked") - public final List getPrinters() { + private List getPrinters() { Method method = Meta.getMethod(session.getClass(), "getPrinters"); return (List) Meta.invokeMethod(session, method);