0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-19 19:42:17 +02:00
Commit Graph

210 Commits

Author SHA1 Message Date
Mike Hardy
5280253dbc
Dependency updates 20240830 (#17004)
* chore(deps): bump axios from 1.7.3 to 1.7.4 in /tools/localization

Bumps [axios](https://github.com/axios/axios) from 1.7.3 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.3...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): remote obsolete gradle home cache cleanup property

- this was toggled on for 3 workflows, it is on by default not: removing
- this was *not* toggled on for unit tests because we have observed problems before,
  but now it is the default for everyone and I am assertively/hopefully assuming
  they have fixed the problems we have seen (or will do so shortly) so letting it
  become enabled with its new default setting

Note that if workflow runs start failing, this was the comment leading to upstream
information:

gradle-home-cache-cleanup is temporarily disabled to investigate cache pollution issues
Requested in: https://github.com/gradle/actions/issues/167#issuecomment-2052352341
gradle-home-cache-cleanup: true

* chore(deps-dev): bump the non-breaking group across 1 directory with 3 updates

Bumps the non-breaking group with 3 updates in the /tools/localization directory: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser).


Updates `@types/node` from 22.3.0 to 22.4.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 8.1.0 to 8.2.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.2.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.1.0 to 8.2.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.2.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump org.apache.commons:commons-compress

Bumps org.apache.commons:commons-compress from 1.27.0 to 1.27.1.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-compress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps-dev): bump @types/node

Bumps the non-breaking group in /tools/localization with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 22.4.1 to 22.4.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: non-breaking
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump kotlin from 2.0.10 to 2.0.20

Bumps `kotlin` from 2.0.10 to 2.0.20.

Updates `org.jetbrains.kotlin:kotlin-stdlib` from 2.0.10 to 2.0.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.10...v2.0.20)

Updates `org.jetbrains.kotlin:kotlin-reflect` from 2.0.10 to 2.0.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.10...v2.0.20)

Updates `org.jetbrains.kotlin:kotlin-test` from 2.0.10 to 2.0.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.10...v2.0.20)

Updates `org.jetbrains.kotlin:kotlin-test-junit` from 2.0.10 to 2.0.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.10...v2.0.20)

Updates `org.jetbrains.kotlin:kotlin-test-junit5` from 2.0.10 to 2.0.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.10...v2.0.20)

Updates `org.jetbrains.kotlin.android` from 2.0.10 to 2.0.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.10...v2.0.20)

Updates `org.jetbrains.kotlin.plugin.parcelize` from 2.0.10 to 2.0.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.10...v2.0.20)

Updates `org.jetbrains.kotlin.jvm` from 2.0.10 to 2.0.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.10...v2.0.20)

Updates `org.jetbrains.kotlin.plugin.serialization` from 2.0.10 to 2.0.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.10...v2.0.20)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-reflect
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-test-junit
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-test-junit5
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.android
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.plugin.parcelize
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.jvm
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.plugin.serialization
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps-dev): bump @types/node

