From fcb855cea9734c1afe964296221a28ade172d15c Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Mon, 18 Sep 2023 05:08:53 +0530 Subject: [PATCH 1/3] Bump AGP to 8.1.1 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c14a1fcd709..f1c861c9f47 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.0.2' + classpath 'com.android.tools.build:gradle:8.1.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong From a1f2b7f8e83e0427a099d7c12b3fc416d96616f7 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Mon, 18 Sep 2023 05:14:15 +0530 Subject: [PATCH 2/3] Switch to Files.createDirectories() --- .../schabi/newpipe/streams/io/StoredDirectoryHelper.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java b/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java index 1b74c90a504..53dc5cf2a8d 100644 --- a/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java +++ b/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java @@ -180,9 +180,12 @@ public boolean isDirect() { */ public boolean mkdirs() { if (docTree == null) { - // TODO: Use Files.createDirectories() when AGP 8.1 is available: - // https://issuetracker.google.com/issues/282544786 - return Files.exists(ioTree) || ioTree.toFile().mkdirs(); + try { + Files.createDirectories(ioTree); + } catch (final IOException e) { + Log.e(TAG, "Error while creating directories at " + ioTree, e); + } + return Files.exists(ioTree); } if (docTree.exists()) { From 779ea19222647065199e99d29b6780916491ac4c Mon Sep 17 00:00:00 2001 From: TobiGr Date: Wed, 20 Sep 2023 19:41:45 +0200 Subject: [PATCH 3/3] Fix doc formatting --- .../org/schabi/newpipe/streams/io/StoredDirectoryHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java b/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java index 53dc5cf2a8d..74fc74c76dd 100644 --- a/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java +++ b/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java @@ -170,8 +170,8 @@ public boolean isDirect() { /** * Only using Java I/O. Creates the directory named by this abstract pathname, including any - * necessary but nonexistent parent directories. Note that if this - * operation fails it may have succeeded in creating some of the necessary + * necessary but nonexistent parent directories. + * Note that if this operation fails it may have succeeded in creating some of the necessary * parent directories. * * @return true if and only if the directory was created,