From 47d4b1e2e553a06f60f118689723be850cf877ba Mon Sep 17 00:00:00 2001 From: COVIDSafe Support <64945427+covidsafe-support@users.noreply.github.com> Date: Mon, 21 Dec 2020 12:19:00 +1100 Subject: [PATCH] Include final pull request for release 2.0. (#39) --- app/src/debug/java/au/gov/health/covidsafe/PeekActivity.kt | 3 +-- app/src/main/java/au/gov/health/covidsafe/HomeActivity.kt | 2 +- .../au/gov/health/covidsafe/receivers/UpgradeReceiver.kt | 2 +- .../health/covidsafe/services/BluetoothMonitoringService.kt | 5 +++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/debug/java/au/gov/health/covidsafe/PeekActivity.kt b/app/src/debug/java/au/gov/health/covidsafe/PeekActivity.kt index 5d5f2ad..ffa684b 100644 --- a/app/src/debug/java/au/gov/health/covidsafe/PeekActivity.kt +++ b/app/src/debug/java/au/gov/health/covidsafe/PeekActivity.kt @@ -167,9 +167,8 @@ class PeekActivity : AppCompatActivity() { return timePeriod } - private fun startService() { - Utils.startBluetoothMonitoringService(this) + // Utils.startBluetoothMonitoringService(this) } private fun stopService() { diff --git a/app/src/main/java/au/gov/health/covidsafe/HomeActivity.kt b/app/src/main/java/au/gov/health/covidsafe/HomeActivity.kt index 5f4e6ab..0dcf6c1 100644 --- a/app/src/main/java/au/gov/health/covidsafe/HomeActivity.kt +++ b/app/src/main/java/au/gov/health/covidsafe/HomeActivity.kt @@ -38,7 +38,7 @@ class HomeActivity : FragmentActivity(), NetworkConnectionCheck.NetworkConnectio setContentView(R.layout.activity_home) - Utils.startBluetoothMonitoringService(this) + Utils.startBluetoothMonitoringService(this) //Get Firebase Token getInstanceID() diff --git a/app/src/main/java/au/gov/health/covidsafe/receivers/UpgradeReceiver.kt b/app/src/main/java/au/gov/health/covidsafe/receivers/UpgradeReceiver.kt index bda9314..528f2a2 100644 --- a/app/src/main/java/au/gov/health/covidsafe/receivers/UpgradeReceiver.kt +++ b/app/src/main/java/au/gov/health/covidsafe/receivers/UpgradeReceiver.kt @@ -14,7 +14,7 @@ class UpgradeReceiver : BroadcastReceiver() { if (Intent.ACTION_MY_PACKAGE_REPLACED != intent!!.action) return context?.let { CentralLog.i("UpgradeReceiver", "Starting service from upgrade receiver") - Utils.startBluetoothMonitoringService(context) +// Utils.startBluetoothMonitoringService(context) } } catch (e: Exception) { CentralLog.e("UpgradeReceiver", "Unable to handle upgrade: ${e.localizedMessage}") diff --git a/app/src/main/java/au/gov/health/covidsafe/services/BluetoothMonitoringService.kt b/app/src/main/java/au/gov/health/covidsafe/services/BluetoothMonitoringService.kt index 983a413..0719385 100644 --- a/app/src/main/java/au/gov/health/covidsafe/services/BluetoothMonitoringService.kt +++ b/app/src/main/java/au/gov/health/covidsafe/services/BluetoothMonitoringService.kt @@ -98,7 +98,7 @@ class BluetoothMonitoringService : LifecycleService(), CoroutineScope, SensorDel Utils.cancelBMUpdateCheck(this.applicationContext) Utils.cancelNextScan(this.applicationContext) Utils.cancelNextAdvertise(this.applicationContext) - sensor?.stop() + // sensor?.stop() } private fun setupNotifications() { @@ -332,6 +332,7 @@ class BluetoothMonitoringService : LifecycleService(), CoroutineScope, SensorDel job.cancel() CentralLog.i(TAG, "BluetoothMonitoringService destroyed") + sensor?.stop() } private fun showForegroundNotification() { @@ -458,7 +459,7 @@ class BluetoothMonitoringService : LifecycleService(), CoroutineScope, SensorDel } BluetoothAdapter.STATE_ON -> { CentralLog.d(TAG, "BluetoothAdapter.STATE_ON") - Utils.startBluetoothMonitoringService(this@BluetoothMonitoringService.applicationContext) +// Utils.startBluetoothMonitoringService(this@BluetoothMonitoringService.applicationContext) showForegroundNotification() } }