Bumps the non-breaking group in /tools/localization with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 22.4.2 to 22.5.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump androidxMedia3 from 1.4.0 to 1.4.1 (#16969)

Bumps `androidxMedia3` from 1.4.0 to 1.4.1.

Updates `androidx.media3:media3-ui` from 1.4.0 to 1.4.1
- [Release notes](https://github.com/androidx/media/releases)
- [Changelog](https://github.com/androidx/media/blob/release/RELEASENOTES.md)
- [Commits](https://github.com/androidx/media/commits)

Updates `androidx.media3:media3-exoplayer-dash` from 1.4.0 to 1.4.1
- [Release notes](https://github.com/androidx/media/releases)
- [Changelog](https://github.com/androidx/media/blob/release/RELEASENOTES.md)
- [Commits](https://github.com/androidx/media/commits)

Updates `androidx.media3:media3-exoplayer` from 1.4.0 to 1.4.1
- [Release notes](https://github.com/androidx/media/releases)
- [Changelog](https://github.com/androidx/media/blob/release/RELEASENOTES.md)
- [Commits](https://github.com/androidx/media/commits)

---
updated-dependencies:
- dependency-name: androidx.media3:media3-ui
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: androidx.media3:media3-exoplayer-dash
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: androidx.media3:media3-exoplayer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump com.android.tools:desugar_jdk_libs_nio (#16968)

Bumps [com.android.tools:desugar_jdk_libs_nio](https://github.com/google/desugar_jdk_libs) from 2.0.4 to 2.1.0.
- [Changelog](https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/desugar_jdk_libs/commits)

---
updated-dependencies:
- dependency-name: com.android.tools:desugar_jdk_libs_nio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump com.google.protobuf:protobuf-kotlin-lite (#16986)

Bumps com.google.protobuf:protobuf-kotlin-lite from 4.27.3 to 4.27.4.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin-lite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump com.android.tools:desugar_jdk_libs_nio (#16997)

Bumps [com.android.tools:desugar_jdk_libs_nio](https://github.com/google/desugar_jdk_libs) from 2.1.0 to 2.1.1.
- [Changelog](https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/desugar_jdk_libs/commits)

---
updated-dependencies:
- dependency-name: com.android.tools:desugar_jdk_libs_nio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump lint from 31.5.2 to 31.6.0 (#17002)

Bumps `lint` from 31.5.2 to 31.6.0.

Updates `com.android.tools.lint:lint-api` from 31.5.2 to 31.6.0

Updates `com.android.tools.lint:lint` from 31.5.2 to 31.6.0

Updates `com.android.tools.lint:lint-tests` from 31.5.2 to 31.6.0

---
updated-dependencies:
- dependency-name: com.android.tools.lint:lint-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.android.tools.lint:lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.android.tools.lint:lint-tests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump androidGradlePlugin from 8.5.2 to 8.6.0

! This change requires Android Studio Koala Feature Drop

We fix the following error with a `SuppressLint` annotation.
The code converts a valid int to a long (as the caller requests a long)
but this long is not detected as valid

```
AddContentApi.kt:553: Error: Must be one or more of:
PackageManager.GET_META_DATA, PackageManager.GET_SHARED_LIBRARY_FILES, ...,
PackageManager.GET_UNINSTALLED_PACKAGES [WrongConstant]
                              PackageManager.GET_META_DATA.toLong()
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Bumps `androidGradlePlugin` from 8.5.2 to 8.6.0.

Updates `com.android.application` from 8.5.2 to 8.6.0

Updates `com.android.library` from 8.5.2 to 8.6.0

---
updated-dependencies:
- dependency-name: com.android.application
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.android.library
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-json

Bumps [org.jetbrains.kotlinx:kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kotlin/kotlinx.serialization/compare/v1.7.1...v1.7.2)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump com.google.protobuf:protobuf-kotlin-lite

Bumps com.google.protobuf:protobuf-kotlin-lite from 4.27.4 to 4.28.0.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin-lite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump com.github.triplet.play from 3.10.1 to 3.11.0

Bumps com.github.triplet.play from 3.10.1 to 3.11.0.

---
updated-dependencies:
- dependency-name: com.github.triplet.play
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump the non-breaking group across 1 directory with 7 updates

Bumps the non-breaking group with 7 updates in the /tools/localization directory:

| Package | From | To |
| --- | --- | --- |
| [axios](https://github.com/axios/axios) | `1.7.4` | `1.7.5` |
| [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) | `9.9.0` | `9.9.1` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `22.5.0` | `22.5.1` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.2.0` | `8.3.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.2.0` | `8.3.0` |
| [eslint](https://github.com/eslint/eslint) | `9.9.0` | `9.9.1` |
| [ts-jest](https://github.com/kulshekhar/ts-jest) | `29.2.4` | `29.2.5` |



Updates `axios` from 1.7.4 to 1.7.5
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.4...v1.7.5)

Updates `@eslint/js` from 9.9.0 to 9.9.1
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/commits/v9.9.1/packages/js)

Updates `@types/node` from 22.5.0 to 22.5.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 8.2.0 to 8.3.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.3.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.2.0 to 8.3.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.3.0/packages/parser)

Updates `eslint` from 9.9.0 to 9.9.1
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.9.0...v9.9.1)

Updates `ts-jest` from 29.2.4 to 29.2.5
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.2.4...v29.2.5)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-breaking
- dependency-name: "@eslint/js"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: non-breaking
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: non-breaking
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: non-breaking
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: non-breaking
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump com.android.tools:desugar_jdk_libs_nio (#17018)

Bumps [com.android.tools:desugar_jdk_libs_nio](https://github.com/google/desugar_jdk_libs) from 2.1.1 to 2.1.2.
- [Changelog](https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/desugar_jdk_libs/commits)

---
updated-dependencies:
- dependency-name: com.android.tools:desugar_jdk_libs_nio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump androidxFragmentKtx from 1.8.2 to 1.8.3 (#17023)

Bumps `androidxFragmentKtx` from 1.8.2 to 1.8.3.

Updates `androidx.fragment:fragment-ktx` from 1.8.2 to 1.8.3

Updates `androidx.fragment:fragment-testing` from 1.8.2 to 1.8.3

Updates `androidx.fragment:fragment-testing-manifest` from 1.8.2 to 1.8.3

---
updated-dependencies:
- dependency-name: androidx.fragment:fragment-ktx
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: androidx.fragment:fragment-testing
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: androidx.fragment:fragment-testing-manifest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump androidx.activity:activity from 1.9.1 to 1.9.2

Bumps androidx.activity:activity from 1.9.1 to 1.9.2.

---
updated-dependencies:
- dependency-name: androidx.activity:activity
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump the non-breaking group across 1 directory with 5 updates

Bumps the non-breaking group with 5 updates in the /tools/localization directory:

| Package | From | To |
| --- | --- | --- |
| [axios](https://github.com/axios/axios) | `1.7.5` | `1.7.7` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `22.5.1` | `22.5.4` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.3.0` | `8.4.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.3.0` | `8.4.0` |
| [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) | `2.29.1` | `2.30.0` |



Updates `axios` from 1.7.5 to 1.7.7
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.5...v1.7.7)

Updates `@types/node` from 22.5.1 to 22.5.4
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 8.3.0 to 8.4.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.4.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.3.0 to 8.4.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.4.0/packages/parser)

Updates `eslint-plugin-import` from 2.29.1 to 2.30.0
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.29.1...v2.30.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-breaking
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: non-breaking
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-06 18:38:16 -05:00
andriusezerskis
c63e93a09f Remove wildcard from imports 2024-07-17 09:16:28 +00:00
abdelrahmanesam
dcb10769b1 extract magic numbers to version catalog 2024-06-16 08:21:52 +00:00
Viktoriia Sidorova
5c5b11e0ea
[Cleanup]: Fix Android Studio Warnings #13282 (#16040)
* deleted empty string
* removed redundant qualifier name
* fixed warning "Variable is same as 'searchText' and can be inlined"
* removed redundant ‘constructor’ keyword
* removed unnecessary parentheses in function call with lambda
* removed explicit type arguments
* fixed foldable if-then
* replaced java methods with kotlin analog
* moved lambda argument out of parentheses
* replaced negated 'isEmpty' with 'isNotEmpty'
* replaced subsequent checks with 'isNullOrEmpty()' call
* used import statement for max function in Scheduler.kt
* used import statement for ceil function in Scheduler.kt
* reformatted code
2024-04-01 14:43:10 -05:00
AbdelrahmanEsam
bb0c4a85bf
Migrate version catalog (#15966)
* version catalog conflict
 solve

* implementing version catalog for stable versioning between modules

* implementing version catalog for stable versioning between modules

---------

Co-authored-by: abdelrahmanesam <abdelrahmanesam>
2024-03-27 00:53:28 +00:00
Rohit Raj
debb686b6d
Update api build.gradle to enable explicitApi() (#15709) 2024-02-29 12:41:28 +00:00
David Allison
65c9f9197e chore: Remove col from class Card
This requires adding `col` to any function using it, recursively, until finding another function with `col` in its context.

`Reviewer.onResume` has moved to `launchWithCol`, as otherwise tests crash
with the following trace:

```
java.lang.NullPointerException
	at com.ichi2.anki.AnkiActivity.getCol(AnkiActivity.kt:151)
	at com.ichi2.anki.Reviewer.onResume(Reviewer.kt:191)
	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1476)
	at org.robolectric.android.internal.RoboMonitoringInstrumentation.callActivityOnResume(RoboMonitoringInstrumentation.java:321)
	at android.app.Activity.performResume(Activity.java:8191)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.robolectric.shadows._Activity_$$Reflector19.performResume(Unknown Source)
	at org.robolectric.android.controller.ActivityController.lambda$resume$5(ActivityController.java:197)
	at org.robolectric.shadows.ShadowPausedLooper.runPaused(ShadowPausedLooper.java:204)
	at org.robolectric.android.controller.ComponentController.invokeWhilePaused(ComponentController.java:64)
	at org.robolectric.android.controller.ActivityController.resume(ActivityController.java:192)
	at org.robolectric.android.internal.RoboMonitoringInstrumentation.startActivitySyncInternal(RoboMonitoringInstrumentation.java:121)
	at org.robolectric.android.internal.LocalActivityInvoker.startActivity(LocalActivityInvoker.java:35)
	at org.robolectric.android.internal.LocalActivityInvoker.startActivity(LocalActivityInvoker.java:40)
	at androidx.test.core.app.ActivityScenario.launchInternal(ActivityScenario.java:362)
	at androidx.test.core.app.ActivityScenario.launch(ActivityScenario.java:202)
	at com.ichi2.anki.ReviewerTest.verifyStartupNoCollection(ReviewerTest.kt:67)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:589)
	at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$2(SandboxTestRunner.java:290)
	at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:99)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	Suppressed:
        org.robolectric.android.internal.AndroidTestEnvironment$UnExecutedRunnablesException:
        Main looper has queued unexecuted runnables. This might be the cause of
        the test failure. You might need a
        shadowOf(Looper.getMainLooper()).idle() call.
```

In the worst case, this slightly delays when the time starts again, which is acceptable.

----

Revived from 5f01180be2

Co-authored-by: Arthur Milchior <arthur@milchior.fr>
2024-01-17 17:14:18 +00:00
David Allison
5f2cc77db6
cleanup: Hungarian Notation - all but 5 files (#15181)
* cleanup: AddContentApi - Hungarian Notation
* cleanup: SharedDecksDownloadFragment - Hungarian Notation
* cleanup: AbstractFlashcardViewer - Hungarian Notation
* cleanup: Reviewer - Hungarian Notation
* cleanup: RecursivePictureMenu - Hungarian Notation
* cleanup: FieldEditLine - Hungarian Notation
* cleanup: ActivityExportingDelegate - Hungarian Notation
* cleanup: DeckPicker - Hungarian Notation
* cleanup: MultimediaEditFieldActivity - Hungarian Notation
* cleanup: FieldControllerBase - Hungarian Notation
* cleanup: AnkiDroidJsAPI - Hungarian Notation
* cleanup: DeckAdapter - Hungarian Notation
* cleanup: Previewer - Hungarian Notation
* cleanup: CardTemplatePreviewer - Hungarian Notation
* cleanup: BasicImageFieldController - Hungarian Notation
* cleanup: AudioRecorder - Hungarian Notation
* cleanup: AppCompatPreferenceActivity - Hungarian Notation
* cleanup: AudioField - Hungarian Notation
* cleanup: Collection - Hungarian Notation
* cleanup: MultimediaEditableNote - Hungarian Notation
* cleanup: CardTemplateNotetype - Hungarian Notation
* cleanup: Card - Hungarian Notation
* cleanup: BasicTextFieldController - Hungarian Notation
2024-01-08 19:28:30 -05:00
Aarushi Shah
e38bfe4a97 Fix Android Studio warnings for redundant constructors 2024-01-02 12:51:40 +00:00
David Allison
6b98b13e28
Kotlin Cleanup: KDocs (#14852)
* Kotlin Cleanup: docs

* removed almost all occurrence of `{@}` in the code
* searched for `<pre>` and removed one more
* and a little extra cleanup on docs strings when I saw them

Learning:
* 4 spaces before a line removes KDoc `[]` links
* KDoc has no way to link to a specific method overload

* Kotlin Cleanup: docs

* Fixed `&lt;` -> `<`
* Fixed `&gt;` -> `>`
2023-11-30 21:01:01 -05:00
Mike Hardy
4ac94b14fe build(api): fix artifact construction and publishing
none of the old stuff worked anymore, redid following current docs
2023-11-21 17:41:46 -05:00
Mike Hardy
3d8af2977a build(deps): API module should have same targetApi as others 2023-10-30 17:42:26 +00:00
Mike Hardy
c344988170
Dependency updates 20231019 (#14563)
* build(deps): ignore commons-compress below 1.25 now

We are still not minSdkVersion >= API26 so we may not advance this
dependency yet, we just notch this forward one version at a time
so we continue to be aware of their releases, but ignore them for now

* build(deps): bump androidx.annotation:annotation from 1.6.0 to 1.7.0

Bumps androidx.annotation:annotation from 1.6.0 to 1.7.0.

---
updated-dependencies:
- dependency-name: androidx.annotation:annotation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump com.google.protobuf:protobuf-kotlin-lite

Bumps com.google.protobuf:protobuf-kotlin-lite from 3.24.2 to 3.24.3.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin-lite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump org.jlleitschuh.gradle.ktlint from 11.5.1 to 11.6.0

Bumps org.jlleitschuh.gradle.ktlint from 11.5.1 to 11.6.0.

---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle.ktlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump com.google.protobuf:protobuf-kotlin-lite

Bumps com.google.protobuf:protobuf-kotlin-lite from 3.24.3 to 3.24.4.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin-lite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump commons-io:commons-io from 2.13.0 to 2.14.0

Bumps commons-io:commons-io from 2.13.0 to 2.14.0.

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump io.mockk:mockk from 1.13.7 to 1.13.8

Bumps [io.mockk:mockk](https://github.com/mockk/mockk) from 1.13.7 to 1.13.8.
- [Release notes](https://github.com/mockk/mockk/releases)
- [Commits](https://github.com/mockk/mockk/compare/1.13.7...1.13.8)

---
updated-dependencies:
- dependency-name: io.mockk:mockk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Gradle Wrapper from 8.3 to 8.4.

Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>

* Only split APK build by ABI in release builds

This avoids the upstream android gradle plugin issue introduced in
AGPv8.1.2 (and seemingly fixed in AGBv8.3.0-alpha07) where doing
an ABI split while including resources crashes the build:

https://issuetracker.google.com/issues/302961829

If this causes problems or is distasteful, can be reverted when
AGP v8.3+ is adopted, or if they do pick it to AGPv8.2+, at that time

* Adopt android gradle plugin v8.1.2

* ignore dynamic receiver registrations without export-type specified

these receivers *should* specify at registration whether they are for export
or not for export but if that is added (such as in PR 14158) then there is also
a need to add a new permission to the manifest or you get runtime errors, and
we haven't figured that out yet

* build(deps): bump org.jetbrains.dokka from 1.9.0 to 1.9.10

Bumps [org.jetbrains.dokka](https://github.com/Kotlin/dokka) from 1.9.0 to 1.9.10.
- [Release notes](https://github.com/Kotlin/dokka/releases)
- [Commits](https://github.com/Kotlin/dokka/compare/v1.9.0...v1.9.10)

---
updated-dependencies:
- dependency-name: org.jetbrains.dokka
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump com.squareup.okhttp3:okhttp from 4.11.0 to 4.12.0

Bumps [com.squareup.okhttp3:okhttp](https://github.com/square/okhttp) from 4.11.0 to 4.12.0.
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-4.11.0...parent-4.12.0)

---
updated-dependencies:
- dependency-name: com.squareup.okhttp3:okhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump org.jlleitschuh.gradle.ktlint from 11.6.0 to 11.6.1

Bumps org.jlleitschuh.gradle.ktlint from 11.6.0 to 11.6.1.

---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle.ktlint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump compileSdk to 34, handle new deprecations (#14556)

* Bump compileSdk to 34

* Alter system API overrides to handle newly nullable items in API34

Investigating the various changes led me to conclude that simple null
checks and default returns if null was an adequate response to the
newly-possible null case in the various parameters

* API34 deprecates Class.newInstance, get ctor and newInstance that instead

* use new API34 pixel calc style if available

this apparently allows for finer more dynamic user text sizing

* Temporarily suppress deprecation on animation overrides

API34 adds new predictive back behavior, which implies that the
transition animation overrides for activity stack change animations
now need to know whether the animation override is for activity open or
close, whereas we override both as a unit without thought

This needs a solution before the deprecated methods go away, likely in
the form of plumbing through (via a new parameter) the idea of whether
the call site intended to override open, close, or both animations. For
backwards compatibility this will likely need to be a Compat interface
(or interfaces) to replace the current implementation

* build(deps): bump androidx.webkit:webkit from 1.7.0 to 1.8.0

Bumps androidx.webkit:webkit from 1.7.0 to 1.8.0.

---
updated-dependencies:
- dependency-name: androidx.webkit:webkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.browser:browser from 1.5.0 to 1.6.0

Bumps androidx.browser:browser from 1.5.0 to 1.6.0.

---
updated-dependencies:
- dependency-name: androidx.browser:browser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.activity:activity-ktx from 1.7.2 to 1.8.0 (#14515)

* build(deps): bump androidx.activity:activity-ktx from 1.7.2 to 1.8.0

Bumps androidx.activity:activity-ktx from 1.7.2 to 1.8.0.

---
updated-dependencies:
- dependency-name: androidx.activity:activity-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* call super.onBackPressed in onBackPressed overrides

This is more "predictive back" feature fallout, this commit should be examined,
and the behavior in these 4 objects may need a change, in order to more correctly
deal with API34 predictive back

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Hardy <github@mikehardy.net>

* build(deps): bump androidx.recyclerview:recyclerview from 1.3.1 to 1.3.2

Bumps androidx.recyclerview:recyclerview from 1.3.1 to 1.3.2.

---
updated-dependencies:
- dependency-name: androidx.recyclerview:recyclerview
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.core:core-ktx from 1.10.1 to 1.12.0 (#14407)

* build(deps): bump androidx.core:core-ktx from 1.10.1 to 1.12.0

Bumps androidx.core:core-ktx from 1.10.1 to 1.12.0.

---
updated-dependencies:
- dependency-name: androidx.core:core-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* PendingIntentCompat.getBroadcast() is nullable now, wrap use of result in null checks

It will only return null if we specify intent flags which we never specify, so our behavior
does not need to change, but we must respect the type system by wrapping the use of the now-nullable
result in null checks

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Hardy <github@mikehardy.net>

* build(deps): bump androidx.sqlite:sqlite-framework from 2.3.1 to 2.4.0

Bumps androidx.sqlite:sqlite-framework from 2.3.1 to 2.4.0.

---
updated-dependencies:
- dependency-name: androidx.sqlite:sqlite-framework
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.appcompat:appcompat

Bumps androidx.appcompat:appcompat from 1.7.0-alpha02 to 1.7.0-alpha03.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-10-20 11:31:16 +00:00
lukstbit
2898935b55
Migrate api module's build file to kotlin dsl (#14542)
* Rename api/build.gradle to api/build.gradle.kts

* Use kotlin dsl in api/build.gradle.kts
2023-10-15 15:19:42 -03:00
Ruben Quadros
cca7bfac95
[Clean up]: Fix Android studio warnings (#14521)
* [Clean up]: Fix Android studio warnings

* [Clean up]: Fix Kdoc issues
2023-10-11 13:02:33 -03:00
the_mr17
a61510d9ca Removes unnecessary api <= 23 checks 2023-09-20 06:52:11 -03:00
lukstbit
ae453d2c40 Switch to dokka for generating documentation in api module
See https://kotlinlang.org/docs/dokka-introduction.html
Note: dokka seems to be one version behind the official kotlin version.

The change in FlashCardsContract was done as dokka complained about
that particular ###### combination.
2023-09-12 08:46:09 -05:00
Aditya
1a9efa6016
#14258 Fixed this issue. (#14368)
* Hide the Floating Action Button

* Removed the Code of the Floating Action Button in CardBrowser.kt

* fixing lint debug failed problem

* Fixed the Issue:- Deprecation: compileSdkVersion
2023-09-02 12:10:53 +03:00
lukstbit
7003e0b4d1 Configure dependencies resolution in settings.gradle.kts
Ideally we  would use
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) to enforce
 the repositories declared in settings.gradle.kts but it currently
conflicts with a local maven repository declared in
robolectricDownloader.gradle.

The repositories lambda wasn't deleted from the AnkiDroid module as
the build failed in relation to "com.android.tools:desugar_jdk_libs"(
most likely and issue with the dependency itself) with the error:

Could not resolve all dependencies for configuration ':AnkiDroid:coreLibraryDesugaring'.
The project declares repositories, effectively ignoring the repositories you have declared in the settings.
You can figure out how project repositories are declared by configuring your build to fail on project repositories.
See https://docs.gradle.org/8.1.1/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
Could not find com.android.tools:desugar_jdk_libs:2.0.3.
Searched in the following locations:
  - file:/home/*/.m2/repository/com/android/tools/desugar_jdk_libs/2.0.3/desugar_jdk_libs-2.0.3.pom
    If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
    project :AnkiDroid
2023-08-31 20:52:04 -05:00
Damien Elmes
7a65160e0e
Drop legacy schema, and update to 2.1.66 backend (#14171)
* Update target API to 23

* Update to 2.1.66, and switch to new schema by default

+ Temporarily disable unused resource warnings

* Drop legacy syncing code

* Drop legacy import/export code

* Drop legacy tag handling

* Drop legacy config handling

* Drop legacy database check

* Stub out unused v1 scheduler code

Can't be fully removed, as we still need to be able to open a v1 collection
so the user can upgrade.

moveVersions test has been removed, as backend code is used for moving
outside of unit tests.

* Drop legacy deck handling

* Drop legacy search code

* Drop legacy notetype code

This breaks the card template editor, so I've temporarily disabled it
in the GUI. Getting it working again will require switching to the new
template rendering code in the new backend.

Also breaks an "empty cards" action in CardContentProvider,
as I was not sure what it was trying to accomplish.

* Drop legacy media code

This removes oakkitten's custom media checking code, as keeping it
would require keeping a bunch of the duplicated Kotlin logic. His comment
about cancellation is incorrect: the call can be cancelled with backend.
setWantsAbort() on a background thread. And since the app enforces filenames
are normalized when they're added anyway, I don't think avoiding automatic
normalization is worth the duplicated code.

* Drop legacy Collection/DB code

* Drop most references to defaultLegacySchema

* Remove legacy schema tests from CI

CI won't work yet, because backend version needs updating

* Fix import CSV call

* Remove some unused symbols from anki module

* Drop majority of old stats code

* Remove unused symbols from libanki

* Remove some broken Android tests, and fix one

checkIfStudyOptionsIsDisplayedOnTablet() is also consistently failing,
but was doing so before I started on these changes.

* Move config methods into col.config

* Simplify config API

- Use kotlinx.serialization so that arbitrary typed objects can be
(de)serialized
- There is a single generic get(), that always returns an optional
value, which will be null if the key is missing, is null, or is not the
correct type. There will always be collections that have invalid data,
so the calling code always needs to be prepared to substitute a reasonable
default in such cases.
- Expose the typed getBool() method from the backend.

* Remove unused legacy importer

* Drop jackson

* Models -> Notetypes

* Remove some more unused symbols

* Remove generic type aliases

* Rename Model -> Notetype

I had to leave ModelTest.kt's filename alone, as changing it to Notetype.kt
reorders the unit tests, and causes about 4 tests to start flaking.

* Get card template editor preview working again

* Enable undo on edits; fix test hang

* Use backend for bulk suspend/undo

By default, undoableOp() notifies all screens listening for opExecuted,
so the refreshing happens automatically, and the manual refresh code
at the end of the old routine is no longer required. It is possible to
bypass this when you want to manually update the UI, but this is probably
not worth attempting until the card browser is either switched over to
a recycler view, or reimplemented as a web component.

The LongArrays have been switched to simple lists, as Google's protobuf
code expects Iterable<Long>

* Use backend for marking/undo, and change deck/undo

* Migrate reviewer actions/undo to backend

* Migrate remainder of undo code to backend, apart from v2 undo

Couple of notes:

- The legacy v2 undo no longer returns the undone card, and instead
rebuilds the queue. In some circumstances (eg a learning card has become
due), this can result in a different card being shown after undoing.
This is not ideal, but v2 does not have long to live at this point.
- The reset/reposition tests were reusing the old card cache values,
which have to be reloaded after an operation.
- A test in AbstractSched had to be moved to ReviewerTest so it can have
access to an activity.
- UndoTest has been removed, as it mainly focused on removed code.

* GetCard() -> getNextCardAndRedraw()

* render_output -> renderOutput()

* Drop AsyncTask

Probably the hardest part of AnkiDroid's code base to follow; very
glad to see the end of it.

Closes #7108

* Make note addition undoable

* Make bulk tag update undoable

* Remove remaining explicit transaction handling

The backend automatically wraps backend actions in a transaction,
and removing the explicit calls will allow us to drop the redundant
mutex that rsdroid acquires.

* Remove remaining unused classes/methods/properties

* Remove FunctionalInterfaces

* Switch to backend answer comparison

* Remove unused locking code + legacy storage code

* Switch ContentProviderTest to new schema, and fix bug

* Remove legacy Deck Options settings

* fix: remove minSdkVersion < 23 code

* Use short time in snackbars

People complained about snackbars interrupting their reviews before

* fix: don't duplicate undo label

It were showing a message like `Undo Undo Add Note`

* Remove "Advanced statistics"

* Remove legacy_schema local property

* Leave zip validation up to the backend

The backend takes care of validating the zip file and ensuring files aren't
written outside of the media folder.

I've expanded the mime match to include the zip mime, on the assumption
that's what the mime type is being changed to on some devices. If that
proves to be insufficient, a much simpler approach would be to look
for 50 4B 03 04 at the start of the file to determine if it's a zip file
or not.

This leaves only Mani's add-on code using commons-compression, so you
could potentially switch to a simpler tgz-specific library in the future
if that is easier.

* Disable two flaky tests

They started to flaky reliably after the legacy deck options test
was removed.

* Improve logging of HTTP requests

* Remove ModelBrowser

Replaced by ManageNotetypes

* Remove legacy CardInfo

replaced by com.ichi2.anki.pages.CardInfo

* Change comments at AdvancedSettingsFragment

* test: check if prefs analytics list don't have extra elements

* ContextCompat.getColor -> getColor

that compat method is for implementations in API < 23

* Remove more unused files

* refactor: move SECONDS_PER_DAY to a separate util file

in order to be able to remove Stats.kt later

* refactor: remove Stats and OverviewStatsBuilder

* Access sched.card directly in tests

The helper was adding a 500ms sleep on every fetch, which slowed the
scheduler tests down considerably.

* Make v3 scheduler the default; drop support for v2

The v3 scheduler was originally released in 2021, and we've been waiting
for a stable AnkiDroid release to support it before we could switch users
over to it. Now that 2.16 is out, we can finally push v3 out across the
ecosystem.

While we could theoretically make v3 the default without removing v2,
here are the reasons why I think we're better off switching to v3 only:

- AnkiWeb's review interface will likely switch over to v3-only in the
coming weeks, and AnkiMobile will likely drop v2 around the same time
2.17 comes out.
- v2 and v3 differ in a few ways that makes maintaining the two separate
paths more complicated: things like the different undo paths, counts not
including the current card, and the way the v3 scheduler supports custom
scheduler js. 2.17 is a chance to clean up a lot of old cruft in the
code base, and the old scheduling code is part of that.
- v2 and v3 are compatible with each other, and don't require a full sync
to change, so it doesn't break syncing with old clients (though depending
on settings, due counts may differ, which needs explanation)

I had to disable a couple of tests for this that we'll probably want
to restore in some form:

- corruptVersion16CollectionShowsDatabaseError() needs an update, and
it may be time to rip out the old CollectionHelper colIsOpen(), getColSafe()
and so on, migrating code that uses it over to withCol() instead. The
'collection inaccessible' dialog also needs a rethink - perhaps the various
exceptions could be handled in launchCatchingTask instead.
- testUndoResetsCardCountsToCorrectValue() is failing because initLayout()
creates a gesture listener, which fails with an error about the looper
not being initialized. I am not sure what's going on there - one option
would be to move the test to androidTest.

* Drop v2 sched file; rename files

* Drop AbstractSched and legacy undo code/queue code

* Migrate BaseSched into Scheduler

* More unused symbol removal

* Remove DeckTreeNode

* Remove unused processChildren()

* Remove shouldDisplayCounts(), as counts always available

* Remove manual hashCode()/compareTo() implementations

* Drop AbstractDeckTreeNode

* Turn DeckNode into a wrapper for DeckTreeNode

* Drop TreeNode and simplify filtering

* Remove `New card position` global preference

Overridden by per-deck configuration

Closes #12319

* fix: remove chess.css from card_template_html

* Store current queue state in reviewer

Prerequisite for solving #12620

Also dropped answerButtons(), as it's always 4

* Use local HTTP server for serving flashcard content

Prerequisite for solving #12620

* Implement support for custom JS scheduling

Enables FSRS and closes #12620

* Remove more unused code

* Remove separate Deck(Config)V16 objects and more unused code

* Move some NotetypeJson methods into its file

* Finish tidying Decks.kt

* Drop redundant col property on Collection

* Remove some usages of CollectionGetter

* Rename col->getColUnsafe to encourage migration

* Remove Reviewer.sched

* Handle deck tree not initialized in empty collection

* refactor: move syncStatus() to Collection

to avoid direct calls to the backend

* fix: do not show error when updating the menu if there is no internet

Reproduction steps:
1. have the collection synced
2. disable the device internet connection
3. Restart the app

* Remove unused resources and re-enable lint

* Restore sync cancel strings

* Defer loading webpage until server has initialized

* Ignore translations without a base entry

https://github.com/ankidroid/Anki-Android/pull/14171#issuecomment-1660286342

* Remove the SortOrder deprecation

* Remove the apparently-unused Backup.kt

* Remove last remaining use of Collection's context field

* Stop passing Context to backend

The library loading is now AnkiDroid's responsibility, so the backend
does not require access to an Android context.

Also remove the unused context field from Collection.

* Use backend for rendering next time labels

* Use backend for rendering finished message

The custom study & unbury descriptions are slightly different, but
should suffice until AnkiDroid can start using the Svelte finished
screen.

* Run SchedulerTest without Robolectric

Halves the run time. To do this, I implemented a new JvmTest class
and copied some of the helpers in RobolectricTest into it.

* Remove unused Kotlin implementation of template parsing

* Move Util code dealing with resources out of libanki

* Migrate remaining libanki tests to raw JVM

+ Remove some commented-out tests

Total savings are a drop from about 3m40s to 2m40s, with the scheduler
test class dropping its runtime by about half.

* Lazy-initialize col in tests

* Restore 'experimental' string

* Add comments to update-localizations.py

* Restore AcraAnalyticsInteraction.kt

---------

Co-authored-by: Brayan Oliveira <69634269+brayandso@users.noreply.github.com>
2023-08-31 05:44:03 +08:00
David Allison
8c2a66eca9 build: update targetSdkVersion to 32
Android 12L (API level 32) is a minor release that makes Android 12 even better on large screens.

There are no breaking changes. Since we have removed support for TVs, this is primarily relevant for
foldable phones and Chromebooks

Since Google has imposed a hard deadline in a couple of weeks, only tested on:
* Large Desktop API 32

Changes: https://developer.android.com/about/versions/12/12L/summary

Issue 14129
2023-08-18 15:05:57 -05:00
Mike Hardy
f8ea30d275
Dependency updates 20230630 (#14058)
* Bump com.squareup.leakcanary:leakcanary-android from 2.11 to 2.12

Bumps [com.squareup.leakcanary:leakcanary-android](https://github.com/square/leakcanary) from 2.11 to 2.12.
- [Release notes](https://github.com/square/leakcanary/releases)
- [Changelog](https://github.com/square/leakcanary/blob/main/docs/changelog.md)
- [Commits](https://github.com/square/leakcanary/compare/v2.11...v2.12)

---
updated-dependencies:
- dependency-name: com.squareup.leakcanary:leakcanary-android
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump org.jetbrains.kotlinx:kotlinx-coroutines-test from 1.7.1 to 1.7.2

Bumps [org.jetbrains.kotlinx:kotlinx-coroutines-test](https://github.com/Kotlin/kotlinx.coroutines) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.7.1...1.7.2)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump com.github.triplet.play from 3.8.3 to 3.8.4

Bumps com.github.triplet.play from 3.8.3 to 3.8.4.

---
updated-dependencies:
- dependency-name: com.github.triplet.play
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 (#13912)

* Bump com.android.tools.build:gradle from 7.4.2 to 8.0.2

Bumps com.android.tools.build:gradle from 7.4.2 to 8.0.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): forward-port BuildConfig / aidl / default-component to gradle 8

* convert to non-transitive R.attr style

- directly address the attributes via their specific names
- remove an R-containing IntDef since R is no longer constant
  (the whole UndoAction class will disappear with new backend anyway)

* Use attrs directly from `android`

Practically, it is a non-functional change, but is is best and more natural to use attrs directly from android instead of using `com.google.android.material` as a intermediate

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Hardy <github@mikehardy.net>
Co-authored-by: Brayan Oliveira <69634269+brayandso@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brayan Oliveira <69634269+brayandso@users.noreply.github.com>
2023-07-01 10:09:10 -05:00
David Allison
b4c5baf3f0 build: update targetSdkVersion to 31 2023-04-21 17:22:28 +03:00
David Allison
56a195bf46 Bump to API 30 & enable MANAGE_EXTERNAL_STORAGE
MANAGE_EXTERNAL_STORAGE is for non-Google Play builds.

Google won't let us have the permission, but there's no reason
other stores + users have to suffer this decision.

This allows a Google Play user to restore their data if they uninstall
(uninstall, then download the APK and data is available again)

* Remove MANAGE_EXTERNAL_STORAGE from the manifest if targeting `play`

Version Codes & Outcomes:

1 < Q - force storage permissions as done previously (incl. Play Store)
2   Q - Users are unsafe and need a storage migration
        * MANAGE_EXTERNAL_STORAGE is unavailable
        * READ/WRITE_EXTERNAL_STORAGE is unavailable
3 > Q - Non-Play-Store users need MANAGE_EXTERNAL_STORAGE (*)
4 > Q - Play Store users are unsafe and need a storage migration

If a user is starting out and may request 'safe' permissions (1) (3)
Then we keep `deckPath` as a legacy path.

1) & 3) We do not allow access to the app until they give permission

----

Storage can be re-enabled after this change via:

```
adb shell am compat disable DEFAULT_SCOPED_STORAGE com.ichi2.anki.debug
adb shell am compat disable FORCE_ENABLE_SCOPED_STORAGE com.ichi2.anki.debug
adb shell pm grant com.ichi2.anki.debug android.permission.READ_EXTERNAL_STORAGE
adb shell pm grant com.ichi2.anki.debug android.permission.WRITE_EXTERNAL_STORAGE
```

on an API 30 emulator (or a non-AOSP emulator)

Related: Issue 5304
Fixes 13051 - targetSdkVersion 30 fixes this
2023-03-20 12:44:59 -05:00
Mike Hardy
6444f97dae
Dependency updates 20220228 (#13364)
* Bump com.github.triplet.play from 3.7.0 to 3.8.1

Bumps com.github.triplet.play from 3.7.0 to 3.8.1.

---
updated-dependencies:
- dependency-name: com.github.triplet.play
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump org.jsoup:jsoup from 1.15.3 to 1.15.4

Bumps [org.jsoup:jsoup](https://github.com/jhy/jsoup) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/jhy/jsoup/releases)
- [Changelog](https://github.com/jhy/jsoup/blob/master/CHANGES)
- [Commits](https://github.com/jhy/jsoup/compare/jsoup-1.15.3...jsoup-1.15.4)

---
updated-dependencies:
- dependency-name: org.jsoup:jsoup
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump androidx.annotation:annotation from 1.5.0 to 1.6.0

Bumps androidx.annotation:annotation from 1.5.0 to 1.6.0.

---
updated-dependencies:
- dependency-name: androidx.annotation:annotation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump lint_version from 30.4.1 to 30.4.2

Bumps `lint_version` from 30.4.1 to 30.4.2.

Updates `com.android.tools.lint:lint-api` from 30.4.1 to 30.4.2

Updates `com.android.tools.lint:lint` from 30.4.1 to 30.4.2

Updates `com.android.tools.lint:lint-tests` from 30.4.1 to 30.4.2

---
updated-dependencies:
- dependency-name: com.android.tools.lint:lint-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.android.tools.lint:lint
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.android.tools.lint:lint-tests
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump com.android.tools.build:gradle from 7.4.1 to 7.4.2

Bumps com.android.tools.build:gradle from 7.4.1 to 7.4.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-28 09:25:18 -05:00
Mike Hardy
a06e727f60
Dependency Updates 20220219 (#13305)
* Bump org.jlleitschuh.gradle:ktlint-gradle from 11.1.0 to 11.2.0 (#13265)

* Bump org.jlleitschuh.gradle:ktlint-gradle from 11.1.0 to 11.2.0

Bumps org.jlleitschuh.gradle:ktlint-gradle from 11.1.0 to 11.2.0.

---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle:ktlint-gradle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): move ktlint rules to .editorconfig

With new syntax

----

An individual property can be enabled or disabled with a rule property.
The name of the rule property consists of the ktlint_ prefix followed
by the rule set id followed by a _ and the rule id.

> https://pinterest.github.io/ktlint/faq/#why-is-editorconfig-property-disabled_rules-deprecated-and-how-do-i-resolve-this

----

disabled_rules is deprecated:

https://pinterest.github.io/ktlint/faq/#why-is-editorconfig-property-disabled_rules-deprecated-and-how-do-i-resolve-this

ktlint-gradle v11.2.0 resolves a few issues around this

> Fixed disabled_rules set only in editorconfig in ktlint 0.46+
> Fixed disabled_rules warning when using new editorconfig syntax in ktlint 0.48+

https://github.com/JLLeitschuh/ktlint-gradle/releases/tag/v11.2.0

* lint: fix new ktlint errors

Caused when we remove the version specifier in ktlint-gradle

* Argument should be on a separate line (unless all arguments can fit a single line)
* File annotations should be separated from file contents with a blank line
* Declarations and declarations with comments should have an empty space between.
* Multiple annotations should not be placed on the same line as the annotated construct

Removed unused `KotlinCleanup` class rather than fixing lint errors

* build(deps): depend on ktlint-gradle's ktlint

Some lint indentation was reduced due to this.
Fixed it manually as I didn't like the change

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>

* autoformat squash

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
2023-02-19 12:15:26 -05:00
Mike Hardy
625e6c71cb
Dependency updates 20220216 (#13280)
* Bump kotlin_version from 1.7.22 to 1.8.10 (#13196)

* Bump kotlin_version from 1.7.22 to 1.8.10

Bumps `kotlin_version` from 1.7.22 to 1.8.10.

Updates `org.jetbrains.kotlin:kotlin-gradle-plugin` from 1.7.22 to 1.8.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10)

Updates `org.jetbrains.kotlin:kotlin-stdlib` from 1.7.22 to 1.8.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10)

Updates `org.jetbrains.kotlin:kotlin-test` from 1.7.22 to 1.8.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10)

Updates `org.jetbrains.kotlin:kotlin-reflect` from 1.7.22 to 1.8.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10)

Updates `org.jetbrains.kotlin:kotlin-test-junit5` from 1.7.22 to 1.8.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10)

Updates `org.jetbrains.kotlin:kotlin-test-junit` from 1.7.22 to 1.8.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlin:kotlin-test
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlin:kotlin-reflect
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlin:kotlin-test-junit5
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlin:kotlin-test-junit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Enable OptIn(ExperimentalCoroutinesApi) for project

This will eliminate all warnings related to experimental coroutines api usages in the project, with the exception of
the "api" module which was ignored. The reason for this is that the module doesn't currently use coroutines so the library(
and the annotation) isn't available which results in a warning(and a crash as all warnings are fatal) when building.

See: https://youtrack.jetbrains.com/issue/KT-28777/Using-experimental-coroutines-api-causes-unresolved-dependency

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com>

* Bump androidx.exifinterface:exifinterface from 1.3.5 to 1.3.6

Bumps androidx.exifinterface:exifinterface from 1.3.5 to 1.3.6.

---
updated-dependencies:
- dependency-name: androidx.exifinterface:exifinterface
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump androidx.browser:browser from 1.4.0 to 1.5.0

Bumps androidx.browser:browser from 1.4.0 to 1.5.0.

---
updated-dependencies:
- dependency-name: androidx.browser:browser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump sqlite-framework from 2.2.0 to 2.3.0 (#13104)

Bumps sqlite-framework from 2.2.0 to 2.3.0.

---
updated-dependencies:
- dependency-name: androidx.sqlite:sqlite-framework
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update database related code to match the new release parameter types

Changes in this PR:
- DatabaseChangeDecorator: update of the methods signatures according to the library types changes, safe because we went from non nullable parameter types to more permisive nullable types
- DB: went from nullable query/bindArgs parameters to non null types. Reviewed all usages of the changed methods and verified that the changes are ok. One of the methods was changed
to remove the bindArgs param(which was set to null) because they weren't used and they were breaking the type system.
- Anki2Importer: remove the null bindArgs parameter as it wasn't used and it was breaking the type system.
- Finder: replaced bindArgs parameter value with an emptyArray() if it is null to conform to the new type system(I assumed that a null value represented no bindARgs parameters).
This SHOULD be ok but is difficult to say for sure as the code building the query is complex.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com>

* Bump androidx.appcompat:appcompat from 1.6.0-rc01 to 1.7.0-alpha02

Bumps androidx.appcompat:appcompat from 1.6.0-rc01 to 1.7.0-alpha02.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix kotlin/java compile target harmony issues

```
 * What went wrong:
  Execution failed for task ':lint-rules:compileTestKotlin'.
 'compileTestJava' task (current target is 11) and 'compileTestKotlin' task (current target is 18) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
```

https://issuetracker.google.com/issues/260059413
https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com>
2023-02-17 07:34:53 -05:00
David Allison
60a823d9c2 AGP: Move package from Android manifest to build files
AGP 7.4.1

Automated step by Android Gradle Plugin

Declaration of a project's namespace using the package attribute of
the Android manifest is deprecated in favour of a namespace declaration
 in build files.

https://developer.android.com/studio/past-releases/past-agp-releases/agp-7-3-0-release-notes#package-deprecated
2023-02-16 10:37:06 -05:00
David Allison
ff72a861be ci: debug identifier -> 'com.ichi2.anki.debug'
Since we're moving to scoped storage, uninstalling the app will very likely
delete user data.

In Debug/Dev, we want this to impact the dev's workflow as little as possible
So we change the applicationId. This relays the expectation that a 'stable'
anki should be using 'com.ichi2.anki' and an 'unstable/dev' AnkiDroid should be
'com.ichi2.anki.debug'. A developer should have two copies of the app, each with
their own storage location.

API:

As previously, define the API permissions/authority using the applicationId:
permission: 'com.ichi2.anki.debug.permission'
authority: 'com.ichi2.anki.debug.flashcards'

androidTest needs to access 'com.ichi2.anki.debug.flashcards' and have
'com.ichi2.anki.debug.permission'.

To resolve this, if the API is built in debug mode, the constants are modified:

(api/build.gradle)
* AUTHORITY = "com.ichi2.anki.debug.flashcards"
* READ_WRITE_PERMISSION = "com.ichi2.anki.debug.permission.READ_WRITE_DATABASE"

Implementation:

High level:
* Define variables in build.gradle
* Handle modifying them via parallel-package-name.sh

Low level:
* Use 'applicationIdSuffix' for this

* Modifies '<provider android:authorities>' in AndroidManifest.xml
  * Required for installation on device
  * Use 'applicationId'
* Modifies '<permission android:name' in AndroidManifest.xml
  * Not required - cleanup on parallel-package-name.sh
* Modifies preferences_sync.xml
  * via resValue in build.gradle
  * Fixes crash

Source for both: https://developer.android.com/studio/build/build-variants#build-types

applicationIdSuffix:
https://developer.android.com/reference/tools/gradle-api/7.3/com/android/build/api/dsl/ApplicationVariantDimension#applicationIdSuffix()

@string/applicationId
* syntax ref: https://stackoverflow.com/questions/27954215/changing-resvalue-in-variant

manifestPlaceholders/${applicationId}
https://developer.android.com/studio/build/manage-manifests

Learning:
> By default, the build tools also provide your app's application ID in the ${applicationId} placeholder. The value always matches the final application ID for the current build, including changes by build variants. This is useful when you want to use a unique namespace for identifiers such as an intent action, even between your build variants.

https://developer.android.com/studio/build/manage-manifests
2023-01-14 12:15:12 +02:00
David Allison
7471cd084a chore(api): extract constants to build.gradle
These values will be changed when enabling API tests for 'com.ichi2.anki.debug'
2023-01-14 12:15:12 +02:00
Aditya kumar
105134d957
TextUtils.join and .isEmpty changed to kotlin methods (#13039)
* TextUtils.join and .isEmpty changed to kotlin methods

* Card Browser Changes Reverted

* TextUtils Review

* Update LangaugeUtils

* Reviewed Finder file

* Readme review

* TemplateFilters revert

* isEmpty() to isNotEmpty()

Co-authored-by: AdityaKumar <adi54321kumar@outlook.com>
2023-01-06 20:05:36 -03:00
criticalAY
21886e1a9a TODO updated for contract 2022-12-13 07:41:12 +02:00
Sanjaykumar Sargam
c2ad8ac703
Used """ instead of " to avoid \" (#12839) 2022-11-18 09:06:07 -05:00
Mike Hardy
e3ebea137c refactor(deps): extract robolectric version 2022-11-15 16:38:00 -05:00
Ashish Yadav
00cd08090c
kotlin code cleanup AnkiActivity et al (#12735) 2022-11-09 16:03:25 -05:00
lukstbit
40e261b1ac
Improve nullability for methods in the api module (#12450)
* Fix nullability for Note.getTags()

The returned property from this method is of type Array<String>, also the property is initialiazed with non null strings.

* Fix nullability for AddContentApi.addNote()

Changed the type of tags parameter from Set<String?>? to Set<String>? because:
- it doesn't make sense to have a null tag(what would that mean)
- the method addNotes() below uses a List<Set<String>?>? so either this method is incorrect or that one
- our current code would crash with a null tag string as Utils.joinTags() uses !! to reference the string tags when
doing its work

As a future todo maybe we can change parameter to a default one seeing that the database structure for notes specifies
this column as not null(use an empty String?).

* Fix nullability for AddContentApi.addNotes()

Changed the type of parameter fieldsList from List<Array<String>?> to List<Array<String>> because:
- it doesn't make sense to have null fields for a note(it is possible?)
- it would crash as with a null fields array, Utils.joinFields would return null and we would insert null in a
 non null declared column flds

* Fix nullability for AddContentApi.updateNoteTags()

Changed the type of parameter tags from Set<String?>? to Set<String> because:
- same issue with null tag strings which doesn't make sense and it would crash our code in Utils.joinTags
- the tags parameter was made non null, this is an update call so using null(which would result in no tags update)
doesn't make sense

* Fix nullability for AddContentApi.updateNoteFields()

Made the parameter type non null because this is an update call and using null would do no update so the call would be
useless(why do it?).

* Fix nullability for AddContentApi.addNewBasicModel()

Made the name non null, can the model have a null name?

* Fix nullability for AddContentApi.addNewBasic2Model()

Made name non null(can the model have null as name?)

* Fix nullability for AddContentApi.addNewCustomModel()

Made name non null (can the model have null as name?)
Also silenced a silly IDE reported issue.

* Fix nullability for AddContentApi.addNewDeck()

Made the name parameter as non null, does it make sense to have adeck with null for name?!

* Fix nullability for AddContentApi.findDuplicateNotes()

Made the keys parameter as List<String> from List<String?>. What duplicates to find for a null key?

* Remove todo about nullability in AddContentApi
2022-10-30 19:41:40 -05:00
Potatoboy9999
6d9e8c7290
Replace usages of String.format in with string templating (#12555)
* Replace usages of String.format in with string templating

* Remove forgotten test code
2022-10-03 00:58:59 +05:30
Mike Hardy
5f8c2f7938
Dependency updates 20220929 (#12533)
* Bump junit_version from 5.9.0 to 5.9.1

Bumps `junit_version` from 5.9.0 to 5.9.1.

Updates `junit-jupiter` from 5.9.0 to 5.9.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.9.0...r5.9.1)

Updates `junit-vintage-engine` from 5.9.0 to 5.9.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.9.0...r5.9.1)

Updates `junit-jupiter-params` from 5.9.0 to 5.9.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.9.0...r5.9.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.junit.vintage:junit-vintage-engine
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump annotation from 1.4.0 to 1.5.0

Bumps annotation from 1.4.0 to 1.5.0.

---
updated-dependencies:
- dependency-name: androidx.annotation:annotation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump mockk from 1.12.8 to 1.13.1

Bumps [mockk](https://github.com/mockk/mockk) from 1.12.8 to 1.13.1.
- [Release notes](https://github.com/mockk/mockk/releases)
- [Commits](https://github.com/mockk/mockk/commits)

---
updated-dependencies:
- dependency-name: io.mockk:mockk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump activity-ktx from 1.5.1 to 1.6.0

Bumps activity-ktx from 1.5.1 to 1.6.0.

---
updated-dependencies:
- dependency-name: androidx.activity:activity-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump fragments_version from 1.5.2 to 1.5.3

Bumps `fragments_version` from 1.5.2 to 1.5.3.

Updates `fragment-ktx` from 1.5.2 to 1.5.3

Updates `fragment-testing` from 1.5.2 to 1.5.3

---
updated-dependencies:
- dependency-name: androidx.fragment:fragment-ktx
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: androidx.fragment:fragment-testing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump mockk from 1.13.1 to 1.13.2

Bumps [mockk](https://github.com/mockk/mockk) from 1.13.1 to 1.13.2.
- [Release notes](https://github.com/mockk/mockk/releases)
- [Commits](https://github.com/mockk/mockk/compare/1.13.1...1.13.2)

---
updated-dependencies:
- dependency-name: io.mockk:mockk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump kotlin_version from 1.7.10 to 1.7.20

Bumps `kotlin_version` from 1.7.10 to 1.7.20.

Updates `kotlin-gradle-plugin` from 1.7.10 to 1.7.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-stdlib` from 1.7.10 to 1.7.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-test` from 1.7.10 to 1.7.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-reflect` from 1.7.10 to 1.7.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-test-junit5` from 1.7.10 to 1.7.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-test-junit` from 1.7.10 to 1.7.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-reflect
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-test-junit5
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-test-junit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-29 12:04:39 -05:00
Jalin Wang
5524bf1b83 [KotlinCleanup] use kotlin.test.* for asserting 2022-09-21 13:45:52 -03:00
lukstbit
915f11b552 Enable strict mode for api module 2022-09-19 14:44:09 -03:00
lukstbit
bfeb1cbbbd Make ApiUtilsTest as internal to fix visibility error
Apparently visbility modifiers requirements apply to all classes in the module, even test classes.
2022-09-19 14:44:09 -03:00
lukstbit
a7e83909fe Cleanup FlashCardContract for new api release
This cleanup includes:

- fixing ide lint issues
- adding extra @JvmField annotations to replicate the initial static fields in java, the targets were Uris and the
projection arrays(without the annotations these would have ended in the final bytecode as private static field + getter
method)
- enabled the explicit api mode as this is a library project and I think would be a good addition going forward. I made
the violations as warnings for now( to be able to suppress them for the other api classes) and fixed them for
FlashCardContract. When we finish cleaning up the api module we should move from warning to strict.
See https://kotlinlang.org/docs/whatsnew14.html#explicit-api-mode-for-library-authors
This included specifying the visibility modifiers and the actual properties types(nothing to note here as we have only
strings, not null Uris and not null arrays of not null strings)
- adding some @ Suppress annotations for naming(_ID) and properties not being used(but part of the default projection)

This PR also adds two return types in AddContentApi which I missed in the cleanup of that file.
2022-09-18 07:32:53 -05:00
lukstbit
a8d34e5b36 Add the proper visibility modifiers in AddContentApi
This is required before enabling explicitApi() mode in the build file of the api module.
Also adds the @JvmStatic annotation for one of the methods to follow the original method signature.
2022-09-17 22:06:56 -05:00
lukstbit
2da11b26bd Fix last TODOs for member properties in AddContentApi
The original todos pointed at using @JvmField but this is not applicable as there's no backing field to use.
Also the changes in this commit replicate the java api(visibility and appearance(they were functions)). See last commit
as java file in f39b7fa10f
2022-09-17 22:06:56 -05:00
lukstbit
457ba52044 Cleanup NoteInfo for api release 2022-09-17 19:27:41 +01:00
Mike Hardy
46a4f564d6
Dependency updates 20220917 (#12427)
* build(deps): bump mockk from 1.12.7 to 1.12.8

Bumps [mockk](https://github.com/mockk/mockk) from 1.12.7 to 1.12.8.
- [Release notes](https://github.com/mockk/mockk/releases)
- [Commits](https://github.com/mockk/mockk/compare/1.12.7...v1.12.8)

---
updated-dependencies:
- dependency-name: io.mockk:mockk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump protobuf-kotlin from 3.21.5 to 3.21.6

Bumps protobuf-kotlin from 3.21.5 to 3.21.6.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps)!: bump gradle from 7.2.2 to 7.3.0

Bumps gradle from 7.2.2 to 7.3.0.

Note: api minSdkVersion bumped to 16, new gradle version uncovered this NewApi failure
This is another item queued up for API breaking change list

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump lint_version from 30.2.2 to 30.3.0

Bumps `lint_version` from 30.2.2 to 30.3.0.

Updates `lint-api` from 30.2.2 to 30.3.0

Updates `lint` from 30.2.2 to 30.3.0

Updates `lint-tests` from 30.2.2 to 30.3.0

---
updated-dependencies:
- dependency-name: com.android.tools.lint:lint-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.android.tools.lint:lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.android.tools.lint:lint-tests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-17 12:54:23 -05:00
lukstbit
2b150470e2 Cleanup for AddContentApi for new API release
Note that there are several TODOs still present, these will be addressed in another PR as they are related
more to the visibility and type system.
2022-09-15 21:52:08 -03:00
lukstbit
989b63ec94 Set Basic2Model as internal to follow original visibility 2022-09-14 18:25:28 -03:00
Mike Hardy
2eeed6570e build: bump compileSdkVersion to 33 2022-09-09 21:03:19 -03:00
David Allison
512c86eb8a chore: remove redundant '@JvmField' annotations
We're no longer in Java, so only a few annotations are still necessary.

These are mostly test methods (`@Parameter/@Rule`),
This is a potentially flaky commit, hopefully the reduction in code causes a reduction in compile times

It did not modify the API project public classes
2022-09-09 13:16:30 -03:00