HemoCube new Changes

This commit is contained in:
smileomi18@gmail.com
2023-07-27 17:26:44 +05:30
parent 90b92897bd
commit e0a4008966
3 changed files with 4 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ package com.example.hpostesting.data.constant
object Constants {
const val ACTION_USB_PERMISSION = "shanmukha.in.sickle_cell.USB_PERMISSION"
const val HOMOCUBE_USB_PERMISSION = "shanmukha.in.sickle_cell_homocube.USB_PERMISSION"
const val ABHA_APP_PACKAGE = "in.ndhm.phr"

View File

@@ -17,14 +17,8 @@ import android.widget.Toast
import androidx.lifecycle.ViewModel;
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import com.bumptech.glide.load.model.stream.HttpGlideUrlLoader.TIMEOUT
import com.example.hpostesting.data.DataHolder
import com.example.hpostesting.data.constant.Constants.ACTION_USB_PERMISSION
import com.example.hpostesting.presentation.UsbServiceListener
import com.example.hpostesting.presentation.testRight.UsbService
import com.hoho.android.usbserial.driver.UsbSerialDriver
import `in`.sminnovations.hpostesting.R
import `in`.sminnovations.hpostesting.databinding.FragmentHemoCubeReferenceBinding

View File

@@ -126,19 +126,19 @@ class HemocubeActivity : AppCompatActivity() {
mPendingIntent = PendingIntent.getBroadcast(
this,
0,
Intent(Constants.ACTION_USB_PERMISSION),
Intent(Constants.HOMOCUBE_USB_PERMISSION),
PendingIntent.FLAG_MUTABLE
)
} else {
mPendingIntent = PendingIntent.getBroadcast(
this,
0,
Intent(Constants.ACTION_USB_PERMISSION),
Intent(Constants.HOMOCUBE_USB_PERMISSION),
PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_IMMUTABLE
)
}
val filter = IntentFilter(Constants.ACTION_USB_PERMISSION)
val filter = IntentFilter(Constants.HOMOCUBE_USB_PERMISSION)
registerReceiver(broadcastReceiver, filter)
manager.requestPermission(device, mPendingIntent)
}