diff --git a/app/build.gradle b/app/build.gradle index 57999fc0e..316bc6695 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,11 +6,11 @@ def getGitHash = providers.exec { android { buildToolsVersion = rootProject.ext.buildToolsVersion - namespace 'org.runnerup' + namespace = 'org.runnerup' compileOptions { - sourceCompatibility JavaVersion.toVersion("17") - targetCompatibility JavaVersion.toVersion("17") + sourceCompatibility = JavaVersion.toVersion("17") + targetCompatibility = JavaVersion.toVersion("17") } sourceSets { @@ -44,13 +44,13 @@ android { flavorDimensions = [ "all" ] productFlavors { latest { - dimension "all" + dimension = "all" // multidexing support, min play support - minSdk rootProject.ext.minSdk - compileSdk rootProject.ext.compileSdk - targetSdk rootProject.ext.targetSdk - versionName rootProject.ext.versionName - versionCode rootProject.ext.latestBaseVersionCode + rootProject.ext.versionCode + minSdk = rootProject.ext.minSdk + compileSdk = rootProject.ext.compileSdk + targetSdk = rootProject.ext.targetSdk + versionName = rootProject.ext.versionName + versionCode = rootProject.ext.latestBaseVersionCode + rootProject.ext.versionCode } } @@ -60,7 +60,7 @@ android { // enable rootProject.ext.allowNonFree && gradle.startParameter.taskNames.contains("assembleLatestRelease") // relevant archs only - these are the only available anyway for newer NDK include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' - universalApk true + universalApk = true } } @@ -86,22 +86,22 @@ android { versionNameSuffix = "-${getGitHash}" } release { - debuggable false - applicationIdSuffix "" + debuggable = false + applicationIdSuffix = "" - minifyEnabled rootProject.ext.allowNonFree - shrinkResources rootProject.ext.allowNonFree + minifyEnabled = rootProject.ext.allowNonFree + shrinkResources = rootProject.ext.allowNonFree proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard.txt' - signingConfig signingConfigs.release + signingConfig = signingConfigs.release } } lint { - baseline file('lint-baseline.xml') - checkReleaseBuilds true - lintConfig file('lint.xml') - showAll true - //textOutput 'stdout' - textReport true + baseline = file('lint-baseline.xml') + checkReleaseBuilds = true + lintConfig = file('lint.xml') + showAll = true + //textOutput = 'stdout' + textReport = true } bundle { language { @@ -110,21 +110,21 @@ android { } } buildFeatures { - aidl true - buildConfig true + aidl = true + buildConfig = true } androidResources { - generateLocaleConfig true + generateLocaleConfig = true } } repositories { google() mavenCentral() //MapBox GraphView - maven { url "https://oss.sonatype.org/content/groups/public/" } //pebblekit + maven { url = "https://oss.sonatype.org/content/groups/public/" } //pebblekit if (rootProject.ext.useMapBox) { maven { - url 'https://api.mapbox.com/downloads/v2/releases/maven' + url = 'https://api.mapbox.com/downloads/v2/releases/maven' authentication { basic(BasicAuthentication) } @@ -144,10 +144,10 @@ repositories { // Duplicate class kotlin.collections.jdk8 (from MapBox?) dependencies { constraints { - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") { + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.2.0") { because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib") } - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") { + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.2.0") { because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib") } } @@ -163,7 +163,7 @@ dependencies { implementation "androidx.viewpager2:viewpager2:1.1.0" implementation "androidx.constraintlayout:constraintlayout:2.2.1" - latestImplementation "com.google.android.material:material:1.12.0" + latestImplementation "com.google.android.material:material:1.13.0" if (rootProject.ext.enableWear) { // Build Wear separately, do not include in phone apk // latestWearApp project(':wear') @@ -172,7 +172,7 @@ dependencies { latestImplementation "com.google.android.gms:play-services-wearable:${rootProject.ext.googlePlayServicesWearableVersion}" } - implementation "com.squareup.okhttp3:okhttp:5.1.0" + implementation "com.squareup.okhttp3:okhttp:5.3.2" latestImplementation 'com.getpebble:pebblekit:4.0.1' if (rootProject.ext.allowNonFree) { // MapBox uses telemetry, without Play there may be exceptions from mapbox (OK to ignore) diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml index ce9768f92..5cb214c6d 100644 --- a/app/lint-baseline.xml +++ b/app/lint-baseline.xml @@ -1,5 +1,16 @@ - + + + + + + file="$GRADLE_USER_HOME/caches/8.13/transforms/42de1f8347fab8a0bff82f7b8295106e/transformed/jetified-mapbox-android-sdk-gl-core-5.2.2/jni/arm64-v8a/libmapbox-gl.so"/> + file="$GRADLE_USER_HOME/caches/8.13/transforms/42de1f8347fab8a0bff82f7b8295106e/transformed/jetified-mapbox-android-sdk-gl-core-5.2.2/jni/arm64-v8a/libmapbox-gl.so"/> - + + + + + consumer) { - mDataClient.getDataItems(new Uri.Builder() - .scheme(WEAR_URI_SCHEME) - .path(path) - .build()) - .addOnCompleteListener(new OnCompleteListener() { - @Override - public void onComplete(Task task) { - if (task.isSuccessful()) { - DataItemBuffer dataItems = task.getResult(); - if (dataItems.getCount() == 0) { - consumer.accept(null); - } else { - for (DataItem dataItem : dataItems) { - consumer.accept(dataItem); + mDataClient + .getDataItems(new Uri.Builder().scheme(WEAR_URI_SCHEME).path(path).build()) + .addOnCompleteListener( + new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + if (task.isSuccessful()) { + DataItemBuffer dataItems = task.getResult(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (dataItems.getCount() == 0) { + consumer.accept(null); + } else { + for (DataItem dataItem : dataItems) { + consumer.accept(dataItem); + } + } } + dataItems.release(); + } else { + System.out.println("task.getException(): " + task.getException()); } - dataItems.release(); - } else { - System.out.println("task.getException(): " + task.getException()); } - } - }); + }); } public Task putData(String path) { diff --git a/hrdevice/build.gradle b/hrdevice/build.gradle index a51e58d3b..73a0c5749 100644 --- a/hrdevice/build.gradle +++ b/hrdevice/build.gradle @@ -4,13 +4,13 @@ group = "org.runnerup.hr" version = "1.0" android { - namespace 'org.runnerup.hr' - compileSdk rootProject.ext.compileSdk - buildToolsVersion rootProject.ext.buildToolsVersion + namespace = 'org.runnerup.hr' + compileSdk = rootProject.ext.compileSdk + buildToolsVersion = rootProject.ext.buildToolsVersion compileOptions { - sourceCompatibility JavaVersion.toVersion("17") - targetCompatibility JavaVersion.toVersion("17") + sourceCompatibility = JavaVersion.toVersion("17") + targetCompatibility = JavaVersion.toVersion("17") } sourceSets { @@ -25,16 +25,16 @@ android { } } lint { - baseline file('lint-baseline.xml') - checkReleaseBuilds true - //lintConfig file('lint.xml') - showAll true - //textOutput 'stdout' - textReport true + baseline = file('lint-baseline.xml') + checkReleaseBuilds = true + //lintConfig = file('lint.xml') + showAll = true + //textOutput = 'stdout' + textReport = true } defaultConfig { - minSdk rootProject.ext.minSdk - targetSdk rootProject.ext.targetSdk + minSdk = rootProject.ext.minSdk + targetSdk = rootProject.ext.targetSdk if (rootProject.ext.antPlusLibName) { buildConfigField 'Boolean', 'ANTPLUS_ENABLED', "true" @@ -44,8 +44,8 @@ android { } } buildFeatures { - aidl true - buildConfig true + aidl = true + buildConfig = true } } diff --git a/hrdevice/lint-baseline.xml b/hrdevice/lint-baseline.xml index 73f790af7..375963cc0 100644 --- a/hrdevice/lint-baseline.xml +++ b/hrdevice/lint-baseline.xml @@ -1,389 +1,15 @@ - + + id="UnusedAttribute" + message="Attribute `usesPermissionFlags` is only used in API level 31 and higher (current min is 21)" + errorLine1=" android:usesPermissionFlags="neverForLocation" android:minSdkVersion="31"/>" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wear/build.gradle b/wear/build.gradle index ce1dc77da..5ecc61229 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -1,21 +1,21 @@ apply plugin: 'com.android.application' android { - namespace 'org.runnerup' - compileSdk rootProject.ext.compileSdk + namespace = 'org.runnerup' + compileSdk = rootProject.ext.compileSdk buildToolsVersion = rootProject.ext.buildToolsVersion compileOptions { - sourceCompatibility JavaVersion.toVersion("17") - targetCompatibility JavaVersion.toVersion("17") + sourceCompatibility = JavaVersion.toVersion("17") + targetCompatibility = JavaVersion.toVersion("17") } defaultConfig { - minSdk 25 - targetSdk rootProject.ext.targetSdk - versionName rootProject.ext.versionName - versionCode rootProject.ext.latestBaseVersionCode + rootProject.ext.versionCode + 1 - applicationId rootProject.ext.applicationId + minSdk = 25 + targetSdk = rootProject.ext.targetSdk + versionName = rootProject.ext.versionName + versionCode = rootProject.ext.latestBaseVersionCode + rootProject.ext.versionCode + 1 + applicationId = rootProject.ext.applicationId } signingConfigs { @@ -26,27 +26,27 @@ android { buildTypes { release { - debuggable false - minifyEnabled true - shrinkResources true + debuggable = false + minifyEnabled = true + shrinkResources = true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.txt' - signingConfig signingConfigs.release + signingConfig = signingConfigs.release } debug { - applicationIdSuffix ".debug" + applicationIdSuffix = ".debug" } } lint { - baseline file('lint-baseline.xml') - checkReleaseBuilds true - lintConfig file('lint.xml') - showAll true - //textOutput 'stdout' - textReport true + baseline = file('lint-baseline.xml') + checkReleaseBuilds = true + lintConfig = file('lint.xml') + showAll = true + //textOutput = 'stdout' + textReport = true } - namespace 'org.runnerup' + namespace = 'org.runnerup' buildFeatures { - buildConfig true + buildConfig = true } } @@ -58,10 +58,10 @@ repositories { // Duplicate class kotlin.collections.jdk8 (from MapBox?) dependencies { constraints { - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") { + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.2.0") { because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib") } - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") { + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.2.0") { because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib") } } @@ -76,9 +76,9 @@ dependencies { implementation "com.google.android.gms:play-services-wearable:${rootProject.ext.googlePlayServicesWearableVersion}" implementation "androidx.wear:wear:1.3.0" - implementation "androidx.wear:wear-ongoing:1.0.0" + implementation "androidx.wear:wear-ongoing:1.1.0" // Includes LocusIdCompat and new Notification categories for Ongoing Activity. - implementation "androidx.core:core:1.16.0" + implementation "androidx.core:core:1.17.0" } def props = new Properties() diff --git a/wear/lint-baseline.xml b/wear/lint-baseline.xml index 0e17fd917..1d8692c05 100644 --- a/wear/lint-baseline.xml +++ b/wear/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/wear/src/main/java/org/runnerup/service/ListenerService.java b/wear/src/main/java/org/runnerup/service/ListenerService.java index e83ebcb19..0a0bfb20f 100644 --- a/wear/src/main/java/org/runnerup/service/ListenerService.java +++ b/wear/src/main/java/org/runnerup/service/ListenerService.java @@ -264,9 +264,15 @@ private void updateNotification() { if (ongoingActivity == null) { return; } - ongoingActivity.update(this, new Status.Builder() - .addPart("Status", - new TextPart(getStatusString())).build()); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU + && checkSelfPermission(android.Manifest.permission.POST_NOTIFICATIONS) + != android.content.pm.PackageManager.PERMISSION_GRANTED) { + return; + } + + ongoingActivity.update( + this, new Status.Builder().addPart("Status", new TextPart(getStatusString())).build()); } private void dismissNotification() {