Skip to content

Commit

Permalink
Merge pull request #416 from RADAR-base/release-1.2.3
Browse files Browse the repository at this point in the history
Release 1.2.3
  • Loading branch information
peyman-mohtashami authored May 3, 2023
2 parents 2c557be + 3e6eb86 commit f62557c
Show file tree
Hide file tree
Showing 31 changed files with 137 additions and 194 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: temurin

- uses: gradle/gradle-build-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
java-version: 17

- uses: gradle/gradle-build-action@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
java-version: 17

- uses: gradle/gradle-build-action@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scheduled_snyk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
java-version: 17

- name: Decrypt libraries
run: ./.github/scripts/decrypt_libraries.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
java-version: 17

- name: Decrypt libraries
run: ./.github/scripts/decrypt_libraries.sh
Expand Down
2 changes: 1 addition & 1 deletion avro-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
description = "Version of Apache Avro compatible with Android"

dependencies {
implementation("org.slf4j:slf4j-api:2.0.6")
implementation("org.slf4j:slf4j-api:2.0.7")

testImplementation(project(":radar-commons-android")) {
exclude group: 'org.apache.avro', module: 'avro'
Expand Down
22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/
buildscript {
ext.kotlin_version = '1.8.0'
ext.dokka_version = '1.7.20'
ext.kotlin_version = '1.8.21'
ext.dokka_version = '1.8.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.0'
classpath 'com.android.tools.build:gradle:8.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.bjoernq:unmockplugin:0.7.9'
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.18"
Expand All @@ -30,8 +30,8 @@ buildscript {
}

plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("com.github.ben-manes.versions") version "0.44.0"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("com.github.ben-manes.versions") version "0.46.0"
}

allprojects {
Expand All @@ -41,10 +41,10 @@ allprojects {
ext.issueUrl = 'https://github.com/' + githubRepoName + '/issues'
ext.website = 'http://radar-base.org'

version = "1.2.2"
version = "1.2.3"
group = 'org.radarbase'

ext.versionCode = 50
ext.versionCode = 51
}

subprojects {
Expand All @@ -62,7 +62,7 @@ subprojects {
repositories {
google()
mavenCentral()
maven { url = "https://oss.sonatype.org/content/repositories/snapshots" }
// maven { url = "https://oss.sonatype.org/content/repositories/snapshots" }
}

dependencies {
Expand Down Expand Up @@ -91,8 +91,8 @@ subprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = '11'
apiVersion = '1.7'
languageVersion = '1.7'
apiVersion = '1.8'
languageVersion = '1.8'
}
}
}
Expand All @@ -119,5 +119,5 @@ nexusPublishing {
}

wrapper {
gradleVersion '7.6'
gradleVersion '8.1.1'
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
android.disableAutomaticComponentCreation=true
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx3072m -XX:MaxMetaspaceSize=1536m -Dfile.encoding=UTF-8 -XX:+UseParallelGC
org.gradle.parallel=true
org.gradle.vfs.watch=true

kotlin.code.style=official

android.defaults.buildfeatures.buildconfig=true

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand Down
6 changes: 3 additions & 3 deletions gradle/android.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
android {
compileSdkVersion 32
compileSdkVersion 33
buildToolsVersion '32.0.0'

defaultConfig {
minSdkVersion 21
targetSdkVersion 32
minSdkVersion 24
targetSdkVersion 33
versionCode versionCode
versionName version
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ext {

dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.slf4j:slf4j-simple:2.0.6'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.10.0'
testImplementation 'org.slf4j:slf4j-simple:2.0.7'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.11.0'

// Core library
androidTestImplementation "androidx.test:core:$androidXCoreVersion"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 6 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class ApplicationStatusManager(

private lateinit var tzOffsetCache: ChangeRunner<Int>
private lateinit var deviceInfoCache: ChangeRunner<ApplicationInfo>
private lateinit var serverStatusReceiver: BroadcastRegistration
private lateinit var serverRecordsReceiver: BroadcastRegistration
private lateinit var cacheReceiver: BroadcastRegistration
private var serverStatusReceiver: BroadcastRegistration? = null
private var serverRecordsReceiver: BroadcastRegistration? = null
private var cacheReceiver: BroadcastRegistration? = null

init {
name = service.getString(R.string.applicationServiceDisplayName)
Expand Down Expand Up @@ -266,9 +266,9 @@ class ApplicationStatusManager(

override fun onClose() {
this.processor.close()
cacheReceiver.unregister()
serverRecordsReceiver.unregister()
serverStatusReceiver.unregister()
cacheReceiver?.unregister()
serverRecordsReceiver?.unregister()
serverStatusReceiver?.unregister()
}

private fun processTimeZone() {
Expand Down
2 changes: 1 addition & 1 deletion plugins/radar-android-audio/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
namespace "org.radarbase.passive.audio"

// Matches Github Actions
ndkVersion "22.1.7171670"
ndkVersion "25.2.9519653"

defaultConfig {
ndk {
Expand Down
2 changes: 1 addition & 1 deletion plugins/radar-android-login-qr/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description = 'RADAR Android QR LoginManager.'
dependencies {
api project(':radar-commons-android')
implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
// Support Android 14+
//noinspection GradleDependency
implementation 'com.google.zxing:core:3.4.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ class PhoneUsageManager(context: PhoneUsageService) : AbstractSourceManager<Phon

init {
name = service.getString(R.string.phoneUsageServiceDisplayName)
this.usageStatsManager = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
context.getSystemService(Context.USAGE_STATS_SERVICE) as? UsageStatsManager
} else {
null
}
this.usageStatsManager = context.getSystemService(Context.USAGE_STATS_SERVICE) as? UsageStatsManager

usageEventTopic = if (usageStatsManager != null) {
createCache("android_phone_usage_event", PhoneUsageEvent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.radarbase.passive.phone.usage

import android.Manifest.permission.PACKAGE_USAGE_STATS
import android.os.Build
import org.radarbase.android.BuildConfig
import org.radarbase.android.RadarService
Expand All @@ -39,11 +40,7 @@ class PhoneUsageProvider(radarService: RadarService) : SourceProvider<BaseSource
override val displayName: String
get() = radarService.getString(R.string.phoneUsageServiceDisplayName)

override val permissionsNeeded: List<String> = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
listOf(android.Manifest.permission.PACKAGE_USAGE_STATS)
} else {
emptyList()
}
override val permissionsNeeded: List<String> = listOf(PACKAGE_USAGE_STATS)

override val sourceProducer: String = "ANDROID"
override val sourceModel: String = "PHONE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class PhoneContactListManager(service: PhoneContactsListService) : AbstractSourc
private val contactsTopic: DataCache<ObservationKey, PhoneContactList> = createCache("android_phone_contacts", PhoneContactList())
private val processor: OfflineProcessor
private val db: ContentResolver = service.contentResolver
private lateinit var savedContactLookups: Set<String>
private var savedContactLookups: Set<String> = emptySet()

init {
name = service.getString(R.string.contact_list)
Expand Down
4 changes: 2 additions & 2 deletions plugins/radar-android-ppg/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ description = 'Plugin for RADAR passive remote monitoring app for measuring PPG

dependencies {
api project(':radar-commons-android')
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ internal class RenderContext(context: Context, dimensions: Size) : Closeable {
val RENDER_CONTEXT_RELEASER: CountedReference<Unit> = CountedReference(
creator = {},
destroyer = {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
logger.info("Releasing RenderScript context")
RenderScript.releaseAllContexts()
}
logger.info("Releasing RenderScript context")
RenderScript.releaseAllContexts()
})
}
}
10 changes: 5 additions & 5 deletions radar-commons-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ dependencies {
exclude group: 'org.apache.avro', module: 'avro'
}
api(project(':avro-android'))
api("org.slf4j:slf4j-api:2.0.6")
api("androidx.appcompat:appcompat:1.6.0")
api("org.slf4j:slf4j-api:2.0.7")
api("androidx.appcompat:appcompat:1.6.1")

implementation "com.squareup.okhttp3:okhttp:4.10.0"
implementation "com.squareup.okhttp3:okhttp:4.11.0"
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.1.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"

api "androidx.lifecycle:lifecycle-service:2.5.1"
api "androidx.lifecycle:lifecycle-service:2.6.1"

implementation platform('com.google.firebase:firebase-bom:31.2.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-crashlytics'
Expand Down
1 change: 1 addition & 0 deletions radar-commons-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<queries>
<intent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,16 @@ abstract class RadarService : LifecycleService(), ServerStatusListener, LoginLis

private val needsPermissions = LinkedHashSet<String>()

protected open val servicePermissions: List<String>
get() = listOf(ACCESS_NETWORK_STATE, INTERNET)
protected open val servicePermissions: List<String> = buildList(4) {
add(ACCESS_NETWORK_STATE)
add(INTERNET)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
add(FOREGROUND_SERVICE)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
add(POST_NOTIFICATIONS)
}
}

override fun onBind(intent: Intent): IBinder? {
super.onBind(intent)
Expand Down Expand Up @@ -673,10 +681,6 @@ abstract class RadarService : LifecycleService(), ServerStatusListener, LoginLis

private const val BLUETOOTH_NOTIFICATION = 521290

val REQUEST_IGNORE_BATTERY_OPTIMIZATIONS_COMPAT = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
REQUEST_IGNORE_BATTERY_OPTIMIZATIONS else "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"
val PACKAGE_USAGE_STATS_COMPAT = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
PACKAGE_USAGE_STATS else "android.permission.PACKAGE_USAGE_STATS"
val ACCESS_BACKGROUND_LOCATION_COMPAT = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
ACCESS_BACKGROUND_LOCATION else "android.permission.ACCESS_BACKGROUND_LOCATION"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package org.radarbase.android.util

import android.os.Build
import android.security.keystore.KeyGenParameterSpec
import androidx.annotation.RequiresApi
import java.security.Key
import java.security.KeyStore
import javax.crypto.KeyGenerator

@RequiresApi(Build.VERSION_CODES.M)
object AndroidKeyStore {
fun getOrCreateSecretKey(name: String, algorithm: String, purposes: Int, generatorBuilder: KeyGenParameterSpec.Builder.() -> Unit = {}): Key {
val keyStore = KeyStore.getInstance(ANDROID_KEY_STORE)
Expand Down
Loading

0 comments on commit f62557c

Please sign in to comment.