Skip to content

Commit 1346277

Browse files
committed
Recorder: Update Gradle wrapper to 8.10
Since BuildConfig is deprecated we now get the package name from the application context We remove the app name from the service actions, as those actions are to be handled only internally in the service, they don't need to be specific. Change-Id: I4205f7af457955b59790201a97ea60b8bec4d0aa
1 parent 7fdcf5e commit 1346277

File tree

9 files changed

+32
-39
lines changed

9 files changed

+32
-39
lines changed

app/Android.bp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ android_app {
1313

1414
srcs: [
1515
"src/main/java/**/*.kt",
16-
"src_aosp/main/java/**/*.kt",
1716
],
1817

1918
product_specific: true,

app/src/main/java/org/lineageos/recorder/ListActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ class ListActivity : AppCompatActivity(), RecordingListCallbacks {
204204
private fun loadRecordings() {
205205
taskExecutor.runTask(
206206
GetRecordingsTask(
207+
applicationContext.packageName,
207208
contentResolver
208209
)
209210
) { list: List<RecordingData> ->

app/src/main/java/org/lineageos/recorder/service/SoundRecorderService.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import android.util.Log
3131
import androidx.annotation.GuardedBy
3232
import androidx.core.app.NotificationCompat
3333
import androidx.core.content.ContextCompat
34-
import org.lineageos.recorder.BuildConfig
3534
import org.lineageos.recorder.ListActivity
3635
import org.lineageos.recorder.R
3736
import org.lineageos.recorder.RecorderActivity
@@ -568,10 +567,10 @@ class SoundRecorderService : Service() {
568567
companion object {
569568
private const val TAG = "SoundRecorderService"
570569

571-
const val ACTION_START = "${BuildConfig.APPLICATION_ID}.service.START"
572-
const val ACTION_STOP = "${BuildConfig.APPLICATION_ID}.service.STOP"
573-
const val ACTION_PAUSE = "${BuildConfig.APPLICATION_ID}.service.PAUSE"
574-
const val ACTION_RESUME = "${BuildConfig.APPLICATION_ID}.service.RESUME"
570+
const val ACTION_START = "START"
571+
const val ACTION_STOP = "STOP"
572+
const val ACTION_PAUSE = "PAUSE"
573+
const val ACTION_RESUME = "RESUME"
575574

576575
const val MSG_REGISTER_CLIENT = 0
577576
const val MSG_UNREGISTER_CLIENT = 1

app/src/main/java/org/lineageos/recorder/task/GetRecordingsTask.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ package org.lineageos.recorder.task
88
import android.content.ContentResolver
99
import android.content.ContentUris
1010
import android.provider.MediaStore
11-
import org.lineageos.recorder.BuildConfig
1211
import org.lineageos.recorder.list.RecordingData
1312
import java.time.Instant
1413
import java.time.LocalDateTime
1514
import java.time.ZoneId
1615
import java.util.concurrent.Callable
1716

1817
class GetRecordingsTask(
18+
private val packageName: String,
1919
private val contentResolver: ContentResolver,
2020
) : Callable<List<RecordingData>> {
2121
override fun call(): List<RecordingData> {
@@ -26,7 +26,7 @@ class GetRecordingsTask(
2626
PROJECTION,
2727
"${MediaStore.Audio.Media.OWNER_PACKAGE_NAME}=?",
2828
arrayOf(
29-
BuildConfig.APPLICATION_ID,
29+
packageName,
3030
),
3131
MY_RECORDS_SORT
3232
)?.use { cursor ->

app/src_aosp/main/java/org/lineageos/recorder/BuildConfig.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.

gradle/wrapper/gradle-wrapper.jar

-19.7 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
54
networkTimeout=10000
65
validateDistributionUrl=true
76
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum
@@ -145,15 +148,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145148
case $MAX_FD in #(
146149
max*)
147150
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148-
# shellcheck disable=SC3045
151+
# shellcheck disable=SC2039,SC3045
149152
MAX_FD=$( ulimit -H -n ) ||
150153
warn "Could not query maximum file descriptor limit"
151154
esac
152155
case $MAX_FD in #(
153156
'' | soft) :;; #(
154157
*)
155158
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC3045
159+
# shellcheck disable=SC2039,SC3045
157160
ulimit -n "$MAX_FD" ||
158161
warn "Could not set maximum file descriptor limit to $MAX_FD"
159162
esac
@@ -202,11 +205,11 @@ fi
202205
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203206
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204207

205-
# Collect all arguments for the java command;
206-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
207-
# shell script including quotes and variable substitutions, so put them in
208-
# double quotes to make sure that they get re-expanded; and
209-
# * put everything else in single quotes, so that it's not re-expanded.
208+
# Collect all arguments for the java command:
209+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210+
# and any embedded shellness will be escaped.
211+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212+
# treated as '${Hostname}' itself on the command line.
210213

211214
set -- \
212215
"-Dorg.gradle.appname=$APP_BASE_NAME" \

gradlew.bat

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

0 commit comments

Comments
 (0)