Skip to content

Commit

Permalink
Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-budiyev committed Apr 6, 2018
1 parent c149c8a commit 06bef37
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Code scanner library for [Android](https://developer.android.com), based on [ZXi
Add dependency:
```gradle
dependencies {
implementation 'com.budiyev.android:code-scanner:1.8.3'
implementation 'com.budiyev.android:code-scanner:1.8.4'
}
```
Add camera permission to AndroidManifest.xml (Don't forget about dynamic permissions on API >= 23):
Expand Down
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.jfrog.bintray'
ext {
libraryName = 'CodeScanner'
libraryDescription = 'Code scanner library for Android, based on ZXing'
libraryVersion = '1.8.3'
libraryVersion = '1.8.4'
artifact = 'code-scanner'
developerId = 'yuriy-budiyev'
developerName = 'Yuriy Budiyev'
Expand All @@ -41,12 +41,11 @@ ext {

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 43
versionCode 44
versionName libraryVersion
}

Expand All @@ -65,7 +64,7 @@ android {
dependencies {
api 'com.google.zxing:core:3.3.2'
api 'com.google.zxing:android-core:3.3.0'
api 'com.android.support:support-annotations:27.1.0'
api 'com.android.support:support-annotations:27.1.1'
}

group = publishedGroupId
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/com/budiyev/android/codescanner/CodeScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import android.content.Context;
import android.hardware.Camera;
import android.os.Handler;
import android.os.Process;
import android.support.annotation.MainThread;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
Expand Down Expand Up @@ -641,19 +642,14 @@ private final class InitializationThread extends Thread {
private final int mHeight;

public InitializationThread(int width, int height) {
super("Code scanner initialization thread");
if (getPriority() != Thread.MIN_PRIORITY) {
setPriority(Thread.MIN_PRIORITY);
}
if (isDaemon()) {
setDaemon(false);
}
super("cs-init");
mWidth = width;
mHeight = height;
}

@Override
public void run() {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
try {
initialize();
} catch (Exception e) {
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/com/budiyev/android/codescanner/Decoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.SynchronousQueue;

import android.os.Process;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

Expand Down Expand Up @@ -96,17 +97,12 @@ private boolean setState(@NonNull State state) {

private final class DecoderThread extends Thread {
public DecoderThread() {
super("Code scanner decode thread");
if (getPriority() != Thread.MIN_PRIORITY) {
setPriority(Thread.MIN_PRIORITY);
}
if (isDaemon()) {
setDaemon(false);
}
super("cs-decoder");
}

@Override
public void run() {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
for (; ; ) {
try {
setState(Decoder.State.IDLE);
Expand Down

0 comments on commit 06bef37

Please sign in to comment.