Skip to content

Commit 335c939

Browse files
committed
Merge branch 'refs/heads/main' into worktree-searcher
2 parents c020320 + cee2756 commit 335c939

123 files changed

Lines changed: 7807 additions & 2561 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app-common-adb/src/main/java/eu/darken/butler/common/adb/service/AdbHostOptions.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ import kotlinx.parcelize.Parcelize
88
data class AdbHostOptions(
99
val isDebug: Boolean = BuildConfigWrap.DEBUG,
1010
val isTrace: Boolean = false,
11-
val isDryRun: Boolean = false,
1211
val recorderPath: String? = null
1312
) : Parcelable

app-common-io/src/main/aidl/eu/darken/butler/common/files/local/ipc/FileOpsConnection.aidl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface FileOpsConnection {
2121

2222
boolean exists(in LocalPath path);
2323

24-
boolean delete(in LocalPath path, boolean recursive, boolean dryRun);
24+
boolean delete(in LocalPath path, boolean recursive);
2525

2626
RemoteInputStream listFilesStream(in LocalPath path);
2727

app-common-io/src/main/aidl/eu/darken/butler/common/pkgs/pkgops/ipc/PkgOpsConnection.aidl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ interface PkgOpsConnection {
1515

1616
boolean forceStop(String packageName);
1717

18-
boolean clearCacheAsUser(String packageName, int handleId, boolean dryRun);
18+
boolean clearCacheAsUser(String packageName, int handleId);
1919

20-
boolean clearCache(String packageName, boolean dryRun);
20+
boolean clearCache(String packageName);
2121

22-
boolean trimCaches(long desiredBytes, String storageId, boolean dryRun);
22+
boolean trimCaches(long desiredBytes, String storageId);
2323

2424
List<PackageInfo> getInstalledPackagesAsUser(long flags, int handleId);
2525

app-common-io/src/main/java/eu/darken/butler/common/adb/service/AdbHost.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class AdbHost(
8787

8888
Bugs.isDebug = options.isDebug
8989
Bugs.isTrace = options.isTrace
90-
Bugs.isDryRun = options.isDryRun
9190
}
9291
.launchIn(hostScope)
9392
}

app-common-io/src/main/java/eu/darken/butler/common/adb/service/AdbServiceClient.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class AdbServiceClient @Inject constructor(
5353
val optionsInitial = AdbHostOptions(
5454
isDebug = debugSettings.isDebugMode.value(),
5555
isTrace = debugSettings.isTraceMode.value(),
56-
isDryRun = debugSettings.isDryRunMode.value(),
5756
recorderPath = debugSettings.recorderPath.value(),
5857
)
5958

@@ -69,14 +68,12 @@ class AdbServiceClient @Inject constructor(
6968
combine(
7069
debugSettings.isDebugMode.flow,
7170
debugSettings.isTraceMode.flow,
72-
debugSettings.isDryRunMode.flow,
7371
debugSettings.recorderPath.flow,
7472
lastInternal.filterNotNull(),
75-
) { isDebug, isTrace, isDryRun, recorderPath, lastConnection ->
73+
) { isDebug, isTrace, recorderPath, lastConnection ->
7674
val optionsDynamic = AdbHostOptions(
7775
isDebug = isDebug,
7876
isTrace = isTrace,
79-
isDryRun = isDryRun,
8077
recorderPath = recorderPath,
8178
)
8279
log(TAG) { "Updating debug settings: $optionsDynamic" }

app-common-io/src/main/java/eu/darken/butler/common/files/APath.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import kotlinx.serialization.Serializable
1212
sealed interface APath : Parcelable {
1313
val path: String
1414
val name: String
15+
val parent: APath?
1516

1617
val userReadablePath: CaString
1718
get() = path.toCaString()
Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
package eu.darken.butler.common.files
22

3+
import eu.darken.butler.common.files.actions.CopyAction
4+
import eu.darken.butler.common.files.actions.DeleteAction
5+
import eu.darken.butler.common.files.actions.MoveAction
36
import eu.darken.butler.common.files.metadata.Ownership
47
import eu.darken.butler.common.files.metadata.Permissions
5-
import eu.darken.butler.common.files.operations.CopyOperation
6-
import eu.darken.butler.common.files.operations.MoveOperation
78
import eu.darken.butler.common.sharedresource.HasSharedResource
89
import kotlinx.coroutines.flow.Flow
910
import okio.FileHandle
1011
import kotlin.time.Instant
1112

1213
interface APathGateway<
1314
P : APath,
14-
PLU : APathLookup<P>,
15-
PLUE : APathLookupExtended<P>,
16-
> : HasSharedResource<Any>, CopyOperation<P>, MoveOperation<P> {
15+
PL : APathLookup<P>,
16+
PLE : APathLookupExtended<P>,
17+
> : HasSharedResource<Any>,
18+
CopyAction<P>,
19+
MoveAction<P>,
20+
DeleteAction<P, PL> {
1721

1822
suspend fun createDir(path: P)
1923

2024
suspend fun createFile(path: P)
2125

2226
suspend fun listFiles(path: P): Collection<P>
2327

24-
suspend fun lookup(path: P): PLU
28+
suspend fun lookup(path: P): PL
2529

26-
suspend fun lookupFiles(path: P): Collection<PLU>
30+
suspend fun lookupFiles(path: P): Collection<PL>
2731

28-
suspend fun lookupFilesExtended(path: P): Collection<PLUE>
32+
suspend fun lookupFilesExtended(path: P): Collection<PLE>
2933

3034
suspend fun walk(
3135
path: P,
32-
options: WalkOptions<P, PLU> = WalkOptions()
33-
): Flow<PLU>
36+
options: WalkOptions<P, PL> = WalkOptions()
37+
): Flow<PL>
3438

3539
data class WalkOptions<P : APath, PLU : APathLookup<P>>(
3640
val pathDoesNotContain: Set<String>? = null,
@@ -43,7 +47,7 @@ interface APathGateway<
4347

4448
suspend fun du(
4549
path: P,
46-
options: DuOptions<P, PLU> = DuOptions()
50+
options: DuOptions<P, PL> = DuOptions()
4751
): Long
4852

4953
data class DuOptions<P : APath, PLU : APathLookup<P>>(
@@ -58,25 +62,11 @@ interface APathGateway<
5862

5963
suspend fun file(path: P, readWrite: Boolean): FileHandle
6064

61-
suspend fun delete(path: P, recursive: Boolean)
62-
6365
suspend fun createSymlink(linkPath: P, targetPath: P): Boolean
6466

6567
suspend fun setModifiedAt(path: P, modifiedAt: Instant): Boolean
6668

6769
suspend fun setPermissions(path: P, permissions: Permissions): Boolean
6870

6971
suspend fun setOwnership(path: P, ownership: Ownership): Boolean
70-
71-
override suspend fun copy(
72-
source: P,
73-
destination: P,
74-
options: CopyOperation.Options
75-
): Flow<CopyOperation.Result>
76-
77-
override suspend fun move(
78-
source: P,
79-
destination: P,
80-
options: MoveOperation.Options
81-
): Flow<MoveOperation.Result>
8272
}

0 commit comments

Comments
 (0)