Skip to content

Commit f9adb00

Browse files
authored
Merge pull request #17 from rMozg/scanner_permission
Scanner permission
2 parents 129a4fe + 4c6ca2c commit f9adb00

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
defaultConfig {
88
minSdkVersion 22
99
targetSdkVersion 25
10-
versionCode 4
11-
versionName "0.3.0"
10+
versionCode 5
11+
versionName "0.4.0"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1313
}
1414
buildTypes {

app/src/main/java/ru/evotor/devices/commons/services/PrinterService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
public class PrinterService extends AbstractService implements IPrinterServiceWrapper {
2525

26-
public static final String UNKNOWN_EXCEPTION_TEXT = "The request to DeviceService failed";
26+
public static final String UNKNOWN_EXCEPTION_TEXT = "Request to DeviceService failed";
2727

2828
protected volatile Boolean serviceConnected = null;
2929
protected ru.evotor.devices.commons.IPrinterService service;

app/src/main/java/ru/evotor/devices/commons/services/ScalesService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
public class ScalesService extends AbstractService implements IScalesServiceWrapper {
2525

26-
public static final String UNKNOWN_EXCEPTION_TEXT = "The request to DeviceService failed";
26+
public static final String UNKNOWN_EXCEPTION_TEXT = "Request to DeviceService failed";
2727

2828
protected Context context;
2929

app/src/main/java/ru/evotor/integrations/BarcodeBroadcastReceiver.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ import android.content.IntentFilter
99
* Created by nixan on 28.04.17.
1010
*/
1111

12-
1312
abstract class BarcodeBroadcastReceiver : BroadcastReceiver() {
1413

1514
override fun onReceive(context: Context?, intent: Intent?) {
1615
intent?.extras?.getString(EXTRA_SCANNED_CODE)?.let { code ->
1716
if (code.isNotEmpty()) {
18-
onReceiveBarcode(code)
17+
onBarcodeReceived(code, context)
1918
}
2019
}
2120
}
2221

23-
abstract fun onReceiveBarcode(barcode: String)
22+
public abstract fun onBarcodeReceived(barcode: String, context: Context?)
23+
2424

2525
companion object {
2626

@@ -30,8 +30,15 @@ abstract class BarcodeBroadcastReceiver : BroadcastReceiver() {
3030
@JvmField
3131
public val EXTRA_SCANNED_CODE = "ScannedCode"
3232

33+
@JvmField
34+
public val SENDER_PERMISSION = "ru.evotor.devices.SCANNER_SENDER"
35+
36+
@JvmField
37+
public val RECEIVER_PERMISSION = "ru.evotor.devices.SCANNER_RECEIVER"
38+
3339
@JvmField
3440
public val BARCODE_INTENT_FILTER = IntentFilter(ACTION_SCANNED)
41+
3542
}
3643

3744
}

0 commit comments

Comments
 (0)