1.17 霍尼韦尔EDA51、EDA50P,调用扫描枪的方法,在关闭的时候停止调用扫描枪

This commit is contained in:
2024-08-27 13:41:54 +08:00
parent 724e691188
commit 12c928f059
2 changed files with 8 additions and 4 deletions

View File

@ -11,7 +11,7 @@ android {
minSdk 28
targetSdk 28
versionCode 1
versionName "1.16"
versionName "1.17"
// 1.0 IDATA广播模式处理
// 1.1 霍尼韦尔的监听修改扫描网站二维码跳出程序监听失效调整、斑马PDA广播模式设置
@ -30,6 +30,7 @@ android {
// 1.14 瑞芯 rk3566_r 添加引用 librockchip.so 新加一个方法返回当前PDA的厂家和型号
// 1.15 系统状态栏根据配置进行设置
// 1.16 idata pda 不设置模式
// 1.17 霍尼韦尔EDA51、EDA50P调用扫描枪的方法在关闭的时候停止调用扫描枪
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi-v7a'

View File

@ -57,7 +57,8 @@ public class ScanServiceEDA50P extends Service
super.onCreate();
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationChannel channel = null;
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { //适配9.0service
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { //适配9.0service
// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { //适配9.0service
channel = new NotificationChannel(notificationId, notificationName, NotificationManager.IMPORTANCE_HIGH);
notificationManager.createNotificationChannel(channel);
Notification notification = new Notification.Builder(getApplicationContext(), notificationId).build();
@ -78,9 +79,11 @@ public class ScanServiceEDA50P extends Service
//Service被关闭之前回调
@Override
public void onDestroy() {
Log.i(TAG, "onDestory方法被调用!");
Log.i(TAG, "onDestroy方法被调用!");
super.onDestroy();
if (mBarcodeReader != null) {
mBarcodeReader.release();
}
if (this.mInternalScannerReader != null) {
this.mInternalScannerReader.removeBarcodeListener(this);
this.mInternalScannerReader.removeTriggerListener(this);