Skip to content

Commit

Permalink
Merge pull request #443 from NordicSemiconductor/migration
Browse files Browse the repository at this point in the history
Updating dependencies
  • Loading branch information
philips77 authored May 23, 2024
2 parents 1f5f3ce + 436e968 commit 2c5bad2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class MainActivity : NordicActivity() {
}
}

override fun onNewIntent(intent: Intent?) {
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)

if (linkHandler.handleDeepLink(intent)) {
Expand Down
37 changes: 3 additions & 34 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
#
# Copyright (c) 2022, Nordic Semiconductor
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

#Mon Jun 20 12:44:30 CEST 2022
#Thu May 23 11:56:27 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 0 additions & 1 deletion profile/main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies {
implementation(libs.nordic.core)
implementation(libs.nordic.theme)
implementation(libs.nordic.logger)
implementation(libs.nordic.uilogger)
implementation(libs.nordic.analytics)
implementation(libs.nordic.permissions.ble)
implementation(libs.nordic.navigation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,44 +32,32 @@
package no.nordicsemi.android.dfu.profile.main.data

import android.content.Context
import android.util.Log
import dagger.hilt.android.qualifiers.ApplicationContext
import no.nordicsemi.android.common.logger.BleLoggerAndLauncher
import no.nordicsemi.android.common.logger.DefaultBleLogger
import no.nordicsemi.android.common.logger.LoggerLauncher
import no.nordicsemi.android.dfu.DfuBaseService
import no.nordicsemi.android.dfu.DfuServiceController
import no.nordicsemi.android.dfu.DfuServiceInitiator
import no.nordicsemi.android.dfu.DfuServiceListenerHelper
import no.nordicsemi.android.dfu.profile.main.repository.DFUService
import no.nordicsemi.android.dfu.profile.scanner.data.DfuTarget
import no.nordicsemi.android.dfu.settings.domain.DFUSettings
import no.nordicsemi.android.log.LogSession
import no.nordicsemi.android.log.Logger
import javax.inject.Inject

internal class DFUManager @Inject constructor(
@ApplicationContext private val context: Context,
) {
private var logger: BleLoggerAndLauncher? = null
private var session: LogSession? = null

fun install(
file: ZipFile,
target: DfuTarget,
settings: DFUSettings
): DfuServiceController {
logger = DefaultBleLogger
.create(context, null, target.address, target.name)
.also {
session = Logger.newSession(context, target.address, target.name)
?.also { session ->
DfuServiceListenerHelper.registerLogListener(context) { _, level, message ->
// Convert nRF Logger log level to Android log priority, used by the BleLogger.
val priority = when (level) {
DfuBaseService.LOG_LEVEL_DEBUG -> Log.DEBUG
DfuBaseService.LOG_LEVEL_VERBOSE -> Log.VERBOSE
DfuBaseService.LOG_LEVEL_INFO -> Log.INFO
DfuBaseService.LOG_LEVEL_WARNING -> Log.WARN
DfuBaseService.LOG_LEVEL_ERROR -> Log.ERROR
else -> level
}
it.log(priority, message)
Logger.log(session, level, message)
}
}

Expand Down Expand Up @@ -101,12 +89,6 @@ internal class DFUManager @Inject constructor(
}

fun openLogger() {
logger?.launch() ?: context.packageManager
.getLaunchIntentForPackage("no.nordicsemi.android.log")
?.let { launchIntent ->
context.startActivity(launchIntent)
} ?: run {
LoggerLauncher.launch(context)
}
LoggerLauncher.launch(context, session)
}
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencyResolutionManagement {
}
versionCatalogs {
create("libs") {
from("no.nordicsemi.android.gradle:version-catalog:1.11.3")
from("no.nordicsemi.android.gradle:version-catalog:1.11.8")
}
}
}
Expand Down

0 comments on commit 2c5bad2

Please sign in to comment.