Skip to content

Commit 2c5bad2

Browse files
authored
Merge pull request #443 from NordicSemiconductor/migration
Updating dependencies
2 parents 1f5f3ce + 436e968 commit 2c5bad2

File tree

5 files changed

+12
-62
lines changed

5 files changed

+12
-62
lines changed

app/src/main/java/no/nordicsemi/android/dfu/app/MainActivity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class MainActivity : NordicActivity() {
6767
}
6868
}
6969

70-
override fun onNewIntent(intent: Intent?) {
70+
override fun onNewIntent(intent: Intent) {
7171
super.onNewIntent(intent)
7272

7373
if (linkHandler.handleDeepLink(intent)) {
+3-34
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,6 @@
1-
#
2-
# Copyright (c) 2022, Nordic Semiconductor
3-
# All rights reserved.
4-
#
5-
# Redistribution and use in source and binary forms, with or without modification, are
6-
# permitted provided that the following conditions are met:
7-
#
8-
# 1. Redistributions of source code must retain the above copyright notice, this list of
9-
# conditions and the following disclaimer.
10-
#
11-
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
12-
# of conditions and the following disclaimer in the documentation and/or other materials
13-
# provided with the distribution.
14-
#
15-
# 3. Neither the name of the copyright holder nor the names of its contributors may be
16-
# used to endorse or promote products derived from this software without specific prior
17-
# written permission.
18-
#
19-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21-
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22-
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23-
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24-
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26-
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27-
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29-
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30-
#
31-
32-
#Mon Jun 20 12:44:30 CEST 2022
1+
#Thu May 23 11:56:27 CEST 2024
332
distributionBase=GRADLE_USER_HOME
34-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
353
distributionPath=wrapper/dists
36-
zipStorePath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
375
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

profile/main/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ dependencies {
2020
implementation(libs.nordic.core)
2121
implementation(libs.nordic.theme)
2222
implementation(libs.nordic.logger)
23-
implementation(libs.nordic.uilogger)
2423
implementation(libs.nordic.analytics)
2524
implementation(libs.nordic.permissions.ble)
2625
implementation(libs.nordic.navigation)

profile/main/src/main/java/no/nordicsemi/android/dfu/profile/main/data/DFUManager.kt

+7-25
Original file line numberDiff line numberDiff line change
@@ -32,44 +32,32 @@
3232
package no.nordicsemi.android.dfu.profile.main.data
3333

3434
import android.content.Context
35-
import android.util.Log
3635
import dagger.hilt.android.qualifiers.ApplicationContext
37-
import no.nordicsemi.android.common.logger.BleLoggerAndLauncher
38-
import no.nordicsemi.android.common.logger.DefaultBleLogger
3936
import no.nordicsemi.android.common.logger.LoggerLauncher
40-
import no.nordicsemi.android.dfu.DfuBaseService
4137
import no.nordicsemi.android.dfu.DfuServiceController
4238
import no.nordicsemi.android.dfu.DfuServiceInitiator
4339
import no.nordicsemi.android.dfu.DfuServiceListenerHelper
4440
import no.nordicsemi.android.dfu.profile.main.repository.DFUService
4541
import no.nordicsemi.android.dfu.profile.scanner.data.DfuTarget
4642
import no.nordicsemi.android.dfu.settings.domain.DFUSettings
43+
import no.nordicsemi.android.log.LogSession
44+
import no.nordicsemi.android.log.Logger
4745
import javax.inject.Inject
4846

4947
internal class DFUManager @Inject constructor(
5048
@ApplicationContext private val context: Context,
5149
) {
52-
private var logger: BleLoggerAndLauncher? = null
50+
private var session: LogSession? = null
5351

5452
fun install(
5553
file: ZipFile,
5654
target: DfuTarget,
5755
settings: DFUSettings
5856
): DfuServiceController {
59-
logger = DefaultBleLogger
60-
.create(context, null, target.address, target.name)
61-
.also {
57+
session = Logger.newSession(context, target.address, target.name)
58+
?.also { session ->
6259
DfuServiceListenerHelper.registerLogListener(context) { _, level, message ->
63-
// Convert nRF Logger log level to Android log priority, used by the BleLogger.
64-
val priority = when (level) {
65-
DfuBaseService.LOG_LEVEL_DEBUG -> Log.DEBUG
66-
DfuBaseService.LOG_LEVEL_VERBOSE -> Log.VERBOSE
67-
DfuBaseService.LOG_LEVEL_INFO -> Log.INFO
68-
DfuBaseService.LOG_LEVEL_WARNING -> Log.WARN
69-
DfuBaseService.LOG_LEVEL_ERROR -> Log.ERROR
70-
else -> level
71-
}
72-
it.log(priority, message)
60+
Logger.log(session, level, message)
7361
}
7462
}
7563

@@ -101,12 +89,6 @@ internal class DFUManager @Inject constructor(
10189
}
10290

10391
fun openLogger() {
104-
logger?.launch() ?: context.packageManager
105-
.getLaunchIntentForPackage("no.nordicsemi.android.log")
106-
?.let { launchIntent ->
107-
context.startActivity(launchIntent)
108-
} ?: run {
109-
LoggerLauncher.launch(context)
110-
}
92+
LoggerLauncher.launch(context, session)
11193
}
11294
}

settings.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencyResolutionManagement {
1616
}
1717
versionCatalogs {
1818
create("libs") {
19-
from("no.nordicsemi.android.gradle:version-catalog:1.11.3")
19+
from("no.nordicsemi.android.gradle:version-catalog:1.11.8")
2020
}
2121
}
2222
}

0 commit comments

Comments
 (0)